File tree 3 files changed +302
-220
lines changed
3 files changed +302
-220
lines changed Original file line number Diff line number Diff line change @@ -394,11 +394,22 @@ int main() {
394
394
395
395
Aligns variables on X bit lines.
396
396
397
- This may be required for certain processor specific functions.
397
+ This may be required for certain processor specific functions, in particular SIMD operations .
398
398
399
399
The generated gas assembly code should mark this alignment with the `.align` directive.
400
400
401
401
http://stackoverflow.com/questions/381244/purpose-of-memory-alignment
402
+
403
+ C11 has aligned_alloc:
404
+
405
+ - http://stackoverflow.com/questions/227897/how-to-allocate-aligned-memory-only-using-the-standard-library
406
+ - http://stackoverflow.com/questions/3839922/aligned-malloc-in-gcc
407
+
408
+ Assume that function argument pointer is aligned:
409
+ http://stackoverflow.com/questions/9608171/how-to-tell-gcc-that-a-pointer-argument-is-always-double-word-aligned
410
+
411
+ TODO does it work for stack variables?
412
+ http://stackoverflow.com/questions/841433/are-stack-variables-aligned-by-the-gcc-attribute-alignedx
402
413
*/
403
414
{
404
415
assert (aligned16 == 0 );
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ Basically a more abstract and ISA portable (TODO?) version of intrinsics.
5
5
6
6
Note however that the GCC and other compiles have an auto-vectorization
7
7
optimization, which might use SIMD even if you don't use the vector extensions.
8
+
9
+ TODO: is explicit alignment attribute necessary, or automatically done?
8
10
*/
9
11
10
12
#include "common.h"
You can’t perform that action at this time.
0 commit comments