Debian Codegraph @

clang/test/CodeGen/arm-mve-intrinsics/vmaxnmq.c

raw
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // RUN: %clang_cc1 -triple thumbv8.1m.main-none-none-eabi -target-feature +mve.fp -mfloat-abi hard -disable-O0-optnone -emit-llvm -o - %s | opt -S -passes=mem2reg | FileCheck %s --check-prefixes=CHECK,CHECK-NOSTRICT
3 // RUN: %clang_cc1 -triple thumbv8.1m.main-none-none-eabi -target-feature +mve.fp -mfloat-abi hard -disable-O0-optnone -DPOLYMORPHIC -emit-llvm -o - %s | opt -S -passes=mem2reg | FileCheck %s --check-prefixes=CHECK,CHECK-NOSTRICT
4 // RUN: %clang_cc1 -triple thumbv8.1m.main-none-none-eabi -target-feature +mve.fp -mfloat-abi hard -disable-O0-optnone -frounding-math -fexperimental-strict-floating-point -emit-llvm -o - %s | opt -S -passes=mem2reg | FileCheck %s --check-prefixes=CHECK,CHECK-STRICT
5 // RUN: %clang_cc1 -triple thumbv8.1m.main-none-none-eabi -target-feature +mve.fp -mfloat-abi hard -disable-O0-optnone -frounding-math -fexperimental-strict-floating-point -DPOLYMORPHIC -emit-llvm -o - %s | opt -S -passes=mem2reg | FileCheck %s --check-prefixes=CHECK,CHECK-STRICT
6
7 // REQUIRES: aarch64-registered-target || arm-registered-target
8
9 #include <arm_mve.h>
10
11 // CHECK-NOSTRICT-LABEL: @test_vmaxnmq_f16(
12 // CHECK-NOSTRICT-NEXT: entry:
13 // CHECK-NOSTRICT-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.maxnum.v8f16(<8 x half> [[A:%.*]], <8 x half> [[B:%.*]])
14 // CHECK-NOSTRICT-NEXT: ret <8 x half> [[TMP0]]
15 //
16 // CHECK-STRICT-LABEL: @test_vmaxnmq_f16(
17 // CHECK-STRICT-NEXT: entry:
18 // CHECK-STRICT-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.arm.mve.vmaxnm.v8f16(<8 x half> [[A:%.*]], <8 x half> [[B:%.*]]) #[[ATTR2:[0-9]+]]
19 // CHECK-STRICT-NEXT: ret <8 x half> [[TMP0]]
20 //
21 float16x8_t test_vmaxnmq_f16(float16x8_t a, float16x8_t b)
22 {
23 #ifdef POLYMORPHIC
24 return vmaxnmq(a, b);
25 #else /* POLYMORPHIC */
26 return vmaxnmq_f16(a, b);
27 #endif /* POLYMORPHIC */
28 }
29
30 // CHECK-NOSTRICT-LABEL: @test_vmaxnmq_f32(
31 // CHECK-NOSTRICT-NEXT: entry:
32 // CHECK-NOSTRICT-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.maxnum.v4f32(<4 x float> [[A:%.*]], <4 x float> [[B:%.*]])
33 // CHECK-NOSTRICT-NEXT: ret <4 x float> [[TMP0]]
34 //
35 // CHECK-STRICT-LABEL: @test_vmaxnmq_f32(
36 // CHECK-STRICT-NEXT: entry:
37 // CHECK-STRICT-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.arm.mve.vmaxnm.v4f32(<4 x float> [[A:%.*]], <4 x float> [[B:%.*]]) #[[ATTR2]]
38 // CHECK-STRICT-NEXT: ret <4 x float> [[TMP0]]
39 //
40 float32x4_t test_vmaxnmq_f32(float32x4_t a, float32x4_t b)
41 {
42 #ifdef POLYMORPHIC
43 return vmaxnmq(a, b);
44 #else /* POLYMORPHIC */
45 return vmaxnmq_f32(a, b);
46 #endif /* POLYMORPHIC */
47 }
48
49 // CHECK-NOSTRICT-LABEL: @test_vmaxnmq_m_f16(
50 // CHECK-NOSTRICT-NEXT: entry:
51 // CHECK-NOSTRICT-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
52 // CHECK-NOSTRICT-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
53 // CHECK-NOSTRICT-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.max.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x half> [[B:%.*]], i32 0, <8 x i1> [[TMP1]], <8 x half> [[INACTIVE:%.*]])
54 // CHECK-NOSTRICT-NEXT: ret <8 x half> [[TMP2]]
55 //
56 // CHECK-STRICT-LABEL: @test_vmaxnmq_m_f16(
57 // CHECK-STRICT-NEXT: entry:
58 // CHECK-STRICT-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
59 // CHECK-STRICT-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]]) #[[ATTR2]]
60 // CHECK-STRICT-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.max.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x half> [[B:%.*]], i32 0, <8 x i1> [[TMP1]], <8 x half> [[INACTIVE:%.*]]) #[[ATTR2]]
61 // CHECK-STRICT-NEXT: ret <8 x half> [[TMP2]]
62 //
63 float16x8_t test_vmaxnmq_m_f16(float16x8_t inactive, float16x8_t a, float16x8_t b, mve_pred16_t p)
64 {
65 #ifdef POLYMORPHIC
66 return vmaxnmq_m(inactive, a, b, p);
67 #else /* POLYMORPHIC */
68 return vmaxnmq_m_f16(inactive, a, b, p);
69 #endif /* POLYMORPHIC */
70 }
71
72 // CHECK-NOSTRICT-LABEL: @test_vmaxnmq_m_f32(
73 // CHECK-NOSTRICT-NEXT: entry:
74 // CHECK-NOSTRICT-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
75 // CHECK-NOSTRICT-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
76 // CHECK-NOSTRICT-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.max.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x float> [[B:%.*]], i32 0, <4 x i1> [[TMP1]], <4 x float> [[INACTIVE:%.*]])
77 // CHECK-NOSTRICT-NEXT: ret <4 x float> [[TMP2]]
78 //
79 // CHECK-STRICT-LABEL: @test_vmaxnmq_m_f32(
80 // CHECK-STRICT-NEXT: entry:
81 // CHECK-STRICT-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
82 // CHECK-STRICT-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]]) #[[ATTR2]]
83 // CHECK-STRICT-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.max.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x float> [[B:%.*]], i32 0, <4 x i1> [[TMP1]], <4 x float> [[INACTIVE:%.*]]) #[[ATTR2]]
84 // CHECK-STRICT-NEXT: ret <4 x float> [[TMP2]]
85 //
86 float32x4_t test_vmaxnmq_m_f32(float32x4_t inactive, float32x4_t a, float32x4_t b, mve_pred16_t p)
87 {
88 #ifdef POLYMORPHIC
89 return vmaxnmq_m(inactive, a, b, p);
90 #else /* POLYMORPHIC */
91 return vmaxnmq_m_f32(inactive, a, b, p);
92 #endif /* POLYMORPHIC */
93 }
94
95 // CHECK-NOSTRICT-LABEL: @test_vmaxnmq_x_f16(
96 // CHECK-NOSTRICT-NEXT: entry:
97 // CHECK-NOSTRICT-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
98 // CHECK-NOSTRICT-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
99 // CHECK-NOSTRICT-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.max.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x half> [[B:%.*]], i32 0, <8 x i1> [[TMP1]], <8 x half> undef)
100 // CHECK-NOSTRICT-NEXT: ret <8 x half> [[TMP2]]
101 //
102 // CHECK-STRICT-LABEL: @test_vmaxnmq_x_f16(
103 // CHECK-STRICT-NEXT: entry:
104 // CHECK-STRICT-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
105 // CHECK-STRICT-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]]) #[[ATTR2]]
106 // CHECK-STRICT-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.max.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x half> [[B:%.*]], i32 0, <8 x i1> [[TMP1]], <8 x half> undef) #[[ATTR2]]
107 // CHECK-STRICT-NEXT: ret <8 x half> [[TMP2]]
108 //
109 float16x8_t test_vmaxnmq_x_f16(float16x8_t a, float16x8_t b, mve_pred16_t p)
110 {
111 #ifdef POLYMORPHIC
112 return vmaxnmq_x(a, b, p);
113 #else /* POLYMORPHIC */
114 return vmaxnmq_x_f16(a, b, p);
115 #endif /* POLYMORPHIC */
116 }
117
118 // CHECK-NOSTRICT-LABEL: @test_vmaxnmq_x_f32(
119 // CHECK-NOSTRICT-NEXT: entry:
120 // CHECK-NOSTRICT-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
121 // CHECK-NOSTRICT-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
122 // CHECK-NOSTRICT-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.max.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x float> [[B:%.*]], i32 0, <4 x i1> [[TMP1]], <4 x float> undef)
123 // CHECK-NOSTRICT-NEXT: ret <4 x float> [[TMP2]]
124 //
125 // CHECK-STRICT-LABEL: @test_vmaxnmq_x_f32(
126 // CHECK-STRICT-NEXT: entry:
127 // CHECK-STRICT-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
128 // CHECK-STRICT-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]]) #[[ATTR2]]
129 // CHECK-STRICT-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.max.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x float> [[B:%.*]], i32 0, <4 x i1> [[TMP1]], <4 x float> undef) #[[ATTR2]]
130 // CHECK-STRICT-NEXT: ret <4 x float> [[TMP2]]
131 //
132 float32x4_t test_vmaxnmq_x_f32(float32x4_t a, float32x4_t b, mve_pred16_t p)
133 {
134 #ifdef POLYMORPHIC
135 return vmaxnmq_x(a, b, p);
136 #else /* POLYMORPHIC */
137 return vmaxnmq_x_f32(a, b, p);
138 #endif /* POLYMORPHIC */
139 }
140 //// NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
141 // CHECK: {{.*}}