Skip to content

Commit f55c9e6

Browse files
committed
[android] Check for Android-specific ARMv7 SIMD generated code.
In my testing, it seems that Android default target-attributes/data layout doesn't seem to match those of iOS in ARMv7 (or Linux or Windows). This commit introduces target-sdk-name into the checks, and does a different check depending on the SDK: iOS stays the same; Linux and Windows use the iOS approach; Android is a different beast. To check my assumptions, I used the following small C program and compiled it with Clang from the tree and different targets (armv7-none-ios, armv7-none-linux-gnueabi, armv7-none-windows-msvc). ```c typedef float __attribute__((ext_vector_type(3))) float3; float3 simd_c_args_float3(float3 x) { return x; } ```
1 parent 85a4a04 commit f55c9e6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/IRGen/objc_simd.sil

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-ir %s | %FileCheck %s --check-prefix=%target-cpu
1+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-ir %s | %FileCheck %s --check-prefix=%target-cpu --check-prefix=%target-cpu-%target-sdk-name
22

33
import Swift
44
import simd
@@ -34,7 +34,10 @@ entry(%x : $float4):
3434
// aarch64-LABEL: define{{( dllexport)?}}{{( protected)?}} <3 x float> @simd_c_args_float3(<4 x i32>)
3535
// arm64-LABEL: define{{( dllexport)?}}{{( protected)?}} <3 x float> @simd_c_args_float3(<4 x i32>)
3636
// armv6-LABEL: define{{( dllexport)?}}{{( protected)?}} <3 x float> @simd_c_args_float3(<4 x i32>)
37-
// armv7-LABEL: define{{( dllexport)?}}{{( protected)?}} <3 x float> @simd_c_args_float3(<4 x i32>)
37+
// armv7-ios-LABEL: define <3 x float> @simd_c_args_float3(<4 x i32>)
38+
// armv7-linux-LABEL: define protected <3 x float> @simd_c_args_float3(<4 x i32>)
39+
// armv7-windows-LABEL: define dllexport <3 x float> @simd_c_args_float3(<4 x i32>)
40+
// armv7-android-LABEL: define protected <3 x float> @simd_c_args_float3(<3 x float>)
3841
// armv7s-LABEL: define{{( dllexport)?}}{{( protected)?}} <3 x float> @simd_c_args_float3(<4 x i32>)
3942
// armv7k-LABEL: define{{( dllexport)?}}{{( protected)?}} <3 x float> @simd_c_args_float3(<4 x i32>)
4043
// powerpc64-LABEL: define{{( dllexport)?}}{{( protected)?}} <3 x float> @simd_c_args_float3(<3 x float>)

0 commit comments

Comments
 (0)