[dev.simd] simd: reorganize cvt rules

Comment and reorder rules for better bookkeeping.

This CL changes nothing in the generated code.

Change-Id: Iae04fda584a35fde5e3d54e4882d49614c9e4650
Reviewed-on: https://go-review.googlesource.com/c/go/+/697696
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
This commit is contained in:
Junyang Shao 2025-08-20 20:46:16 +00:00
parent 58cfc2a5f6
commit 6af8881adb
2 changed files with 34 additions and 35 deletions

View file

@ -1,24 +1,24 @@
!sum !sum
# Non-truncating conversions
# Could be widening int<->int or uint<->uint conversions or float<->int|uint conversions.
- go: ConvertToInt32 - go: ConvertToInt32
commutative: false commutative: false
documentation: !string |- documentation: !string |-
// NAME converts element values to int32. // NAME converts element values to int32.
- go: ConvertToUint32 - go: ConvertToUint32
commutative: false commutative: false
documentation: !string |- documentation: !string |-
// NAME converts element values to uint32. // NAME converts element values to uint32.
- go: ConvertToUint16 - go: ConvertToUint16
commutative: false commutative: false
documentation: !string |- documentation: !string |-
// NAME converts element values to uint16. // NAME converts element values to uint16.
# Truncating conversions, int<->int or uint<->uint.
- go: ConvertToUint16x8 - go: ConvertToUint16x8
commutative: false commutative: false
documentation: !string |- documentation: !string |-
// NAME converts 8 lowest vector element values to uint16. // NAME converts 8 lowest vector element values to uint16.
- go: ConvertToUint32x4 - go: ConvertToUint32x4
commutative: false commutative: false
documentation: !string |- documentation: !string |-

View file

@ -1,4 +1,6 @@
!sum !sum
# Float <-> Int conversions
# TODO: this right now only has Float32 -> Int32|Uint32, more to add.
- go: ConvertToInt32 - go: ConvertToInt32
asm: "VCVTTPS2DQ" asm: "VCVTTPS2DQ"
in: in:
@ -20,7 +22,9 @@
base: uint base: uint
elemBits: 32 elemBits: 32
- go: ConvertToUint16x8 # Uint -> Uint widening conversions.
# TODO: this right now only has uint8 -> uint16 and uint16->uint32.
- go: ConvertToUint16
asm: "VPMOVZXBW" asm: "VPMOVZXBW"
in: in:
- &u8x16 - &u8x16
@ -28,17 +32,7 @@
elemBits: 8 elemBits: 8
bits: 128 bits: 128
out: out:
- - &u16x16
base: uint
elemBits: 16
bits: 128
- go: ConvertToUint16
asm: "VPMOVZXBW"
in:
- *u8x16
out:
-
base: uint base: uint
elemBits: 16 elemBits: 16
bits: 256 bits: 256
@ -46,17 +40,17 @@
- go: ConvertToUint16 - go: ConvertToUint16
asm: "VPMOVZXBW" asm: "VPMOVZXBW"
in: in:
- - &u8x32
base: uint base: uint
elemBits: 8 elemBits: 8
bits: 256 bits: 256
out: out:
- - &u16x32
base: uint base: uint
elemBits: 16 elemBits: 16
bits: 512 bits: 512
- go: ConvertToUint32x4 - go: ConvertToUint32
asm: "VPMOVZXWD" asm: "VPMOVZXWD"
in: in:
- &u16x8 - &u16x8
@ -64,30 +58,35 @@
elemBits: 16 elemBits: 16
bits: 128 bits: 128
out: out:
- - &u32x8
base: uint base: uint
elemBits: 32 elemBits: 32
bits: 128 bits: 256
- go: ConvertToUint32 - go: ConvertToUint32
asm: "VPMOVZXWD"
in:
- *u16x16
out:
- &u32x16
base: uint
elemBits: 32
bits: 512
# Truncating conversions.
# TODO: this right now only has uint8->uint16 and uint16->uint32.
- go: ConvertToUint16x8
asm: "VPMOVZXBW"
in:
- *u8x16
out:
- *u16x8
- go: ConvertToUint32x4
asm: "VPMOVZXWD" asm: "VPMOVZXWD"
in: in:
- *u16x8 - *u16x8
out: out:
- - &u32x4
base: uint base: uint
elemBits: 32 elemBits: 32
bits: 256 bits: 128
- go: ConvertToUint32
asm: "VPMOVZXWD"
in:
-
base: uint
elemBits: 16
bits: 256
out:
-
base: uint
elemBits: 32
bits: 512