Created
February 13, 2013 15:30
-
-
Save syoyo/4945410 to your computer and use it in GitHub Desktop.
clang's vector extension -> ARM NEON codegen test.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef float float4 __attribute__((ext_vector_type(4))); | |
void | |
clang_test(float* out, float* in) | |
{ | |
float4 a, b; | |
b = *((float4*)in); | |
a = b * b; | |
*((float4 *)out) = a; | |
} | |
// asm output | |
vld1.64 {d16, d17}, [r1, :128] | |
.loc 1 19 3 @ /Users/syoyo/work/ios_dev/clangtest/clangtest/clangtest.cc:19:3 | |
vmul.f32 q8, q8, q8 | |
Ltmp0: | |
@DEBUG_VALUE: a <- Q8+0 | |
.loc 1 21 3 @ /Users/syoyo/work/ios_dev/clangtest/clangtest/clangtest.cc:21:3 | |
vst1.64 {d16, d17}, [r0, :128] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment