[AArch64] Add "FULL" to SVE mode iterator names

An upcoming patch will make more use of partial/unpacked SVE vectors.
We then need a distinction between mode iterators that include partial
modes and those that only include "full" modes.  This patch prepares
for that by adding "FULL" to the names of iterators that only select
full modes.  There should be no change in behaviour.

2019-11-16  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* config/aarch64/iterators.md (SVE_ALL): Rename to...
	(SVE_FULL): ...this.
	(SVE_I): Rename to...
	(SVE_FULL_I): ...this.
	(SVE_F): Rename to...
	(SVE_FULL_F): ...this.
	(SVE_BHSI): Rename to...
	(SVE_FULL_BHSI): ...this.
	(SVE_HSD): Rename to...
	(SVE_FULL_HSD): ...this.
	(SVE_HSDI): Rename to...
	(SVE_FULL_HSDI): ...this.
	(SVE_HSF): Rename to...
	(SVE_FULL_HSF): ...this.
	(SVE_SD): Rename to...
	(SVE_FULL_SD): ...this.
	(SVE_SDI): Rename to...
	(SVE_FULL_SDI): ...this.
	(SVE_SDF): Rename to...
	(SVE_FULL_SDF): ...this.
	(SVE_S): Rename to...
	(SVE_FULL_S): ...this.
	(SVE_D): Rename to...
	(SVE_FULL_D): ...this.
	* config/aarch64/aarch64-sve.md: Apply the above renaming throughout.
	* config/aarch64/aarch64-sve2.md: Likewise.

From-SVN: r278338
This commit is contained in:
Richard Sandiford 2019-11-16 10:50:42 +00:00 committed by Richard Sandiford
parent eb23241ba8
commit f75cdd2c4e
4 changed files with 1272 additions and 1195 deletions

View File

@ -1,3 +1,32 @@
2019-11-16 Richard Sandiford <richard.sandiford@arm.com>
* config/aarch64/iterators.md (SVE_ALL): Rename to...
(SVE_FULL): ...this.
(SVE_I): Rename to...
(SVE_FULL_I): ...this.
(SVE_F): Rename to...
(SVE_FULL_F): ...this.
(SVE_BHSI): Rename to...
(SVE_FULL_BHSI): ...this.
(SVE_HSD): Rename to...
(SVE_FULL_HSD): ...this.
(SVE_HSDI): Rename to...
(SVE_FULL_HSDI): ...this.
(SVE_HSF): Rename to...
(SVE_FULL_HSF): ...this.
(SVE_SD): Rename to...
(SVE_FULL_SD): ...this.
(SVE_SDI): Rename to...
(SVE_FULL_SDI): ...this.
(SVE_SDF): Rename to...
(SVE_FULL_SDF): ...this.
(SVE_S): Rename to...
(SVE_FULL_S): ...this.
(SVE_D): Rename to...
(SVE_FULL_D): ...this.
* config/aarch64/aarch64-sve.md: Apply the above renaming throughout.
* config/aarch64/aarch64-sve2.md: Likewise.
2019-11-16 Richard Sandiford <richard.sandiford@arm.com>
* config/aarch64/aarch64.opt (--param=aarch64-sve-compare-costs):

File diff suppressed because it is too large Load Diff

View File

@ -20,12 +20,13 @@
;; Integer average (floor).
(define_expand "<u>avg<mode>3_floor"
[(set (match_operand:SVE_I 0 "register_operand")
(unspec:SVE_I
[(set (match_operand:SVE_FULL_I 0 "register_operand")
(unspec:SVE_FULL_I
[(match_dup 3)
(unspec:SVE_I [(match_operand:SVE_I 1 "register_operand")
(match_operand:SVE_I 2 "register_operand")]
HADD)]
(unspec:SVE_FULL_I
[(match_operand:SVE_FULL_I 1 "register_operand")
(match_operand:SVE_FULL_I 2 "register_operand")]
HADD)]
UNSPEC_PRED_X))]
"TARGET_SVE2"
{
@ -35,12 +36,13 @@
;; Integer average (rounding).
(define_expand "<u>avg<mode>3_ceil"
[(set (match_operand:SVE_I 0 "register_operand")
(unspec:SVE_I
[(set (match_operand:SVE_FULL_I 0 "register_operand")
(unspec:SVE_FULL_I
[(match_dup 3)
(unspec:SVE_I [(match_operand:SVE_I 1 "register_operand")
(match_operand:SVE_I 2 "register_operand")]
RHADD)]
(unspec:SVE_FULL_I
[(match_operand:SVE_FULL_I 1 "register_operand")
(match_operand:SVE_FULL_I 2 "register_operand")]
RHADD)]
UNSPEC_PRED_X))]
"TARGET_SVE2"
{
@ -50,12 +52,13 @@
;; Predicated halving addsub.
(define_insn "*<sur>h<addsub><mode>"
[(set (match_operand:SVE_I 0 "register_operand" "=w, ?&w")
(unspec:SVE_I
[(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
(unspec:SVE_FULL_I
[(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
(unspec:SVE_I [(match_operand:SVE_I 2 "register_operand" "%0, w")
(match_operand:SVE_I 3 "register_operand" "w, w")]
HADDSUB)]
(unspec:SVE_FULL_I
[(match_operand:SVE_FULL_I 2 "register_operand" "%0, w")
(match_operand:SVE_FULL_I 3 "register_operand" "w, w")]
HADDSUB)]
UNSPEC_PRED_X))]
"TARGET_SVE2"
"@
@ -67,17 +70,18 @@
;; Multiply long top / bottom.
(define_insn "<su>mull<bt><Vwide>"
[(set (match_operand:<VWIDE> 0 "register_operand" "=w")
(unspec:<VWIDE> [(match_operand:SVE_BHSI 1 "register_operand" "w")
(match_operand:SVE_BHSI 2 "register_operand" "w")]
MULLBT))]
(unspec:<VWIDE>
[(match_operand:SVE_FULL_BHSI 1 "register_operand" "w")
(match_operand:SVE_FULL_BHSI 2 "register_operand" "w")]
MULLBT))]
"TARGET_SVE2"
"<su>mull<bt>\t%0.<Vewtype>, %1.<Vetype>, %2.<Vetype>"
)
;; (Rounding) Right shift narrow bottom.
(define_insn "<r>shrnb<mode>"
[(set (match_operand:SVE_BHSI 0 "register_operand" "=w")
(unspec:SVE_BHSI
[(set (match_operand:SVE_FULL_BHSI 0 "register_operand" "=w")
(unspec:SVE_FULL_BHSI
[(match_operand:<VWIDE> 1 "register_operand" "w")
(match_operand 2 "aarch64_simd_shift_imm_offset_<Vel>" "")]
SHRNB))]
@ -87,9 +91,9 @@
;; (Rounding) Right shift narrow top.
(define_insn "<r>shrnt<mode>"
[(set (match_operand:SVE_BHSI 0 "register_operand" "=w")
(unspec:SVE_BHSI
[(match_operand:SVE_BHSI 1 "register_operand" "0")
[(set (match_operand:SVE_FULL_BHSI 0 "register_operand" "=w")
(unspec:SVE_FULL_BHSI
[(match_operand:SVE_FULL_BHSI 1 "register_operand" "0")
(match_operand:<VWIDE> 2 "register_operand" "w")
(match_operand 3 "aarch64_simd_shift_imm_offset_<Vel>" "i")]
SHRNT))]
@ -99,12 +103,13 @@
;; Unpredicated integer multiply-high-with-(round-and-)scale.
(define_expand "<su>mulh<r>s<mode>3"
[(set (match_operand:SVE_BHSI 0 "register_operand")
(unspec:SVE_BHSI
[(set (match_operand:SVE_FULL_BHSI 0 "register_operand")
(unspec:SVE_FULL_BHSI
[(match_dup 3)
(unspec:SVE_BHSI [(match_operand:SVE_BHSI 1 "register_operand")
(match_operand:SVE_BHSI 2 "register_operand")]
MULHRS)]
(unspec:SVE_FULL_BHSI
[(match_operand:SVE_FULL_BHSI 1 "register_operand")
(match_operand:SVE_FULL_BHSI 2 "register_operand")]
MULHRS)]
UNSPEC_PRED_X))]
"TARGET_SVE2"
{
@ -125,15 +130,15 @@
;; Unpredicated signed / unsigned shift-right accumulate.
(define_insn_and_rewrite "*aarch64_sve2_sra<mode>"
[(set (match_operand:SVE_I 0 "register_operand" "=w")
(plus:SVE_I
(unspec:SVE_I
[(set (match_operand:SVE_FULL_I 0 "register_operand" "=w")
(plus:SVE_FULL_I
(unspec:SVE_FULL_I
[(match_operand 4)
(SHIFTRT:SVE_I
(match_operand:SVE_I 2 "register_operand" "w")
(match_operand:SVE_I 3 "aarch64_simd_rshift_imm" "Dr"))]
(SHIFTRT:SVE_FULL_I
(match_operand:SVE_FULL_I 2 "register_operand" "w")
(match_operand:SVE_FULL_I 3 "aarch64_simd_rshift_imm" "Dr"))]
UNSPEC_PRED_X)
(match_operand:SVE_I 1 "register_operand" "0")))]
(match_operand:SVE_FULL_I 1 "register_operand" "0")))]
"TARGET_SVE2"
"<sra_op>sra\t%0.<Vetype>, %2.<Vetype>, #%3"
"&& !CONSTANT_P (operands[4])"
@ -144,12 +149,12 @@
;; Unpredicated 3-way exclusive OR.
(define_insn "*aarch64_sve2_eor3<mode>"
[(set (match_operand:SVE_I 0 "register_operand" "=w, w, w, ?&w")
(xor:SVE_I
(xor:SVE_I
(match_operand:SVE_I 1 "register_operand" "0, w, w, w")
(match_operand:SVE_I 2 "register_operand" "w, 0, w, w"))
(match_operand:SVE_I 3 "register_operand" "w, w, 0, w")))]
[(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, w, w, ?&w")
(xor:SVE_FULL_I
(xor:SVE_FULL_I
(match_operand:SVE_FULL_I 1 "register_operand" "0, w, w, w")
(match_operand:SVE_FULL_I 2 "register_operand" "w, 0, w, w"))
(match_operand:SVE_FULL_I 3 "register_operand" "w, w, 0, w")))]
"TARGET_SVE2"
"@
eor3\t%0.d, %0.d, %2.d, %3.d
@ -161,14 +166,14 @@
;; Use NBSL for vector NOR.
(define_insn_and_rewrite "*aarch64_sve2_nor<mode>"
[(set (match_operand:SVE_I 0 "register_operand" "=w, ?&w")
(unspec:SVE_I
[(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
(unspec:SVE_FULL_I
[(match_operand 3)
(and:SVE_I
(not:SVE_I
(match_operand:SVE_I 1 "register_operand" "%0, w"))
(not:SVE_I
(match_operand:SVE_I 2 "register_operand" "w, w")))]
(and:SVE_FULL_I
(not:SVE_FULL_I
(match_operand:SVE_FULL_I 1 "register_operand" "%0, w"))
(not:SVE_FULL_I
(match_operand:SVE_FULL_I 2 "register_operand" "w, w")))]
UNSPEC_PRED_X))]
"TARGET_SVE2"
"@
@ -183,14 +188,14 @@
;; Use NBSL for vector NAND.
(define_insn_and_rewrite "*aarch64_sve2_nand<mode>"
[(set (match_operand:SVE_I 0 "register_operand" "=w, ?&w")
(unspec:SVE_I
[(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
(unspec:SVE_FULL_I
[(match_operand 3)
(ior:SVE_I
(not:SVE_I
(match_operand:SVE_I 1 "register_operand" "%0, w"))
(not:SVE_I
(match_operand:SVE_I 2 "register_operand" "w, w")))]
(ior:SVE_FULL_I
(not:SVE_FULL_I
(match_operand:SVE_FULL_I 1 "register_operand" "%0, w"))
(not:SVE_FULL_I
(match_operand:SVE_FULL_I 2 "register_operand" "w, w")))]
UNSPEC_PRED_X))]
"TARGET_SVE2"
"@
@ -206,13 +211,13 @@
;; Unpredicated bitwise select.
;; (op3 ? bsl_mov : bsl_dup) == (((bsl_mov ^ bsl_dup) & op3) ^ bsl_dup)
(define_insn "*aarch64_sve2_bsl<mode>"
[(set (match_operand:SVE_I 0 "register_operand" "=w, ?&w")
(xor:SVE_I
(and:SVE_I
(xor:SVE_I
(match_operand:SVE_I 1 "register_operand" "<bsl_1st>, w")
(match_operand:SVE_I 2 "register_operand" "<bsl_2nd>, w"))
(match_operand:SVE_I 3 "register_operand" "w, w"))
[(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
(xor:SVE_FULL_I
(and:SVE_FULL_I
(xor:SVE_FULL_I
(match_operand:SVE_FULL_I 1 "register_operand" "<bsl_1st>, w")
(match_operand:SVE_FULL_I 2 "register_operand" "<bsl_2nd>, w"))
(match_operand:SVE_FULL_I 3 "register_operand" "w, w"))
(match_dup BSL_DUP)))]
"TARGET_SVE2"
"@
@ -224,16 +229,16 @@
;; Unpredicated bitwise inverted select.
;; (~(op3 ? bsl_mov : bsl_dup)) == (~(((bsl_mov ^ bsl_dup) & op3) ^ bsl_dup))
(define_insn_and_rewrite "*aarch64_sve2_nbsl<mode>"
[(set (match_operand:SVE_I 0 "register_operand" "=w, ?&w")
(unspec:SVE_I
[(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
(unspec:SVE_FULL_I
[(match_operand 4)
(not:SVE_I
(xor:SVE_I
(and:SVE_I
(xor:SVE_I
(match_operand:SVE_I 1 "register_operand" "<bsl_1st>, w")
(match_operand:SVE_I 2 "register_operand" "<bsl_2nd>, w"))
(match_operand:SVE_I 3 "register_operand" "w, w"))
(not:SVE_FULL_I
(xor:SVE_FULL_I
(and:SVE_FULL_I
(xor:SVE_FULL_I
(match_operand:SVE_FULL_I 1 "register_operand" "<bsl_1st>, w")
(match_operand:SVE_FULL_I 2 "register_operand" "<bsl_2nd>, w"))
(match_operand:SVE_FULL_I 3 "register_operand" "w, w"))
(match_dup BSL_DUP)))]
UNSPEC_PRED_X))]
"TARGET_SVE2"
@ -250,17 +255,17 @@
;; Unpredicated bitwise select with inverted first operand.
;; (op3 ? ~bsl_mov : bsl_dup) == ((~(bsl_mov ^ bsl_dup) & op3) ^ bsl_dup)
(define_insn_and_rewrite "*aarch64_sve2_bsl1n<mode>"
[(set (match_operand:SVE_I 0 "register_operand" "=w, ?&w")
(xor:SVE_I
(and:SVE_I
(unspec:SVE_I
[(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
(xor:SVE_FULL_I
(and:SVE_FULL_I
(unspec:SVE_FULL_I
[(match_operand 4)
(not:SVE_I
(xor:SVE_I
(match_operand:SVE_I 1 "register_operand" "<bsl_1st>, w")
(match_operand:SVE_I 2 "register_operand" "<bsl_2nd>, w")))]
(not:SVE_FULL_I
(xor:SVE_FULL_I
(match_operand:SVE_FULL_I 1 "register_operand" "<bsl_1st>, w")
(match_operand:SVE_FULL_I 2 "register_operand" "<bsl_2nd>, w")))]
UNSPEC_PRED_X)
(match_operand:SVE_I 3 "register_operand" "w, w"))
(match_operand:SVE_FULL_I 3 "register_operand" "w, w"))
(match_dup BSL_DUP)))]
"TARGET_SVE2"
"@
@ -276,17 +281,17 @@
;; Unpredicated bitwise select with inverted second operand.
;; (bsl_dup ? bsl_mov : ~op3) == ((bsl_dup & bsl_mov) | (~op3 & ~bsl_dup))
(define_insn_and_rewrite "*aarch64_sve2_bsl2n<mode>"
[(set (match_operand:SVE_I 0 "register_operand" "=w, ?&w")
(ior:SVE_I
(and:SVE_I
(match_operand:SVE_I 1 "register_operand" "<bsl_1st>, w")
(match_operand:SVE_I 2 "register_operand" "<bsl_2nd>, w"))
(unspec:SVE_I
[(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
(ior:SVE_FULL_I
(and:SVE_FULL_I
(match_operand:SVE_FULL_I 1 "register_operand" "<bsl_1st>, w")
(match_operand:SVE_FULL_I 2 "register_operand" "<bsl_2nd>, w"))
(unspec:SVE_FULL_I
[(match_operand 4)
(and:SVE_I
(not:SVE_I
(match_operand:SVE_I 3 "register_operand" "w, w"))
(not:SVE_I
(and:SVE_FULL_I
(not:SVE_FULL_I
(match_operand:SVE_FULL_I 3 "register_operand" "w, w"))
(not:SVE_FULL_I
(match_dup BSL_DUP)))]
UNSPEC_PRED_X)))]
"TARGET_SVE2"
@ -303,18 +308,18 @@
;; Unpredicated bitwise select with inverted second operand, alternative form.
;; (bsl_dup ? bsl_mov : ~op3) == ((bsl_dup & bsl_mov) | (~bsl_dup & ~op3))
(define_insn_and_rewrite "*aarch64_sve2_bsl2n<mode>"
[(set (match_operand:SVE_I 0 "register_operand" "=w, ?&w")
(ior:SVE_I
(and:SVE_I
(match_operand:SVE_I 1 "register_operand" "<bsl_1st>, w")
(match_operand:SVE_I 2 "register_operand" "<bsl_2nd>, w"))
(unspec:SVE_I
[(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
(ior:SVE_FULL_I
(and:SVE_FULL_I
(match_operand:SVE_FULL_I 1 "register_operand" "<bsl_1st>, w")
(match_operand:SVE_FULL_I 2 "register_operand" "<bsl_2nd>, w"))
(unspec:SVE_FULL_I
[(match_operand 4)
(and:SVE_I
(not:SVE_I
(and:SVE_FULL_I
(not:SVE_FULL_I
(match_dup BSL_DUP))
(not:SVE_I
(match_operand:SVE_I 3 "register_operand" "w, w")))]
(not:SVE_FULL_I
(match_operand:SVE_FULL_I 3 "register_operand" "w, w")))]
UNSPEC_PRED_X)))]
"TARGET_SVE2"
"@

View File

@ -284,10 +284,6 @@
;; count.
(define_mode_iterator VMUL_CHANGE_NLANES [V4HI V8HI V2SI V4SI V2SF V4SF])
;; All SVE vector modes.
(define_mode_iterator SVE_ALL [VNx16QI VNx8HI VNx4SI VNx2DI
VNx8HF VNx4SF VNx2DF])
;; Iterators for single modes, for "@" patterns.
(define_mode_iterator VNx8HI_ONLY [VNx8HI])
(define_mode_iterator VNx4SI_ONLY [VNx4SI])
@ -302,38 +298,46 @@
VNx64QI VNx32HI VNx16SI VNx8DI
VNx32HF VNx16SF VNx8DF])
;; SVE integer vector modes that have 8-bit, 16-bit or 32-bit elements.
(define_mode_iterator SVE_BHSI [VNx16QI VNx8HI VNx4SI])
;; All fully-packed SVE vector modes.
(define_mode_iterator SVE_FULL [VNx16QI VNx8HI VNx4SI VNx2DI
VNx8HF VNx4SF VNx2DF])
;; SVE integer vector modes that have 16-bit, 32-bit or 64-bit elements.
(define_mode_iterator SVE_HSDI [VNx8HI VNx4SI VNx2DI])
;; All fully-packed SVE integer vector modes.
(define_mode_iterator SVE_FULL_I [VNx16QI VNx8HI VNx4SI VNx2DI])
;; SVE floating-point vector modes that have 16-bit or 32-bit elements.
(define_mode_iterator SVE_HSF [VNx8HF VNx4SF])
;; All fully-packed SVE floating-point vector modes.
(define_mode_iterator SVE_FULL_F [VNx8HF VNx4SF VNx2DF])
;; SVE integer vector modes that have 32-bit or 64-bit elements.
(define_mode_iterator SVE_SDI [VNx4SI VNx2DI])
;; Fully-packed SVE integer vector modes that have 8-bit, 16-bit or 32-bit
;; elements.
(define_mode_iterator SVE_FULL_BHSI [VNx16QI VNx8HI VNx4SI])
;; SVE floating-point vector modes that have 32-bit or 64-bit elements.
(define_mode_iterator SVE_SDF [VNx4SF VNx2DF])
;; Fully-packed SVE vector modes that have 16-bit, 32-bit or 64-bit elements.
(define_mode_iterator SVE_FULL_HSD [VNx8HI VNx4SI VNx2DI VNx8HF VNx4SF VNx2DF])
;; All SVE vector modes that have 16-bit, 32-bit or 64-bit elements.
(define_mode_iterator SVE_HSD [VNx8HI VNx4SI VNx2DI VNx8HF VNx4SF VNx2DF])
;; Fully-packed SVE integer vector modes that have 16-bit, 32-bit or 64-bit
;; elements.
(define_mode_iterator SVE_FULL_HSDI [VNx8HI VNx4SI VNx2DI])
;; All SVE vector modes that have 32-bit or 64-bit elements.
(define_mode_iterator SVE_SD [VNx4SI VNx2DI VNx4SF VNx2DF])
;; Fully-packed SVE floating-point vector modes that have 16-bit or 32-bit
;; elements.
(define_mode_iterator SVE_FULL_HSF [VNx8HF VNx4SF])
;; All SVE vector modes that have 32-bit elements.
(define_mode_iterator SVE_S [VNx4SI VNx4SF])
;; Fully-packed SVE vector modes that have 32-bit or 64-bit elements.
(define_mode_iterator SVE_FULL_SD [VNx4SI VNx2DI VNx4SF VNx2DF])
;; All SVE vector modes that have 64-bit elements.
(define_mode_iterator SVE_D [VNx2DI VNx2DF])
;; Fully-packed SVE integer vector modes that have 32-bit or 64-bit elements.
(define_mode_iterator SVE_FULL_SDI [VNx4SI VNx2DI])
;; All SVE integer vector modes.
(define_mode_iterator SVE_I [VNx16QI VNx8HI VNx4SI VNx2DI])
;; Fully-packed SVE floating-point vector modes that have 32-bit or 64-bit
;; elements.
(define_mode_iterator SVE_FULL_SDF [VNx4SF VNx2DF])
;; All SVE floating-point vector modes.
(define_mode_iterator SVE_F [VNx8HF VNx4SF VNx2DF])
;; Fully-packed SVE vector modes that have 32-bit elements.
(define_mode_iterator SVE_FULL_S [VNx4SI VNx4SF])
;; Fully-packed SVE vector modes that have 64-bit elements.
(define_mode_iterator SVE_FULL_D [VNx2DI VNx2DF])
;; All partial SVE modes.
(define_mode_iterator SVE_PARTIAL [VNx2QI