2 Copyright 2008 Kristian Nielsen
4 This file is part of BeeDB.
6 Foobar is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 2 of the License, or
9 (at your option) any later version.
11 Foobar is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with Foobar. If not, see <http://www.gnu.org/licenses/>.
24 typedef int v4si
__attribute__ ((vector_size (16)));
25 typedef float v4sf
__attribute__ ((vector_size (16)));
29 load_loop(float *p
, uint64_t count
)
31 if (0xf & (unsigned long)p
)
33 fprintf(stderr
, "load_loop: error: unaligned source\n");
38 v4sf x0
= __builtin_ia32_loadaps(p
);
39 v4sf x1
= __builtin_ia32_loadaps(p
+4);
40 v4sf x2
= __builtin_ia32_loadaps(p
+8);
41 v4sf x3
= __builtin_ia32_loadaps(p
+12);
50 v4si y
= *(v4si
*)(p
+4);
56 load_loop(v4si
*p
, uint64_t count
)
58 if (0xf & (unsigned long)p
)
60 fprintf(stderr
, "load_loop: error: unaligned source\n");
76 main(int argc
, char *argv
)
78 uint64_t count
= 1024*1024*16;
80 v4si
*p
= malloc((count
+1)*64);
85 printf("%d\n", *(char *)(p
+count
));