Skip to content

Commit 06254d9

Browse files
committed
PR106342 - IBM zSystems: Provide vsel for all vector modes
dg.exp=pr104612.c fails with an ICE on s390x, because copysignv2sf3 produces an insn that vsel<mode> is supposed to recognize, but can't, because it's not defined for V2SF. Fix by defining it for all vector modes supported by copysign<mode>3. gcc/ChangeLog: * config/s390/vector.md (V_HW_FT): New iterator. * config/s390/vx-builtins.md (vsel<mode>): Use V_HW_FT instead of V_HW. (cherry picked from commit 2f17f48)
1 parent ebf3cd1 commit 06254d9

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

gcc/config/s390/vector.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@
6363
V1DF V2DF
6464
(V1TF "TARGET_VXE") (TF "TARGET_VXE")])
6565

66+
; All modes present in V_HW and VFT.
67+
(define_mode_iterator V_HW_FT [V16QI V8HI V4SI V2DI (V1TI "TARGET_VXE") V1DF
68+
V2DF (V1SF "TARGET_VXE") (V2SF "TARGET_VXE")
69+
(V4SF "TARGET_VXE") (V1TF "TARGET_VXE")
70+
(TF "TARGET_VXE")])
71+
6672
; FP vector modes directly supported by the HW. This does not include
6773
; vector modes using only part of a vector register and should be used
6874
; for instructions which might trigger IEEE exceptions.

gcc/config/s390/vx-builtins.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -517,12 +517,12 @@
517517
; swapped in s390-c.cc when we get here.
518518

519519
(define_insn "vsel<mode>"
520-
[(set (match_operand:V_HW 0 "register_operand" "=v")
521-
(ior:V_HW
522-
(and:V_HW (match_operand:V_HW 1 "register_operand" "v")
523-
(match_operand:V_HW 3 "register_operand" "v"))
524-
(and:V_HW (not:V_HW (match_dup 3))
525-
(match_operand:V_HW 2 "register_operand" "v"))))]
520+
[(set (match_operand:V_HW_FT 0 "register_operand" "=v")
521+
(ior:V_HW_FT
522+
(and:V_HW_FT (match_operand:V_HW_FT 1 "register_operand" "v")
523+
(match_operand:V_HW_FT 3 "register_operand" "v"))
524+
(and:V_HW_FT (not:V_HW_FT (match_dup 3))
525+
(match_operand:V_HW_FT 2 "register_operand" "v"))))]
526526
"TARGET_VX"
527527
"vsel\t%v0,%1,%2,%3"
528528
[(set_attr "op_type" "VRR")])

0 commit comments

Comments
 (0)