Commit graph

61 commits

Author SHA1 Message Date
David Chase
74ebdd28d1 [dev.simd] simd, cmd/compile: add more element types for Select128FromPair
Also includes a comment cleanup pass.
Fixed NAME processing for additional documentation.

Change-Id: Ide5b60c17ddbf3c6eafd20147981c59493fc8133
Reviewed-on: https://go-review.googlesource.com/c/go/+/722180
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-11-20 17:48:29 -08:00
David Chase
4d26d66a49 [dev.simd] simd: fix signatures for PermuteConstant* methods
This moves the packed-immediate methods to package-private,
and adds exported versions with four parameters.

Rename PermuteConstant to PermuteScalars
Rename VPSHUFB Permute to PermuteOrZero
Rename Permute2 to ConcatPermute

Comments were repaired/enhanced.

Modified the generator to support an additional tag
"hideMaskMethods : true" to suppress method, intrinsic,
generic, and generic translation generation for said
mask-modified versions of such methods (this is already
true for exported methods).

Change-Id: I91e208c1fff1f28ebce4edb4e73d26003715018c
Reviewed-on: https://go-review.googlesource.com/c/go/+/721342
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2025-11-20 17:47:32 -08:00
Junyang Shao
896f293a25 [dev.simd] cmd/compile, simd: change DotProductQuadruple and add peepholes
This CL addressed some API change decisions in the API audit.
Instead of exposing the Intel format, we hide the add part of the
instructions under the peephole, and rename the API as
DotProdQuadruple

Change-Id: I471c0a755174bc15dd83bdc0f757d6356b92d835
Reviewed-on: https://go-review.googlesource.com/c/go/+/721420
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-11-18 09:02:23 -08:00
Junyang Shao
be9c50c6a0 [dev.simd] cmd/compile, simd: change SHA ops names and types
This CL addressed some naming changes decided in API audit.
Before		After
SHA1Msg1	SHA1Message1, Remove signed
SHA1Msg2	SHA1Message2, Remove signed
SHA1NextE	SHA1NextE, Remove signed
SHA1Round4	SHA1FourRounds, Remove signed
SHA256Msg1	SHA256Message1, Remove signed
SHA256Msg2	SHA256Message2, Remove signed
SHA256Rounds2	SHA256TwoRounds, Remove signed

Change-Id: If2cead113f37a9044bc5c65e78fa9d124e318005
Reviewed-on: https://go-review.googlesource.com/c/go/+/721003
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-11-18 09:02:15 -08:00
Junyang Shao
0978935a99 [dev.simd] cmd/compile, simd: change AES op names and add missing size
This CL changed AESEncryptRound and AESDecryptRound to
AESEncryptOneRound and AESDecryptOneRound.

This CL also adds the 512-bit version of some AES instructions.

Change-Id: Ia851a008cce2145b1ff193a89e172862060a725d
Reviewed-on: https://go-review.googlesource.com/c/go/+/721280
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-11-17 13:37:42 -08:00
Junyang Shao
95871e4a00 [dev.simd] cmd/compile, simd: add VPALIGNR
This CL named VPALIGNR ConcatShiftBytes[Grouped].

Change-Id: I46c6703085efb0613deefa512de9911b4fdf6bc4
Reviewed-on: https://go-review.googlesource.com/c/go/+/714440
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-11-17 13:37:36 -08:00
Junyang Shao
972732b245 [dev.simd] simd, cmd/compile: remove move from API
These should really be machine ops only.

Change-Id: Idcc611719eff068153d88c5162dd2e0883e5e0ca
Reviewed-on: https://go-review.googlesource.com/c/go/+/717821
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-11-10 09:53:20 -08:00
Junyang Shao
bf77323efa [dev.simd] simd: put unexported methods to another file
This CL is just a cleanup.

Change-Id: I429f2d211828e17faca03a02f40e9f544b94844d
Reviewed-on: https://go-review.googlesource.com/c/go/+/717820
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-11-10 09:53:16 -08:00
Junyang Shao
cf7c1a4cbb [dev.simd] cmd/compile, simd: add SHA features
This CL also fixed some bugs left in CL 712181.

Change-Id: I9cb6cd9fbaef307f352809bf21b8fec3eb62721a
Reviewed-on: https://go-review.googlesource.com/c/go/+/712361
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-10-24 10:53:28 -07:00
David Chase
d03634f807 [dev.simd] cmd/compile, simd: add definitions for VPTERNLOG[DQ]
This includes an non-public intrinsic for testing,
and a test.  Optimizations using this instruction
will follow in another CL.

Change-Id: I7f7a93212249a16a30bd1379c717f8a7f9915daf
Reviewed-on: https://go-review.googlesource.com/c/go/+/708995
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
2025-10-22 11:38:57 -07:00
Junyang Shao
416332dba2 [dev.simd] cmd/compile, simd: update DotProd to DotProduct
API naming changes.

This CL also remove AddDotProductPairsSaturated.

Change-Id: I02e6d45268704f3ed4eaf62f0ecb7dc936b42124
Reviewed-on: https://go-review.googlesource.com/c/go/+/710935
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-10-14 12:26:44 -07:00
Junyang Shao
703a5fbaad [dev.simd] cmd/compile, simd: add AES instructions
AVXAES is a composite feature set, Intel did listed it as "AVXAES" in
the XED data instead of separating them.

The tests will be in the next CL.

Change-Id: I89c97261f2228b2fdafb48f63e82ef6239bdd5ca
Reviewed-on: https://go-review.googlesource.com/c/go/+/706055
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-09-30 10:37:49 -07:00
David Chase
fe4af1c067 [dev.simd] simd: repair broken comments in generated ops_amd64.go
these are for concatSelectedConstant and concatSelectedConstantGrouped

Change-Id: I15211596615b42908cdf11182a05b004b6a17950
Reviewed-on: https://go-review.googlesource.com/c/go/+/706975
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
2025-09-26 14:35:20 -07:00
David Chase
25c36b95d1 [dev.simd] simd, cmd/compile: add 128 bit select-from-pair
Using this name until a better one appears:
   x.Select128FromPair(3, 2, y)

Includes test for constant and variable case.
Checks for unexpected immediates (using the zeroing flag,
which is not supported for this intrinsic) and panics.

Change-Id: I9249475d6572968c127b4ee9e00328d717c07578
Reviewed-on: https://go-review.googlesource.com/c/go/+/705496
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-09-26 13:11:10 -07:00
David Chase
bf00f5dfd6 [dev.simd] simd, cmd/compile: added simd methods for VSHUFP[DS]
These are package private, and will be hidden behind
other methods in a following CL with a more general
interface.

Change-Id: Id090a5de06a0e2aed5cc60a11ff627c5e3b9c52d
Reviewed-on: https://go-review.googlesource.com/c/go/+/698577
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-09-23 13:25:22 -07:00
Junyang Shao
c39b2fdd1e [dev.simd] cmd/compile, simd: add VPLZCNT[DQ]
Change-Id: Ifd6d8c12deac9c41722fdf2511d860a334e83438
Reviewed-on: https://go-review.googlesource.com/c/go/+/701915
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Bypass: Junyang Shao <shaojunyang@google.com>
2025-09-08 13:53:52 -07:00
David Chase
b509516b2e [dev.simd] simd, cmd/compile: add Interleave{Hi,Lo} (VPUNPCK*)
these are building blocks for transpose, not sure of their
best names yet.

Change-Id: I3800a55de9fa7fde2590ca822894c8a75387dec3
Reviewed-on: https://go-review.googlesource.com/c/go/+/698576
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-09-02 10:50:46 -07:00
Junyang Shao
5ebe2d05d5 [dev.simd] simd: correct SumAbsDiff documentation
Change-Id: I6bb093615f12bbac5ea4c013a1c47cd5d338fe43
Reviewed-on: https://go-review.googlesource.com/c/go/+/698516
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-08-24 16:21:00 -07:00
Junyang Shao
baea0c700b [dev.simd] cmd/compile, simd: complete AVX2? u?int shuffles
The namings follow the following convention:
- If its indices are from constant, amend "Constant" to the name.
- If its indices are used by multiple groups, mend "Grouped" to the
  name.
- If its indexing only the low part, amend "Lo", similarly "Hi".

Change-Id: I6a58f5dae54c882ebd59f39b5288f6f3f14d957f
Reviewed-on: https://go-review.googlesource.com/c/go/+/698296
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-08-22 09:10:28 -07:00
Junyang Shao
fa1e78c9ad [dev.simd] cmd/compile, simd: make Permute 128-bit use AVX VPSHUFB
Change-Id: Ib89f602f797065e411eb0cbc95ccf2748b25fdec
Reviewed-on: https://go-review.googlesource.com/c/go/+/698295
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-08-22 09:10:23 -07:00
Junyang Shao
bc217d4170 [dev.simd] cmd/compile, simd: add packed saturated u?int conversions
This CL should complete the conversions between int and uint.

Change-Id: I46742a62214f346e014a68b9c72a9b116a127f67
Reviewed-on: https://go-review.googlesource.com/c/go/+/698236
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: David Chase <drchase@google.com>
Reviewed-by: David Chase <drchase@google.com>
2025-08-22 09:10:18 -07:00
Junyang Shao
4fa23b0d29 [dev.simd] cmd/compile, simd: add saturated u?int conversions
Change-Id: I0c7f2d7ec31c59c95568ff8d4560989de849427e
Reviewed-on: https://go-review.googlesource.com/c/go/+/698235
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-08-22 09:10:14 -07:00
Junyang Shao
7fdb1da6b0 [dev.simd] cmd/compile, simd: complete truncating u?int conversions.
Downsizing conversions' truncating version complete. Saturation ver not
done.

Change-Id: I710976c2b5329e2882763d60fcef2a827213df09
Reviewed-on: https://go-review.googlesource.com/c/go/+/697975
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-08-21 10:01:58 -07:00
Junyang Shao
f4c41d9922 [dev.simd] cmd/compile, simd: complete u?int widening conversions
Change-Id: I21da09261b6b278768d99229fe2db387aef1e812
Reviewed-on: https://go-review.googlesource.com/c/go/+/697915
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-08-21 10:01:55 -07:00
Junyang Shao
58cfc2a5f6 [dev.simd] cmd/compile, simd: add VPSADBW
This new API is given the name SumAbsDiff, a slightly-longer name for
its canonical abbreviation SAD(Sum-Absolute-Differences).

This instruction has some similar semantic's one, but their semantic is much more
specific and complex: MPSADBW, VDBPSADBW. They should have a more
specific name given this fact.

Change-Id: Ied9144440f82919c3c2d45ae4ce5b961ae91a020
Reviewed-on: https://go-review.googlesource.com/c/go/+/697776
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-08-21 10:01:46 -07:00
David Chase
ede64cf0d8 [dev.simd] simd, cmd/compile: sample peephole optimization for .Masked()
This is not the end of such peephole optimizations, there
would need to be many of these for many simd operations.

Change-Id: I4511f6fac502bc7259c1c4414c96f56eb400c202
Reviewed-on: https://go-review.googlesource.com/c/go/+/697157
TryBot-Bypass: David Chase <drchase@google.com>
Commit-Queue: David Chase <drchase@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
2025-08-20 15:10:00 -07:00
David Chase
4fce49b86c [dev.simd] simd, cmd/compile: add widening unsigned converts 8->16->32
Change-Id: If0bde7154bd622573375eba5539fd642b8ef9d2f
Reviewed-on: https://go-review.googlesource.com/c/go/+/696555
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
2025-08-20 10:26:43 -07:00
Junyang Shao
0f660d675f [dev.simd] simd: make OpMasked machine ops only
Right now we can expect the `Op(...).Masked` idiom to lack many parts that will
make the API incomplete. But to make the API sizes smaller, we are removing these ops' frontend types and interfaces for now. We will have the peepholes and a new pass
checking the CPU features check domination relations to make these ops
picked for the right `Op(...).Masked` idiom.

Change-Id: I77f72a198b3d8b1880dcb911470db5e0089ac1ca
Reviewed-on: https://go-review.googlesource.com/c/go/+/697155
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Bypass: Junyang Shao <shaojunyang@google.com>
2025-08-19 13:46:58 -07:00
Junyang Shao
a034826e26 [dev.simd] simd, cmd/compile: implement ToMask, unexport asMask.
This CL defines the mask semantic better:
When converting from vector to mask, its element is set to true iff
the corresponding vector element is non zero.

Change-Id: I331c1c7992dc9e81c211bdc6d73e5eb3b8414506
Reviewed-on: https://go-review.googlesource.com/c/go/+/697056
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-08-19 10:20:22 -07:00
David Chase
9a934d5080 [dev.simd] cmd/compile, simd: added methods for "float" GetElem
This also required a "always use operation with least
OverrideBase" filter in choosing the machine instructions.

The order of generated HW operations is slightly
modified because the Float version of GetElem
appears earlier in the sorted operations list,
though it is not chosen to generate the HW Op.

Change-Id: I95fa67afca9c8b6f4f18941fdcaf69afdad8055b
Reviewed-on: https://go-review.googlesource.com/c/go/+/696375
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2025-08-18 13:12:27 -07:00
David Chase
2080415aa2 [dev.simd] simd: add emulations for missing AVX2 comparisons
this also removes AVX512 versions of the operations
that would use the same names, but not run on AVX2-only

includes files generated by simdgen CL 692355

Change-Id: Iff29042245b7688133fed49a03e681e85235b8a8
Reviewed-on: https://go-review.googlesource.com/c/go/+/692335
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
2025-08-13 11:49:05 -07:00
David Chase
ddb689c7bb [dev.simd] simd, cmd/compile: generated code for Broadcast
Generated by simdgen CL 693599

This turned out to require some additional work in
other places, including filling in missing
methods (use OverwriteBase to get FP versions).

Also includes a test.

Change-Id: I2efe8967837834745f9cae661d4d4dcbb5390b6f
Reviewed-on: https://go-review.googlesource.com/c/go/+/693758
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
2025-08-13 11:48:29 -07:00
Austin Clements
667add4f1c [dev.simd] cmd/compile, simd: update generated files
This CL is generated by x/arch CL 694859.

Change-Id: I18bd076e26e93bc2fb0e761de26511138e95055f
Reviewed-on: https://go-review.googlesource.com/c/go/+/694916
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Austin Clements <austin@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
2025-08-11 13:45:27 -07:00
Austin Clements
1755c2909d [dev.simd] cmd/compile, simd: update generated files
This CL is generated by x/arch CL 694857.

Change-Id: I9745fa8c9b2e3f49bd2cff5ff6b5578c0c67bfa1
Reviewed-on: https://go-review.googlesource.com/c/go/+/694915
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Austin Clements <austin@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-08-11 13:45:22 -07:00
Junyang Shao
2fd49d8f30 [dev.simd] simd: imm doc improve
This CL is generated by CL 694775.

Change-Id: I3d551b1a7981c6c35c1ecf139a38b6e07323a861
Reviewed-on: https://go-review.googlesource.com/c/go/+/694795
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-08-11 11:18:13 -07:00
Junyang Shao
38b76bf2a3 [dev.simd] cmd/compile, simd: jump table for imm ops
This CL fixes some errors in prog generation for imm operations, please
see the changes in ssa.go for details.

This CL also implements the jump table for non-const immediate arg. The
current implementation exhaust 0-255, the bound-checked version will be
in the next CL.

This CL is partially generated by CL 694375.

Change-Id: I75fe9900430b4fca5b39b0c0958a13b20b1104b7
Reviewed-on: https://go-review.googlesource.com/c/go/+/694395
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-08-11 10:49:50 -07:00
Junyang Shao
8eb5f6020e [dev.simd] cmd/compile, simd: API interface fixes
- Absolute -> Abs
    - ApproximateReciprocal -> Reciprocal
      - Other derived apis also changed.
    - Round -> RoundToEven
      - Other derived apis also changed.
    - Drop DotProdBroadcast
    - Fused(Mul|Add)(Mul|Add)? -> remove the "Fused"
    - MulEvenWiden -> remove 64bit
    - MulLow -> Mul, add unit
    - PairDotProd -> DotProdPairs
      - make AddDotProdPairs machine ops only - peepholes will be in another
        CL at dev.simd.
    - PopCount -> OnesCount
    - Saturated* -> *Saturated
    - Fix (Add|Sub)Saturated uint mappings.
    - UnsignedSignedQuadDotProdAccumulate -> AddDotProdQuadruple
      - The "DotProdQuadruple" instruction does not exist, so no peepholes for
        this.
This CL is generated by CL 694095.

Change-Id: If4110cc04ab96240cf56f2348d35ed2a719687de
Reviewed-on: https://go-review.googlesource.com/c/go/+/694115
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-08-07 10:37:58 -07:00
Junyang Shao
5b0ef7fcdc [dev.simd] cmd/compile, simd: add Expand
This CL is generated by CL 693336.

Change-Id: Ic1712d49fcad0544fa3c19b0249d8bc65b347104
Reviewed-on: https://go-review.googlesource.com/c/go/+/693375
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-08-06 13:50:57 -07:00
Junyang Shao
d3cf582f8a [dev.simd] cmd/compile, simd: (Set|Get)(Lo|Hi)
This CL is generated by CL 693335.

Change-Id: Ie9adda526573f979ec7e4f535033ba29236cc5cb
Reviewed-on: https://go-review.googlesource.com/c/go/+/693355
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-08-06 13:50:50 -07:00
David Chase
7ca34599ec [dev.simd] simd, cmd/compile: generated files to add 'blend' and 'blendMasked'
Generated by arch/internal/simdgen CL 693175

These methods are not public because of simdgen-induced name/signature
issues, and because their addition was motivated by the need for
emulation tools.

The specific name signature problems are:

1) one set of instructions has the "Masked" suffix (because of how
that is incorporated into names) and the other set does not (though I
suppose the operation could be renamed).

2) because the AVX2 instruction is bytes-only, to get the signature
right, requires "OverwriteBase" but OverwriteBase also requires
OverwriteClass and "simdgen does not support [OverwriteClass] in
inputs".

3) the default operation order is false, true, but we want this in a
"x.Merged(y, mask)" that pairs with "x.Masked(mask)" where the true
 case is x and the false case is y/zero, but the default ordering for
 VPBLENDVB and VPBLENDMB is false->x and true->y.

4) VPBLENDVB only comes in byte width, which causes problems
for floats.

All this may get fixed in the future, for now it is just an
implementation detail.

Change-Id: I61b655c7011e2c33f8644f704f886133c89d2f15
Reviewed-on: https://go-review.googlesource.com/c/go/+/693155
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
2025-08-05 17:43:49 -07:00
David Chase
6b9b59e144 [dev.simd] simd, cmd/compile: rename some methods
generated by simdgen CL 692556

these are the "easy" ones
SaturatedOp -> OpSaturated
PairwiseOp -> OpPairs
OpWithPrecision -> OpScaled
DiffWithOpWithPrecision -> OpScaledResidue

Change-Id: I036bf89c0690bcf9922c376d62cef48392942af3
Reviewed-on: https://go-review.googlesource.com/c/go/+/692357
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-08-04 11:53:11 -07:00
Junyang Shao
3f92aa1eca [dev.simd] cmd/compile, simd: make bitwise logic ops available to all u?int vectors
This CL is generated by CL 692555.

Change-Id: I24e6de83e0408576f385a1c8e861b08c583f9098
Reviewed-on: https://go-review.googlesource.com/c/go/+/692356
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-08-04 11:23:40 -07:00
Junyang Shao
c2d775d401 [dev.simd] cmd/compile, simd: change PairDotProdAccumulate to AddDotProd
This CL is generated by CL 692219.

Change-Id: I50fa919f1edc5c6505bc6d3238f65b37fc7628b5
Reviewed-on: https://go-review.googlesource.com/c/go/+/692156
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-08-04 09:52:09 -07:00
Junyang Shao
2c25f3e846 [dev.simd] cmd/compile, simd: change Shift*AndFillUpperFrom to Shift*Concat
This CL is generated by CL 692216.

Change-Id: Ib7530142bcce2a23f90d48866271994c57561955
Reviewed-on: https://go-review.googlesource.com/c/go/+/692215
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-08-04 09:52:05 -07:00
David Chase
ec5c20ba5a [dev.simd] cmd/compile: generated simd code to add some conversions
Generated by arch/internal/simdgen CL 689735

A small number of conversions for testing purposes

Change-Id: I4d52c643d08c02794c3fea9778bb1ecbb5507de4
Reviewed-on: https://go-review.googlesource.com/c/go/+/689716
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-08-01 14:14:27 -07:00
Junyang Shao
6f7a1164e7 [dev.simd] cmd/compile, simd: support store to bits for mask
This CL is partially generated by CL 689775.

Change-Id: I0c36fd2a44706c88db1a1d5ea4a6d0b9f891d85f
Reviewed-on: https://go-review.googlesource.com/c/go/+/689795
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-07-31 15:44:39 -07:00
Junyang Shao
03a3887f31 [dev.simd] simd: clean up masked op doc
This CL is generated by CL 688395.

Change-Id: I40c6a64c6002b28040e6af746481b4deb2049179
Reviewed-on: https://go-review.googlesource.com/c/go/+/688396
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-07-17 21:31:20 -07:00
Junyang Shao
c61743e4f0 [dev.simd] cmd/compile, simd: reorder PairDotProdAccumulate
This CL reorderes the param order of PairDotProdAccumulate family to be
dotprod(x, y) + z instead of the old dotprod(y, z) + x.

This CL also updates some documentation of other ML Ops.

This CL added a test to test the behavior is correct.

This CL is partially generated by CL 688115.

Change-Id: I76a6ee55a2ad8e3aff388d7e4fa5218ec0e4800d
Reviewed-on: https://go-review.googlesource.com/c/go/+/688095
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-07-17 21:31:14 -07:00
Junyang Shao
ef5f6cc921 [dev.simd] cmd/compile: adjust param order for AndNot
This CL adjusts the parameter order of AndNot, making it x &^ y instead
of ^x & y.

This CL also added a test.

This CL is partially generated by CL 687977.

Change-Id: I244e7b887991dc97e695131a5287af1b0e6fc3ce
Reviewed-on: https://go-review.googlesource.com/c/go/+/687996
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-07-15 14:54:29 -07:00
Junyang Shao
6d10680141 [dev.simd] cmd/compile, simd: add Compress
This CL is generated by CL 687975.

Change-Id: I21707d108773cc6d8e6f07aaed60e756faa1e6cb
Reviewed-on: https://go-review.googlesource.com/c/go/+/687995
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-07-15 14:54:17 -07:00