[Bug target/94413] auto-vectorization of isfinite raises FP exception

2024-03-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94413

Andrew Pinski  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #4 from Andrew Pinski  ---
Dup.

*** This bug has been marked as a duplicate of bug 91861 ***

[Bug target/94413] auto-vectorization of isfinite raises FP exception

2020-03-31 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94413

--- Comment #3 from Richard Biener  ---
in expand_vec_cond_expr_p there is

  if (VECTOR_BOOLEAN_TYPE_P (cmp_op_type)
  && get_vcond_mask_icode (TYPE_MODE (value_type),
   TYPE_MODE (cmp_op_type)) != CODE_FOR_nothing)
return true;

which doesn't bother to look at 'code' (though here we don't have
VECTOR_BOOLEAN_TYPE_P).  For the other cases we build test RTL and
check insn operand predicates.

[Bug target/94413] auto-vectorization of isfinite raises FP exception

2020-03-31 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94413

Jakub Jelinek  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2020-03-31

[Bug target/94413] auto-vectorization of isfinite raises FP exception

2020-03-31 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94413

Jakub Jelinek  changed:

   What|Removed |Added

 Ever confirmed|1   |0
 Status|NEW |UNCONFIRMED
   Last reconfirmed|2020-03-31 00:00:00 |
 CC||jakub at gcc dot gnu.org,
   ||uros at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
Somewhat modified testcase:
typedef float f4 __attribute__((vector_size (16)));

f4
isfinite(f4 x) {
  union U { float f[4]; f4 v; } u, v;
  u.v = x;
  v.v = (f4) {};
  int i;
  for (i = 0; i < 4; ++i) v.f[i] = __builtin_isfinite(u.f[i]) ? 1.f : 0.f;
  return v.v;
}
aborts already since r0-82110-g0c8d3c2b0852bf0eca1413c311fc3d2a9d3c1ade.
Though, in *.optimized dump it is
  _2 = ABS_EXPR <_1>;
  if (_2 u> 3.4028234663852885981170418348451692544e+38)
for scalar version which works fine and
  vect__2.8_33 = ABS_EXPR ;
  vect_iftmp.9_37 = VEC_COND_EXPR  {
3.4028234663852885981170418348451692544e+38,
3.4028234663852885981170418348451692544e+38,
3.4028234663852885981170418348451692544e+38,
3.4028234663852885981170418348451692544e+38 }, { 0.0, 0.0, 0.0, 0.0 }, {
1.0e+0, 1.0e+0, 1.0e+0, 1.0e+0 }>;
for vector which doesn't, so it looks like a backend problem.  For AVX we could
use vcmpnlt_uqps, but for < AVX there is no such insn.

[Bug target/94413] auto-vectorization of isfinite raises FP exception

2020-03-31 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94413

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2020-03-31
 Ever confirmed|0   |1

--- Comment #1 from Richard Biener  ---
I see

  vect_iftmp.13_34 = VEC_COND_EXPR  vect_cst__31,
vect_cst__32, vect_cst__33>;

so we use isgreater here and expand as

(insn 12 11 13 (set (reg:V4SF 93)
(ungt:V4SF (reg:V4SF 87 [ vect__10.22 ])
(reg:V4SF 90))) "t.C":18:14 -1 {sse_maskcmpv4sf3}
 (nil))

confirmed.