|
| 1 | +// RUN: %clang_cc1 -triple aarch64-none-linux-android24 -Wno-unused-value -fclangir -emit-cir %s -o %t.cir |
| 2 | +// RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR |
| 3 | +// RUN: %clang_cc1 -triple aarch64-none-linux-android24 -Wno-unused-value -fclangir -emit-llvm %s -o %t-cir.ll |
| 4 | +// RUN: FileCheck --input-file=%t-cir.ll %s -check-prefix=LLVM |
| 5 | +// RUN: %clang_cc1 -triple aarch64-none-linux-android24 -Wno-unused-value -emit-llvm %s -o %t.ll |
| 6 | +// RUN: FileCheck --input-file=%t.ll %s -check-prefix=OGCG |
| 7 | + |
| 8 | +typedef int vint4 __attribute__((ext_vector_type(4))); |
| 9 | +typedef float vfloat4 __attribute__((ext_vector_type(4))); |
| 10 | +typedef double vdouble4 __attribute__((ext_vector_type(4))); |
| 11 | + |
| 12 | +void test_builtin_elementwise_acos(float f, double d, vfloat4 vf4, |
| 13 | + vdouble4 vd4) { |
| 14 | + // CIR-LABEL: test_builtin_elementwise_acos |
| 15 | + // LLVM-LABEL: test_builtin_elementwise_acos |
| 16 | + // OGCG-LABEL: test_builtin_elementwise_acos |
| 17 | + |
| 18 | + // CIR: %{{.*}} = cir.acos %{{.*}} : !cir.float |
| 19 | + // LLVM: %{{.*}} = call float @llvm.acos.f32(float %{{.*}}) |
| 20 | + // OGCG: %{{.*}} = call float @llvm.acos.f32(float %{{.*}}) |
| 21 | + f = __builtin_elementwise_acos(f); |
| 22 | + |
| 23 | + // CIR: %{{.*}} = cir.acos %{{.*}} : !cir.double |
| 24 | + // LLVM: %{{.*}} = call double @llvm.acos.f64(double %{{.*}}) |
| 25 | + // OGCG: %{{.*}} = call double @llvm.acos.f64(double %{{.*}}) |
| 26 | + d = __builtin_elementwise_acos(d); |
| 27 | + |
| 28 | + // CIR: %{{.*}} = cir.acos %{{.*}} : !cir.vector<4 x !cir.float> |
| 29 | + // LLVM: %{{.*}} = call <4 x float> @llvm.acos.v4f32(<4 x float> %{{.*}}) |
| 30 | + // OGCG: %{{.*}} = call <4 x float> @llvm.acos.v4f32(<4 x float> %{{.*}}) |
| 31 | + vf4 = __builtin_elementwise_acos(vf4); |
| 32 | + |
| 33 | + // CIR: %{{.*}} = cir.acos %{{.*}} : !cir.vector<4 x !cir.double> |
| 34 | + // LLVM: %{{.*}} = call <4 x double> @llvm.acos.v4f64(<4 x double> %{{.*}}) |
| 35 | + // OGCG: %{{.*}} = call <4 x double> @llvm.acos.v4f64(<4 x double> %{{.*}}) |
| 36 | + vd4 = __builtin_elementwise_acos(vd4); |
| 37 | +} |
| 38 | + |
0 commit comments