Skip to content

Commit cebba7c

Browse files
committed
[SystemZ] Avoid unnecessary conversions in vecintrin.h
Use floating-point instead of integer zero constants to avoid creating implicit conversions, which currently cause suboptimal code to be generated with -ffp-exception-behavior=strict. NFC otherwise.
1 parent ee05138 commit cebba7c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clang/lib/Headers/vecintrin.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ vec_promote(unsigned long long __scalar, int __index) {
290290
#if __ARCH__ >= 12
291291
static inline __ATTRS_o_ai vector float
292292
vec_promote(float __scalar, int __index) {
293-
const vector float __zero = (vector float)0;
293+
const vector float __zero = (vector float)0.0f;
294294
vector float __vec = __builtin_shufflevector(__zero, __zero, -1, -1, -1, -1);
295295
__vec[__index & 3] = __scalar;
296296
return __vec;
@@ -299,7 +299,7 @@ vec_promote(float __scalar, int __index) {
299299

300300
static inline __ATTRS_o_ai vector double
301301
vec_promote(double __scalar, int __index) {
302-
const vector double __zero = (vector double)0;
302+
const vector double __zero = (vector double)0.0;
303303
vector double __vec = __builtin_shufflevector(__zero, __zero, -1, -1);
304304
__vec[__index & 1] = __scalar;
305305
return __vec;
@@ -366,15 +366,15 @@ vec_insert_and_zero(const unsigned long long *__ptr) {
366366
#if __ARCH__ >= 12
367367
static inline __ATTRS_o_ai vector float
368368
vec_insert_and_zero(const float *__ptr) {
369-
vector float __vec = (vector float)0;
369+
vector float __vec = (vector float)0.0f;
370370
__vec[1] = *__ptr;
371371
return __vec;
372372
}
373373
#endif
374374

375375
static inline __ATTRS_o_ai vector double
376376
vec_insert_and_zero(const double *__ptr) {
377-
vector double __vec = (vector double)0;
377+
vector double __vec = (vector double)0.0;
378378
__vec[0] = *__ptr;
379379
return __vec;
380380
}

0 commit comments

Comments
 (0)