Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions src/cmd/compile/internal/arm64/simdssa_sve.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/cmd/compile/internal/ssa/_gen/ARM64Ops.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func init() {
gpspsbg = gpspg.union(buildReg("SB"))
fp = buildReg("F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 F13 F14 F15 F16 F17 F18 F19 F20 F21 F22 F23 F24 F25 F26 F27 F28 F29 F30 F31")
pred = buildReg("P0 P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 P11 P12 P13 P14 P15")
callerSave = gp.union(fp).union(buildReg("g")) // runtime.setg (and anything calling it) may clobber g
callerSave = gp.union(fp).union(pred).union(buildReg("g")) // runtime.setg (and anything calling it) may clobber g
r25 = buildReg("R25")
r24to25 = buildReg("R24 R25")
f16to17 = buildReg("F16 F17")
Expand Down
76 changes: 76 additions & 0 deletions src/cmd/compile/internal/ssa/_gen/simdARM64SVE.rules
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
(AndNotUint16s ...) => (ZBICD ...) // pureVreg
(AndNotUint32s ...) => (ZBICD ...) // pureVreg
(AndNotUint64s ...) => (ZBICD ...) // pureVreg
(MulFloat32s ...) => (ZFMULS ...) // pureVreg
(MulFloat64s ...) => (ZFMULD ...) // pureVreg
(OrInt8s ...) => (ZORRD ...) // pureVreg
(OrInt16s ...) => (ZORRD ...) // pureVreg
(OrInt32s ...) => (ZORRD ...) // pureVreg
Expand Down Expand Up @@ -108,6 +110,38 @@
(GreaterUint32s x y) => (ZCMPHIS x y (Select0 <types.TypeMask> (PWHILELTS (MOVDconst [0]) (MOVDconst [8]))))
(GreaterUint64s x y) => (ZCMPHID x y (Select0 <types.TypeMask> (PWHILELTD (MOVDconst [0]) (MOVDconst [4]))))
(GreaterUint8s x y) => (ZCMPHIB x y (Select0 <types.TypeMask> (PWHILELTB (MOVDconst [0]) (MOVDconst [32]))))
(MulHighInt16s x y) && v.Block.CPUfeatures.HasFeature(ssa.CPUsve2) => (ZSMULHH x y)
(MulHighInt16s x y) => (ZSMULHMergingH x y (Select0 <types.TypeMask> (PWHILELTH (MOVDconst [0]) (MOVDconst [16]))))
(MulHighInt32s x y) && v.Block.CPUfeatures.HasFeature(ssa.CPUsve2) => (ZSMULHS x y)
(MulHighInt32s x y) => (ZSMULHMergingS x y (Select0 <types.TypeMask> (PWHILELTS (MOVDconst [0]) (MOVDconst [8]))))
(MulHighInt64s x y) && v.Block.CPUfeatures.HasFeature(ssa.CPUsve2) => (ZSMULHD x y)
(MulHighInt64s x y) => (ZSMULHMergingD x y (Select0 <types.TypeMask> (PWHILELTD (MOVDconst [0]) (MOVDconst [4]))))
(MulHighInt8s x y) && v.Block.CPUfeatures.HasFeature(ssa.CPUsve2) => (ZSMULHB x y)
(MulHighInt8s x y) => (ZSMULHMergingB x y (Select0 <types.TypeMask> (PWHILELTB (MOVDconst [0]) (MOVDconst [32]))))
(MulHighUint16s x y) && v.Block.CPUfeatures.HasFeature(ssa.CPUsve2) => (ZUMULHH x y)
(MulHighUint16s x y) => (ZUMULHMergingH x y (Select0 <types.TypeMask> (PWHILELTH (MOVDconst [0]) (MOVDconst [16]))))
(MulHighUint32s x y) && v.Block.CPUfeatures.HasFeature(ssa.CPUsve2) => (ZUMULHS x y)
(MulHighUint32s x y) => (ZUMULHMergingS x y (Select0 <types.TypeMask> (PWHILELTS (MOVDconst [0]) (MOVDconst [8]))))
(MulHighUint64s x y) && v.Block.CPUfeatures.HasFeature(ssa.CPUsve2) => (ZUMULHD x y)
(MulHighUint64s x y) => (ZUMULHMergingD x y (Select0 <types.TypeMask> (PWHILELTD (MOVDconst [0]) (MOVDconst [4]))))
(MulHighUint8s x y) && v.Block.CPUfeatures.HasFeature(ssa.CPUsve2) => (ZUMULHB x y)
(MulHighUint8s x y) => (ZUMULHMergingB x y (Select0 <types.TypeMask> (PWHILELTB (MOVDconst [0]) (MOVDconst [32]))))
(MulInt16s x y) && v.Block.CPUfeatures.HasFeature(ssa.CPUsve2) => (ZMULH x y)
(MulInt16s x y) => (ZMULMergingH x y (Select0 <types.TypeMask> (PWHILELTH (MOVDconst [0]) (MOVDconst [16]))))
(MulInt32s x y) && v.Block.CPUfeatures.HasFeature(ssa.CPUsve2) => (ZMULS x y)
(MulInt32s x y) => (ZMULMergingS x y (Select0 <types.TypeMask> (PWHILELTS (MOVDconst [0]) (MOVDconst [8]))))
(MulInt64s x y) && v.Block.CPUfeatures.HasFeature(ssa.CPUsve2) => (ZMULD x y)
(MulInt64s x y) => (ZMULMergingD x y (Select0 <types.TypeMask> (PWHILELTD (MOVDconst [0]) (MOVDconst [4]))))
(MulInt8s x y) && v.Block.CPUfeatures.HasFeature(ssa.CPUsve2) => (ZMULB x y)
(MulInt8s x y) => (ZMULMergingB x y (Select0 <types.TypeMask> (PWHILELTB (MOVDconst [0]) (MOVDconst [32]))))
(MulUint16s x y) && v.Block.CPUfeatures.HasFeature(ssa.CPUsve2) => (ZMULH x y)
(MulUint16s x y) => (ZMULMergingH x y (Select0 <types.TypeMask> (PWHILELTH (MOVDconst [0]) (MOVDconst [16]))))
(MulUint32s x y) && v.Block.CPUfeatures.HasFeature(ssa.CPUsve2) => (ZMULS x y)
(MulUint32s x y) => (ZMULMergingS x y (Select0 <types.TypeMask> (PWHILELTS (MOVDconst [0]) (MOVDconst [8]))))
(MulUint64s x y) && v.Block.CPUfeatures.HasFeature(ssa.CPUsve2) => (ZMULD x y)
(MulUint64s x y) => (ZMULMergingD x y (Select0 <types.TypeMask> (PWHILELTD (MOVDconst [0]) (MOVDconst [4]))))
(MulUint8s x y) && v.Block.CPUfeatures.HasFeature(ssa.CPUsve2) => (ZMULB x y)
(MulUint8s x y) => (ZMULMergingB x y (Select0 <types.TypeMask> (PWHILELTB (MOVDconst [0]) (MOVDconst [32]))))
(NegFloat32s x) => (ZFNEGS x (Select0 <types.TypeMask> (PWHILELTS (MOVDconst [0]) (MOVDconst [8]))))
(NegFloat64s x) => (ZFNEGD x (Select0 <types.TypeMask> (PWHILELTD (MOVDconst [0]) (MOVDconst [4]))))
(NegInt16s x) => (ZNEGH x (Select0 <types.TypeMask> (PWHILELTH (MOVDconst [0]) (MOVDconst [16]))))
Expand Down Expand Up @@ -141,15 +175,24 @@
(ZSELB (ZEORD x y) x mask) => (ZEORMergingB x y mask)
(ZSELB (ZEORD x y) y mask) => (ZEORMergingB y x mask)
(ZSELB (ZEORD x y) z mask) => (ZEORMergingPrefixedB z x y mask)
(ZSELB (ZMULMergingB x y (Select0 <types.TypeMask> (PWHILELTB (MOVDconst [0]) (MOVDconst [32])))) x mask) => (ZMULMergingB x y mask)
(ZSELB (ZMULMergingB x y (Select0 <types.TypeMask> (PWHILELTB (MOVDconst [0]) (MOVDconst [32])))) y mask) => (ZMULMergingB y x mask)
(ZSELB (ZMULMergingB x y (Select0 <types.TypeMask> (PWHILELTB (MOVDconst [0]) (MOVDconst [32])))) z mask) => (ZMULMergingPrefixedB z x y mask)
(ZSELB (ZNEGB x (Select0 <types.TypeMask> (PWHILELTB (MOVDconst [0]) (MOVDconst [32])))) z mask) => (ZNEGMergingB z x mask)
(ZSELB (ZORRD x y) x mask) => (ZORRMergingB x y mask)
(ZSELB (ZORRD x y) y mask) => (ZORRMergingB y x mask)
(ZSELB (ZORRD x y) z mask) => (ZORRMergingPrefixedB z x y mask)
(ZSELB (ZSMULHMergingB x y (Select0 <types.TypeMask> (PWHILELTB (MOVDconst [0]) (MOVDconst [32])))) x mask) => (ZSMULHMergingB x y mask)
(ZSELB (ZSMULHMergingB x y (Select0 <types.TypeMask> (PWHILELTB (MOVDconst [0]) (MOVDconst [32])))) y mask) => (ZSMULHMergingB y x mask)
(ZSELB (ZSMULHMergingB x y (Select0 <types.TypeMask> (PWHILELTB (MOVDconst [0]) (MOVDconst [32])))) z mask) => (ZSMULHMergingPrefixedB z x y mask)
(ZSELB (ZSQADDB x y) x mask) => (ZSQADDMergingB x y mask)
(ZSELB (ZSQADDB x y) y mask) => (ZSQADDMergingB y x mask)
(ZSELB (ZSQADDB x y) z mask) => (ZSQADDMergingPrefixedB z x y mask)
(ZSELB (ZSQSUBB x y) x mask) => (ZSQSUBMergingB x y mask)
(ZSELB (ZSUBB x y) x mask) => (ZSUBMergingB x y mask)
(ZSELB (ZUMULHMergingB x y (Select0 <types.TypeMask> (PWHILELTB (MOVDconst [0]) (MOVDconst [32])))) x mask) => (ZUMULHMergingB x y mask)
(ZSELB (ZUMULHMergingB x y (Select0 <types.TypeMask> (PWHILELTB (MOVDconst [0]) (MOVDconst [32])))) y mask) => (ZUMULHMergingB y x mask)
(ZSELB (ZUMULHMergingB x y (Select0 <types.TypeMask> (PWHILELTB (MOVDconst [0]) (MOVDconst [32])))) z mask) => (ZUMULHMergingPrefixedB z x y mask)
(ZSELB (ZUQADDB x y) x mask) => (ZUQADDMergingB x y mask)
(ZSELB (ZUQADDB x y) y mask) => (ZUQADDMergingB y x mask)
(ZSELB (ZUQADDB x y) z mask) => (ZUQADDMergingPrefixedB z x y mask)
Expand All @@ -169,18 +212,30 @@
(ZSELD (ZFADDD x y) x mask) => (ZFADDMergingD x y mask)
(ZSELD (ZFADDD x y) y mask) => (ZFADDMergingD y x mask)
(ZSELD (ZFADDD x y) z mask) => (ZFADDMergingPrefixedD z x y mask)
(ZSELD (ZFMULD x y) x mask) => (ZFMULMergingD x y mask)
(ZSELD (ZFMULD x y) y mask) => (ZFMULMergingD y x mask)
(ZSELD (ZFMULD x y) z mask) => (ZFMULMergingPrefixedD z x y mask)
(ZSELD (ZFNEGD x (Select0 <types.TypeMask> (PWHILELTD (MOVDconst [0]) (MOVDconst [4])))) z mask) => (ZFNEGMergingD z x mask)
(ZSELD (ZFSQRTD x (Select0 <types.TypeMask> (PWHILELTD (MOVDconst [0]) (MOVDconst [4])))) z mask) => (ZFSQRTMergingD z x mask)
(ZSELD (ZFSUBD x y) x mask) => (ZFSUBMergingD x y mask)
(ZSELD (ZMULMergingD x y (Select0 <types.TypeMask> (PWHILELTD (MOVDconst [0]) (MOVDconst [4])))) x mask) => (ZMULMergingD x y mask)
(ZSELD (ZMULMergingD x y (Select0 <types.TypeMask> (PWHILELTD (MOVDconst [0]) (MOVDconst [4])))) y mask) => (ZMULMergingD y x mask)
(ZSELD (ZMULMergingD x y (Select0 <types.TypeMask> (PWHILELTD (MOVDconst [0]) (MOVDconst [4])))) z mask) => (ZMULMergingPrefixedD z x y mask)
(ZSELD (ZNEGD x (Select0 <types.TypeMask> (PWHILELTD (MOVDconst [0]) (MOVDconst [4])))) z mask) => (ZNEGMergingD z x mask)
(ZSELD (ZORRD x y) x mask) => (ZORRMergingD x y mask)
(ZSELD (ZORRD x y) y mask) => (ZORRMergingD y x mask)
(ZSELD (ZORRD x y) z mask) => (ZORRMergingPrefixedD z x y mask)
(ZSELD (ZSMULHMergingD x y (Select0 <types.TypeMask> (PWHILELTD (MOVDconst [0]) (MOVDconst [4])))) x mask) => (ZSMULHMergingD x y mask)
(ZSELD (ZSMULHMergingD x y (Select0 <types.TypeMask> (PWHILELTD (MOVDconst [0]) (MOVDconst [4])))) y mask) => (ZSMULHMergingD y x mask)
(ZSELD (ZSMULHMergingD x y (Select0 <types.TypeMask> (PWHILELTD (MOVDconst [0]) (MOVDconst [4])))) z mask) => (ZSMULHMergingPrefixedD z x y mask)
(ZSELD (ZSQADDD x y) x mask) => (ZSQADDMergingD x y mask)
(ZSELD (ZSQADDD x y) y mask) => (ZSQADDMergingD y x mask)
(ZSELD (ZSQADDD x y) z mask) => (ZSQADDMergingPrefixedD z x y mask)
(ZSELD (ZSQSUBD x y) x mask) => (ZSQSUBMergingD x y mask)
(ZSELD (ZSUBD x y) x mask) => (ZSUBMergingD x y mask)
(ZSELD (ZUMULHMergingD x y (Select0 <types.TypeMask> (PWHILELTD (MOVDconst [0]) (MOVDconst [4])))) x mask) => (ZUMULHMergingD x y mask)
(ZSELD (ZUMULHMergingD x y (Select0 <types.TypeMask> (PWHILELTD (MOVDconst [0]) (MOVDconst [4])))) y mask) => (ZUMULHMergingD y x mask)
(ZSELD (ZUMULHMergingD x y (Select0 <types.TypeMask> (PWHILELTD (MOVDconst [0]) (MOVDconst [4])))) z mask) => (ZUMULHMergingPrefixedD z x y mask)
(ZSELD (ZUQADDD x y) x mask) => (ZUQADDMergingD x y mask)
(ZSELD (ZUQADDD x y) y mask) => (ZUQADDMergingD y x mask)
(ZSELD (ZUQADDD x y) z mask) => (ZUQADDMergingPrefixedD z x y mask)
Expand All @@ -196,15 +251,24 @@
(ZSELH (ZEORD x y) x mask) => (ZEORMergingH x y mask)
(ZSELH (ZEORD x y) y mask) => (ZEORMergingH y x mask)
(ZSELH (ZEORD x y) z mask) => (ZEORMergingPrefixedH z x y mask)
(ZSELH (ZMULMergingH x y (Select0 <types.TypeMask> (PWHILELTH (MOVDconst [0]) (MOVDconst [16])))) x mask) => (ZMULMergingH x y mask)
(ZSELH (ZMULMergingH x y (Select0 <types.TypeMask> (PWHILELTH (MOVDconst [0]) (MOVDconst [16])))) y mask) => (ZMULMergingH y x mask)
(ZSELH (ZMULMergingH x y (Select0 <types.TypeMask> (PWHILELTH (MOVDconst [0]) (MOVDconst [16])))) z mask) => (ZMULMergingPrefixedH z x y mask)
(ZSELH (ZNEGH x (Select0 <types.TypeMask> (PWHILELTH (MOVDconst [0]) (MOVDconst [16])))) z mask) => (ZNEGMergingH z x mask)
(ZSELH (ZORRD x y) x mask) => (ZORRMergingH x y mask)
(ZSELH (ZORRD x y) y mask) => (ZORRMergingH y x mask)
(ZSELH (ZORRD x y) z mask) => (ZORRMergingPrefixedH z x y mask)
(ZSELH (ZSMULHMergingH x y (Select0 <types.TypeMask> (PWHILELTH (MOVDconst [0]) (MOVDconst [16])))) x mask) => (ZSMULHMergingH x y mask)
(ZSELH (ZSMULHMergingH x y (Select0 <types.TypeMask> (PWHILELTH (MOVDconst [0]) (MOVDconst [16])))) y mask) => (ZSMULHMergingH y x mask)
(ZSELH (ZSMULHMergingH x y (Select0 <types.TypeMask> (PWHILELTH (MOVDconst [0]) (MOVDconst [16])))) z mask) => (ZSMULHMergingPrefixedH z x y mask)
(ZSELH (ZSQADDH x y) x mask) => (ZSQADDMergingH x y mask)
(ZSELH (ZSQADDH x y) y mask) => (ZSQADDMergingH y x mask)
(ZSELH (ZSQADDH x y) z mask) => (ZSQADDMergingPrefixedH z x y mask)
(ZSELH (ZSQSUBH x y) x mask) => (ZSQSUBMergingH x y mask)
(ZSELH (ZSUBH x y) x mask) => (ZSUBMergingH x y mask)
(ZSELH (ZUMULHMergingH x y (Select0 <types.TypeMask> (PWHILELTH (MOVDconst [0]) (MOVDconst [16])))) x mask) => (ZUMULHMergingH x y mask)
(ZSELH (ZUMULHMergingH x y (Select0 <types.TypeMask> (PWHILELTH (MOVDconst [0]) (MOVDconst [16])))) y mask) => (ZUMULHMergingH y x mask)
(ZSELH (ZUMULHMergingH x y (Select0 <types.TypeMask> (PWHILELTH (MOVDconst [0]) (MOVDconst [16])))) z mask) => (ZUMULHMergingPrefixedH z x y mask)
(ZSELH (ZUQADDH x y) x mask) => (ZUQADDMergingH x y mask)
(ZSELH (ZUQADDH x y) y mask) => (ZUQADDMergingH y x mask)
(ZSELH (ZUQADDH x y) z mask) => (ZUQADDMergingPrefixedH z x y mask)
Expand All @@ -224,18 +288,30 @@
(ZSELS (ZFADDS x y) x mask) => (ZFADDMergingS x y mask)
(ZSELS (ZFADDS x y) y mask) => (ZFADDMergingS y x mask)
(ZSELS (ZFADDS x y) z mask) => (ZFADDMergingPrefixedS z x y mask)
(ZSELS (ZFMULS x y) x mask) => (ZFMULMergingS x y mask)
(ZSELS (ZFMULS x y) y mask) => (ZFMULMergingS y x mask)
(ZSELS (ZFMULS x y) z mask) => (ZFMULMergingPrefixedS z x y mask)
(ZSELS (ZFNEGS x (Select0 <types.TypeMask> (PWHILELTS (MOVDconst [0]) (MOVDconst [8])))) z mask) => (ZFNEGMergingS z x mask)
(ZSELS (ZFSQRTS x (Select0 <types.TypeMask> (PWHILELTS (MOVDconst [0]) (MOVDconst [8])))) z mask) => (ZFSQRTMergingS z x mask)
(ZSELS (ZFSUBS x y) x mask) => (ZFSUBMergingS x y mask)
(ZSELS (ZMULMergingS x y (Select0 <types.TypeMask> (PWHILELTS (MOVDconst [0]) (MOVDconst [8])))) x mask) => (ZMULMergingS x y mask)
(ZSELS (ZMULMergingS x y (Select0 <types.TypeMask> (PWHILELTS (MOVDconst [0]) (MOVDconst [8])))) y mask) => (ZMULMergingS y x mask)
(ZSELS (ZMULMergingS x y (Select0 <types.TypeMask> (PWHILELTS (MOVDconst [0]) (MOVDconst [8])))) z mask) => (ZMULMergingPrefixedS z x y mask)
(ZSELS (ZNEGS x (Select0 <types.TypeMask> (PWHILELTS (MOVDconst [0]) (MOVDconst [8])))) z mask) => (ZNEGMergingS z x mask)
(ZSELS (ZORRD x y) x mask) => (ZORRMergingS x y mask)
(ZSELS (ZORRD x y) y mask) => (ZORRMergingS y x mask)
(ZSELS (ZORRD x y) z mask) => (ZORRMergingPrefixedS z x y mask)
(ZSELS (ZSMULHMergingS x y (Select0 <types.TypeMask> (PWHILELTS (MOVDconst [0]) (MOVDconst [8])))) x mask) => (ZSMULHMergingS x y mask)
(ZSELS (ZSMULHMergingS x y (Select0 <types.TypeMask> (PWHILELTS (MOVDconst [0]) (MOVDconst [8])))) y mask) => (ZSMULHMergingS y x mask)
(ZSELS (ZSMULHMergingS x y (Select0 <types.TypeMask> (PWHILELTS (MOVDconst [0]) (MOVDconst [8])))) z mask) => (ZSMULHMergingPrefixedS z x y mask)
(ZSELS (ZSQADDS x y) x mask) => (ZSQADDMergingS x y mask)
(ZSELS (ZSQADDS x y) y mask) => (ZSQADDMergingS y x mask)
(ZSELS (ZSQADDS x y) z mask) => (ZSQADDMergingPrefixedS z x y mask)
(ZSELS (ZSQSUBS x y) x mask) => (ZSQSUBMergingS x y mask)
(ZSELS (ZSUBS x y) x mask) => (ZSUBMergingS x y mask)
(ZSELS (ZUMULHMergingS x y (Select0 <types.TypeMask> (PWHILELTS (MOVDconst [0]) (MOVDconst [8])))) x mask) => (ZUMULHMergingS x y mask)
(ZSELS (ZUMULHMergingS x y (Select0 <types.TypeMask> (PWHILELTS (MOVDconst [0]) (MOVDconst [8])))) y mask) => (ZUMULHMergingS y x mask)
(ZSELS (ZUMULHMergingS x y (Select0 <types.TypeMask> (PWHILELTS (MOVDconst [0]) (MOVDconst [8])))) z mask) => (ZUMULHMergingPrefixedS z x y mask)
(ZSELS (ZUQADDS x y) x mask) => (ZUQADDMergingS x y mask)
(ZSELS (ZUQADDS x y) y mask) => (ZUQADDMergingS y x mask)
(ZSELS (ZUQADDS x y) z mask) => (ZUQADDMergingPrefixedS z x y mask)
Expand Down
Loading
Loading