]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.simd] simd: reorganize cvt rules
authorJunyang Shao <shaojunyang@google.com>
Wed, 20 Aug 2025 20:46:16 +0000 (20:46 +0000)
committerJunyang Shao <shaojunyang@google.com>
Thu, 21 Aug 2025 17:01:51 +0000 (10:01 -0700)
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>
src/simd/_gen/simdgen/ops/Converts/categories.yaml
src/simd/_gen/simdgen/ops/Converts/go.yaml

index b4c7d468e99c2ec13e43a019798d1391bb9ab75d..c2141b56845fd1c6c27bb2a3e6ee47a8597a9872 100644 (file)
@@ -1,24 +1,24 @@
 !sum
+# Non-truncating conversions
+# Could be widening int<->int or uint<->uint conversions or float<->int|uint conversions.
 - go: ConvertToInt32
   commutative: false
   documentation: !string |-
     // NAME converts element values to int32.
-
 - go: ConvertToUint32
   commutative: false
   documentation: !string |-
     // NAME converts element values to uint32.
-
 - go: ConvertToUint16
   commutative: false
   documentation: !string |-
     // NAME converts element values to uint16.
 
+# Truncating conversions, int<->int or uint<->uint.
 - go: ConvertToUint16x8
   commutative: false
   documentation: !string |-
     // NAME converts 8 lowest vector element values to uint16.
-
 - go: ConvertToUint32x4
   commutative: false
   documentation: !string |-
index be0f157b40c9151743af86dfb488a50834852122..56dea4ae05096a5fcc05981c561051b2e6255108 100644 (file)
@@ -1,4 +1,6 @@
 !sum
+# Float <-> Int conversions
+# TODO: this right now only has Float32 -> Int32|Uint32, more to add.
 - go: ConvertToInt32
   asm: "VCVTTPS2DQ"
   in:
@@ -20,7 +22,9 @@
     base: uint
     elemBits: 32
 
-- go: ConvertToUint16x8
+# Uint -> Uint widening conversions.
+# TODO: this right now only has uint8 -> uint16 and uint16->uint32.
+- go: ConvertToUint16
   asm: "VPMOVZXBW"
   in:
   - &u8x16
     elemBits: 8
     bits: 128
   out:
-  -
-    base: uint
-    elemBits: 16
-    bits: 128
-
-- go: ConvertToUint16
-  asm: "VPMOVZXBW"
-  in:
-  - *u8x16
-  out:
-  -
+  - &u16x16
     base: uint
     elemBits: 16
     bits: 256
 - go: ConvertToUint16
   asm: "VPMOVZXBW"
   in:
-  -
+  - &u8x32
     base: uint
     elemBits: 8
     bits: 256
   out:
-  -
+  - &u16x32
     base: uint
     elemBits: 16
     bits: 512
 
-- go: ConvertToUint32x4
+- go: ConvertToUint32
   asm: "VPMOVZXWD"
   in:
   - &u16x8
     elemBits: 16
     bits: 128
   out:
-  -
+  - &u32x8
     base: uint
     elemBits: 32
-    bits: 128
+    bits: 256
 
 - go: ConvertToUint32
   asm: "VPMOVZXWD"
   in:
-  - *u16x8
+  - *u16x16
   out:
-  -
+  - &u32x16
     base: uint
     elemBits: 32
-    bits: 256
+    bits: 512
 
-- go: ConvertToUint32
+# 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"
   in:
-  -
-    base: uint
-    elemBits: 16
-    bits: 256
+  - *u16x8
   out:
-  -
+  - &u32x4
     base: uint
     elemBits: 32
-    bits: 512
+    bits: 128
\ No newline at end of file