Skip to content

Commit c2ef470

Browse files
AArch64: fix aarch64_usubw pattern
It looks like during my pre-commit testrun I forgot to apply this patch to the patch stack. It had a typo in the element size. It also looks like since the hi/lo operations take different element counts for the assembler syntax that I can't have a unified pattern. gcc/ChangeLog: * config/aarch64/aarch64-simd.md (aarch64_uaddw<mode>_<PERM_EXTEND:perm_hilo>_zip, aarch64_usubw<mode>_<PERM_EXTEND:perm_hilo>_zip): Split into... (aarch64_uaddw<mode>_lo_zip, aarch64_uaddw<mode>_hi_zip, "aarch64_usubw<mode>_lo_zip, "aarch64_usubw<mode>_hi_zip): ... This. * config/aarch64/iterators.md (PERM_EXTEND, perm_index): Remove. (perm_hilo): Remove UNSPEC_ZIP1, UNSPEC_ZIP2. gcc/testsuite/ChangeLog: * gcc.target/aarch64/uxtl-combine-4.c: Fix typo. * gcc.target/aarch64/uxtl-combine-5.c: Likewise. * gcc.target/aarch64/uxtl-combine-6.c: Likewise.
1 parent 8c24011 commit c2ef470

File tree

5 files changed

+38
-16
lines changed

5 files changed

+38
-16
lines changed

gcc/config/aarch64/aarch64-simd.md

+34-6
Original file line numberDiff line numberDiff line change
@@ -4810,31 +4810,59 @@
48104810
[(set_attr "type" "neon_sub_widen")]
48114811
)
48124812

4813-
(define_insn "aarch64_usubw<mode>_<PERM_EXTEND:perm_hilo>_zip"
4813+
(define_insn "aarch64_usubw<mode>_lo_zip"
48144814
[(set (match_operand:<VWIDE> 0 "register_operand" "=w")
48154815
(minus:<VWIDE>
48164816
(match_operand:<VWIDE> 1 "register_operand" "w")
48174817
(subreg:<VWIDE>
48184818
(unspec:<MODE> [
48194819
(match_operand:VQW 2 "register_operand" "w")
48204820
(match_operand:VQW 3 "aarch64_simd_imm_zero")
4821-
] PERM_EXTEND) 0)))]
4821+
] UNSPEC_ZIP1) 0)))]
48224822
"TARGET_SIMD"
4823-
"usubw<PERM_EXTEND:perm_index>\\t%0.<Vwtype>, %1.<Vwtype>, %2.<Vhalftype>"
4823+
"usubw\\t%0.<Vwtype>, %1.<Vwtype>, %2.<Vhalftype>"
48244824
[(set_attr "type" "neon_sub_widen")]
48254825
)
48264826

4827-
(define_insn "aarch64_uaddw<mode>_<PERM_EXTEND:perm_hilo>_zip"
4827+
(define_insn "aarch64_uaddw<mode>_lo_zip"
48284828
[(set (match_operand:<VWIDE> 0 "register_operand" "=w")
48294829
(plus:<VWIDE>
48304830
(subreg:<VWIDE>
48314831
(unspec:<MODE> [
48324832
(match_operand:VQW 2 "register_operand" "w")
48334833
(match_operand:VQW 3 "aarch64_simd_imm_zero")
4834-
] PERM_EXTEND) 0)
4834+
] UNSPEC_ZIP1) 0)
48354835
(match_operand:<VWIDE> 1 "register_operand" "w")))]
48364836
"TARGET_SIMD"
4837-
"uaddw<PERM_EXTEND:perm_index>\\t%0.<Vwtype>, %1.<Vwtype>, %2.<Vhalftype>"
4837+
"uaddw\\t%0.<Vwtype>, %1.<Vwtype>, %2.<Vhalftype>"
4838+
[(set_attr "type" "neon_add_widen")]
4839+
)
4840+
4841+
(define_insn "aarch64_usubw<mode>_hi_zip"
4842+
[(set (match_operand:<VWIDE> 0 "register_operand" "=w")
4843+
(minus:<VWIDE>
4844+
(match_operand:<VWIDE> 1 "register_operand" "w")
4845+
(subreg:<VWIDE>
4846+
(unspec:<MODE> [
4847+
(match_operand:VQW 2 "register_operand" "w")
4848+
(match_operand:VQW 3 "aarch64_simd_imm_zero")
4849+
] UNSPEC_ZIP2) 0)))]
4850+
"TARGET_SIMD"
4851+
"usubw2\\t%0.<Vwtype>, %1.<Vwtype>, %2.<Vtype>"
4852+
[(set_attr "type" "neon_sub_widen")]
4853+
)
4854+
4855+
(define_insn "aarch64_uaddw<mode>_hi_zip"
4856+
[(set (match_operand:<VWIDE> 0 "register_operand" "=w")
4857+
(plus:<VWIDE>
4858+
(subreg:<VWIDE>
4859+
(unspec:<MODE> [
4860+
(match_operand:VQW 2 "register_operand" "w")
4861+
(match_operand:VQW 3 "aarch64_simd_imm_zero")
4862+
] UNSPEC_ZIP2) 0)
4863+
(match_operand:<VWIDE> 1 "register_operand" "w")))]
4864+
"TARGET_SIMD"
4865+
"uaddw2\\t%0.<Vwtype>, %1.<Vwtype>, %2.<Vtype>"
48384866
[(set_attr "type" "neon_add_widen")]
48394867
)
48404868

gcc/config/aarch64/iterators.md

+1-7
Original file line numberDiff line numberDiff line change
@@ -2645,9 +2645,6 @@
26452645
(define_int_iterator OPTAB_PERMUTE [UNSPEC_ZIP1 UNSPEC_ZIP2
26462646
UNSPEC_UZP1 UNSPEC_UZP2])
26472647

2648-
;; Permutes for zero extends
2649-
(define_int_iterator PERM_EXTEND [UNSPEC_ZIP1 UNSPEC_ZIP2])
2650-
26512648
(define_int_iterator REVERSE [UNSPEC_REV64 UNSPEC_REV32 UNSPEC_REV16])
26522649

26532650
(define_int_iterator FRINT [UNSPEC_FRINTZ UNSPEC_FRINTP UNSPEC_FRINTM
@@ -3470,10 +3467,7 @@
34703467
(UNSPEC_REV16 "16")])
34713468

34723469
(define_int_attr perm_hilo [(UNSPEC_UNPACKSHI "hi") (UNSPEC_UNPACKUHI "hi")
3473-
(UNSPEC_UNPACKSLO "lo") (UNSPEC_UNPACKULO "lo")
3474-
(UNSPEC_ZIP2 "hi") (UNSPEC_ZIP1 "lo")])
3475-
3476-
(define_int_attr perm_index [(UNSPEC_ZIP2 "2") (UNSPEC_ZIP1 "")])
3470+
(UNSPEC_UNPACKSLO "lo") (UNSPEC_UNPACKULO "lo")])
34773471

34783472
;; Return true if the associated optab refers to the high-numbered lanes,
34793473
;; false if it refers to the low-numbered lanes. The convention is for

gcc/testsuite/gcc.target/aarch64/uxtl-combine-4.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ void d2 (SIGN TYPE2 * restrict a, SIGN TYPE1 *b, int n)
1616
/* { dg-final { scan-assembler-not {\tzip1\t} } } */
1717
/* { dg-final { scan-assembler-not {\tzip2\t} } } */
1818
/* { dg-final { scan-assembler-times {\tsxtl\t} 1 } } */
19-
/* { dg-final { scan-assembler-time {\tsxtl2\t} 1 } } */
19+
/* { dg-final { scan-assembler-times {\tsxtl2\t} 1 } } */
2020

gcc/testsuite/gcc.target/aarch64/uxtl-combine-5.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ void d2 (SIGN TYPE2 * restrict a, SIGN TYPE1 *b, int n)
1616
/* { dg-final { scan-assembler-not {\tzip1\t} } } */
1717
/* { dg-final { scan-assembler-not {\tzip2\t} } } */
1818
/* { dg-final { scan-assembler-times {\tsxtl\t} 1 } } */
19-
/* { dg-final { scan-assembler-time {\tsxtl2\t} 1 } } */
19+
/* { dg-final { scan-assembler-times {\tsxtl2\t} 1 } } */
2020

gcc/testsuite/gcc.target/aarch64/uxtl-combine-6.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ void d2 (SIGN TYPE2 * restrict a, SIGN TYPE1 *b, int n)
1616
/* { dg-final { scan-assembler-not {\tzip1\t} } } */
1717
/* { dg-final { scan-assembler-not {\tzip2\t} } } */
1818
/* { dg-final { scan-assembler-times {\tsxtl\t} 1 } } */
19-
/* { dg-final { scan-assembler-time {\tsxtl2\t} 1 } } */
19+
/* { dg-final { scan-assembler-times {\tsxtl2\t} 1 } } */
2020

0 commit comments

Comments
 (0)