@@ -21,6 +21,13 @@ void test_builtin_elementwise_abs() {
21
21
static_assert (!is_const<decltype (__builtin_elementwise_abs (b))>::value);
22
22
}
23
23
24
+ void test_builtin_elementwise_abs_fp () {
25
+ const float a = -2 .0f ;
26
+ float b = 1 .0f ;
27
+ static_assert (!is_const<decltype (__builtin_elementwise_abs (a))>::value);
28
+ static_assert (!is_const<decltype (__builtin_elementwise_abs (b))>::value);
29
+ }
30
+
24
31
void test_builtin_elementwise_add_sat () {
25
32
const int a = 2 ;
26
33
int b = 1 ;
@@ -53,6 +60,22 @@ void test_builtin_elementwise_min() {
53
60
static_assert (!is_const<decltype (__builtin_elementwise_min (a, a))>::value);
54
61
}
55
62
63
+ void test_builtin_elementwise_max_fp () {
64
+ const float a = 2 .0f ;
65
+ float b = 1 .0f ;
66
+ static_assert (!is_const<decltype (__builtin_elementwise_max (a, b))>::value);
67
+ static_assert (!is_const<decltype (__builtin_elementwise_max (b, a))>::value);
68
+ static_assert (!is_const<decltype (__builtin_elementwise_max (a, a))>::value);
69
+ }
70
+
71
+ void test_builtin_elementwise_min_fp () {
72
+ const float a = 2 .0f ;
73
+ float b = 1 .0f ;
74
+ static_assert (!is_const<decltype (__builtin_elementwise_min (a, b))>::value);
75
+ static_assert (!is_const<decltype (__builtin_elementwise_min (b, a))>::value);
76
+ static_assert (!is_const<decltype (__builtin_elementwise_min (a, a))>::value);
77
+ }
78
+
56
79
void test_builtin_elementwise_ceil () {
57
80
const float a = 42.0 ;
58
81
float b = 42.3 ;
@@ -122,3 +145,56 @@ void test_builtin_elementwise_nearbyint() {
122
145
static_assert (!is_const<decltype (__builtin_elementwise_nearbyint (a))>::value);
123
146
static_assert (!is_const<decltype (__builtin_elementwise_nearbyint (b))>::value);
124
147
}
148
+
149
+ void test_builtin_elementwise_round () {
150
+ const float a = 42.5 ;
151
+ float b = 42.3 ;
152
+ static_assert (!is_const<decltype (__builtin_elementwise_round (a))>::value);
153
+ static_assert (!is_const<decltype (__builtin_elementwise_round (b))>::value);
154
+ }
155
+
156
+ void test_builtin_elementwise_roundeven () {
157
+ const float a = 42.5 ;
158
+ float b = 42.3 ;
159
+ static_assert (!is_const<decltype (__builtin_elementwise_roundeven (a))>::value);
160
+ static_assert (!is_const<decltype (__builtin_elementwise_roundeven (b))>::value);
161
+ }
162
+
163
+ void test_builtin_elementwise_trunc () {
164
+ const float a = 42.5 ;
165
+ float b = 42.3 ;
166
+ static_assert (!is_const<decltype (__builtin_elementwise_trunc (a))>::value);
167
+ static_assert (!is_const<decltype (__builtin_elementwise_trunc (b))>::value);
168
+ }
169
+
170
+ void test_builtin_elementwise_floor () {
171
+ const float a = 42.5 ;
172
+ float b = 42.3 ;
173
+ static_assert (!is_const<decltype (__builtin_elementwise_floor (a))>::value);
174
+ static_assert (!is_const<decltype (__builtin_elementwise_floor (b))>::value);
175
+ }
176
+
177
+ void test_builtin_elementwise_canonicalize () {
178
+ const float a = 42.5 ;
179
+ float b = 42.3 ;
180
+ static_assert (!is_const<decltype (__builtin_elementwise_canonicalize (a))>::value);
181
+ static_assert (!is_const<decltype (__builtin_elementwise_canonicalize (b))>::value);
182
+ }
183
+
184
+ void test_builtin_elementwise_copysign () {
185
+ const float a = 2 .0f ;
186
+ float b = -4 .0f ;
187
+ static_assert (!is_const<decltype (__builtin_elementwise_copysign (a, b))>::value);
188
+ static_assert (!is_const<decltype (__builtin_elementwise_copysign (b, a))>::value);
189
+ static_assert (!is_const<decltype (__builtin_elementwise_copysign (a, a))>::value);
190
+ }
191
+
192
+ void test_builtin_elementwise_fma () {
193
+ const float a = 2 .0f ;
194
+ float b = -4 .0f ;
195
+ float c = 1 .0f ;
196
+ static_assert (!is_const<decltype (__builtin_elementwise_fma (a, a, a))>::value);
197
+ static_assert (!is_const<decltype (__builtin_elementwise_fma (a, b, c))>::value);
198
+ static_assert (!is_const<decltype (__builtin_elementwise_fma (b, a, c))>::value);
199
+ static_assert (!is_const<decltype (__builtin_elementwise_fma (c, c, c))>::value);
200
+ }
0 commit comments