Skip to content

Commit cab6a6b

Browse files
committed
x86: correct / simplify @vec_extract_hi_<mode> and vec_extract_hi_v32qi
The middle alternative each was unusable without enabling AVX512DQ (in addition to AVX512VL), which is entirely unrelated here. The last alternative is usable with AVX512VL only (due to type restrictions on what may be put in the upper 16 YMM registers), and hence is pointlessly forcing 512-bit mode (without actually reflecting that in the "mode" attribute). gcc/ * config/i386/sse.md (@vec_extract_hi_<mode>): Drop last alternative. Switch new last alternative's "isa" attribute to "avx512vl". (vec_extract_hi_v32qi): Likewise.
1 parent 8bebf97 commit cab6a6b

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

gcc/config/i386/sse.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12029,23 +12029,22 @@
1202912029
"operands[1] = gen_lowpart (<ssehalfvecmode>mode, operands[1]);")
1203012030

1203112031
(define_insn "@vec_extract_hi_<mode>"
12032-
[(set (match_operand:<ssehalfvecmode> 0 "nonimmediate_operand" "=xm,vm,vm")
12032+
[(set (match_operand:<ssehalfvecmode> 0 "nonimmediate_operand" "=xm,vm")
1203312033
(vec_select:<ssehalfvecmode>
12034-
(match_operand:V16_256 1 "register_operand" "x,v,v")
12034+
(match_operand:V16_256 1 "register_operand" "x,v")
1203512035
(parallel [(const_int 8) (const_int 9)
1203612036
(const_int 10) (const_int 11)
1203712037
(const_int 12) (const_int 13)
1203812038
(const_int 14) (const_int 15)])))]
1203912039
"TARGET_AVX"
1204012040
"@
1204112041
vextract%~128\t{$0x1, %1, %0|%0, %1, 0x1}
12042-
vextracti32x4\t{$0x1, %1, %0|%0, %1, 0x1}
12043-
vextracti32x4\t{$0x1, %g1, %0|%0, %g1, 0x1}"
12042+
vextracti32x4\t{$0x1, %1, %0|%0, %1, 0x1}"
1204412043
[(set_attr "type" "sselog1")
1204512044
(set_attr "prefix_extra" "1")
1204612045
(set_attr "length_immediate" "1")
12047-
(set_attr "isa" "*,avx512dq,avx512f")
12048-
(set_attr "prefix" "vex,evex,evex")
12046+
(set_attr "isa" "*,avx512vl")
12047+
(set_attr "prefix" "vex,evex")
1204912048
(set_attr "mode" "OI")])
1205012049

1205112050
(define_insn_and_split "vec_extract_lo_v64qi"
@@ -12144,9 +12143,9 @@
1214412143
"operands[1] = gen_lowpart (V16QImode, operands[1]);")
1214512144

1214612145
(define_insn "vec_extract_hi_v32qi"
12147-
[(set (match_operand:V16QI 0 "nonimmediate_operand" "=xm,vm,vm")
12146+
[(set (match_operand:V16QI 0 "nonimmediate_operand" "=xm,vm")
1214812147
(vec_select:V16QI
12149-
(match_operand:V32QI 1 "register_operand" "x,v,v")
12148+
(match_operand:V32QI 1 "register_operand" "x,v")
1215012149
(parallel [(const_int 16) (const_int 17)
1215112150
(const_int 18) (const_int 19)
1215212151
(const_int 20) (const_int 21)
@@ -12158,13 +12157,12 @@
1215812157
"TARGET_AVX"
1215912158
"@
1216012159
vextract%~128\t{$0x1, %1, %0|%0, %1, 0x1}
12161-
vextracti32x4\t{$0x1, %1, %0|%0, %1, 0x1}
12162-
vextracti32x4\t{$0x1, %g1, %0|%0, %g1, 0x1}"
12160+
vextracti32x4\t{$0x1, %1, %0|%0, %1, 0x1}"
1216312161
[(set_attr "type" "sselog1")
1216412162
(set_attr "prefix_extra" "1")
1216512163
(set_attr "length_immediate" "1")
12166-
(set_attr "isa" "*,avx512dq,avx512f")
12167-
(set_attr "prefix" "vex,evex,evex")
12164+
(set_attr "isa" "*,avx512vl")
12165+
(set_attr "prefix" "vex,evex")
1216812166
(set_attr "mode" "OI")])
1216912167

1217012168
;; NB: *vec_extract<mode>_0 must be placed before *vec_extracthf.

0 commit comments

Comments
 (0)