mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-04-22 14:54:43 +00:00
Release Landlock Make v1.0.1
This commit is contained in:
parent
5c5cf0e01d
commit
95f54eeb40
2 changed files with 43 additions and 1 deletions
42
examples/dot.c
Normal file
42
examples/dot.c
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
#if 0
|
||||||
|
/*─────────────────────────────────────────────────────────────────╗
|
||||||
|
│ To the extent possible under law, Justine Tunney has waived │
|
||||||
|
│ all copyright and related or neighboring rights to this file, │
|
||||||
|
│ as it is written in the following disclaimers: │
|
||||||
|
│ • http://unlicense.org/ │
|
||||||
|
│ • http://creativecommons.org/publicdomain/zero/1.0/ │
|
||||||
|
╚─────────────────────────────────────────────────────────────────*/
|
||||||
|
#endif
|
||||||
|
#include "libc/macros.internal.h"
|
||||||
|
#include "libc/stdio/stdio.h"
|
||||||
|
|
||||||
|
typedef float xmm_t __attribute__((__vector_size__(16), __aligned__(4)));
|
||||||
|
|
||||||
|
float dotvector(float *x, float *y, size_t n) {
|
||||||
|
size_t i;
|
||||||
|
float res;
|
||||||
|
if (n > 64) {
|
||||||
|
return dotvector(x, y, n / 2) + dotvector(x + n / 2, y + n / 2, n - n / 2);
|
||||||
|
}
|
||||||
|
for (res = i = 0; i < n; ++i) {
|
||||||
|
if (i + 4 <= n) {
|
||||||
|
xmm_t res4 = (xmm_t){0};
|
||||||
|
do {
|
||||||
|
res4 += *(xmm_t *)(x + i) * *(xmm_t *)(y + i);
|
||||||
|
} while ((i += 4) + 4 <= n);
|
||||||
|
res += res4[0];
|
||||||
|
res += res4[1];
|
||||||
|
res += res4[2];
|
||||||
|
res += res4[3];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
res += x[i] * y[i];
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char *argv[]) {
|
||||||
|
float x[] = {1, 2, 3, 4, 1, 2, 3, 4};
|
||||||
|
float y[] = {4, 3, 2, 1, 1, 2, 3, 4};
|
||||||
|
printf("%g\n", dotvector(x, y, ARRAYLEN(x)));
|
||||||
|
}
|
2
third_party/make/main.c
vendored
2
third_party/make/main.c
vendored
|
@ -2971,7 +2971,7 @@ print_version (void)
|
||||||
/* Do it only once. */
|
/* Do it only once. */
|
||||||
return;
|
return;
|
||||||
|
|
||||||
printf ("%sGNU Make %s\n", precede, version_string);
|
printf ("%sLandlock Make 1.0.1 (GNU Make %s)\n", precede, version_string);
|
||||||
|
|
||||||
if (!remote_description || *remote_description == '\0')
|
if (!remote_description || *remote_description == '\0')
|
||||||
printf (_("%sBuilt for %s\n"), precede, make_host);
|
printf (_("%sBuilt for %s\n"), precede, make_host);
|
||||||
|
|
Loading…
Add table
Reference in a new issue