]> Cypherpunks repositories - gostls13.git/commit
[dev.simd] simd/_gen: migrate simdgen from x/arch
authorAustin Clements <austin@google.com>
Wed, 13 Aug 2025 19:30:27 +0000 (15:30 -0400)
committerAustin Clements <austin@google.com>
Wed, 13 Aug 2025 20:56:26 +0000 (13:56 -0700)
commitb7c869854962603ecffe5be6dc5c650fe2e07df9
treef63a2138be412de449d7465a56d0c0f4fa49e533
parent257c1356ecd7a15830eabe17a6d42878a8538cfd
[dev.simd] simd/_gen: migrate simdgen from x/arch

This moves the simdgen tool and its supporting unify package from
golang.org/x/arch/internal as of CL 695619 to simd/_gen in the main repo.

The simdgen tool was started in x/arch to live next to xeddata and a
few other assembler generators that already lived there. However, as
we've been developing simdgen, we've discovered that there's a
tremendous amount of process friction coordinating commits to x/arch
with the corresponding generated files in the main repo.

Many of the existing generators in x/arch were started before modules
existed. In GOPATH world, it was impractical for them to live in the
main repo because they have dependencies that are not allowed in the
main repo. However, now that we have modules and can use small
submodules in the main repo, we can isolate these dependencies to just
the generators, making it practical for them to live in the main repo.

This commit was generated by the following script:

# Checks
set -e
if [[ ! -d src/simd ]]; then
    echo >&2 "$PWD is not the root of the main repo on dev.simd"
    exit 1
fi
if [[ -z "$XEDDATA" ]]; then
    echo >&2 "Must set \$XEDDATA"
    exit 1
fi
which go >/dev/null

# Move simdgen from x/arch
xarch=$(mktemp -d)
git clone https://go.googlesource.com/arch $xarch
xarchCL=$(git -C $xarch log -1 --format=%b | awk -F/ '/^Reviewed-on:/ {print $NF}')
echo >&2 "x/arch CL: $xarchCL"
mv $xarch/internal src/simd/_gen
sed --in-place s,golang.org/x/arch/internal/,simd/_gen/, src/simd/_gen/*/*.go
# Create self-contained module
cat > src/simd/_gen/go.mod <<EOF
module simd/_gen

go 1.24
EOF
cd src/simd/_gen
go mod tidy
git add .
git gofmt
# Regenerate file
go run -C simdgen . -xedPath $XEDDATA -o godefs -goroot $(go env GOROOT) go.yaml types.yaml categories.yaml
go run -C ../../cmd/compile/internal/ssa/_gen .

Change-Id: I56dd8473e913a9eb1978d9b3b3518ed632972f6f
Reviewed-on: https://go-review.googlesource.com/c/go/+/695975
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
60 files changed:
src/simd/_gen/go.mod [new file with mode: 0644]
src/simd/_gen/go.sum [new file with mode: 0644]
src/simd/_gen/simdgen/.gitignore [new file with mode: 0644]
src/simd/_gen/simdgen/asm.yaml.toy [new file with mode: 0644]
src/simd/_gen/simdgen/categories.yaml [new file with mode: 0644]
src/simd/_gen/simdgen/etetest.sh [new file with mode: 0755]
src/simd/_gen/simdgen/gen_simdGenericOps.go [new file with mode: 0644]
src/simd/_gen/simdgen/gen_simdIntrinsics.go [new file with mode: 0644]
src/simd/_gen/simdgen/gen_simdMachineOps.go [new file with mode: 0644]
src/simd/_gen/simdgen/gen_simdTypes.go [new file with mode: 0644]
src/simd/_gen/simdgen/gen_simdrules.go [new file with mode: 0644]
src/simd/_gen/simdgen/gen_simdssa.go [new file with mode: 0644]
src/simd/_gen/simdgen/gen_utility.go [new file with mode: 0644]
src/simd/_gen/simdgen/go.yaml [new file with mode: 0644]
src/simd/_gen/simdgen/godefs.go [new file with mode: 0644]
src/simd/_gen/simdgen/main.go [new file with mode: 0644]
src/simd/_gen/simdgen/ops/AddSub/categories.yaml [new file with mode: 0644]
src/simd/_gen/simdgen/ops/AddSub/go.yaml [new file with mode: 0644]
src/simd/_gen/simdgen/ops/BitwiseLogic/categories.yaml [new file with mode: 0644]
src/simd/_gen/simdgen/ops/BitwiseLogic/go.yaml [new file with mode: 0644]
src/simd/_gen/simdgen/ops/Compares/categories.yaml [new file with mode: 0644]
src/simd/_gen/simdgen/ops/Compares/go.yaml [new file with mode: 0644]
src/simd/_gen/simdgen/ops/Converts/categories.yaml [new file with mode: 0644]
src/simd/_gen/simdgen/ops/Converts/go.yaml [new file with mode: 0644]
src/simd/_gen/simdgen/ops/FPonlyArith/categories.yaml [new file with mode: 0644]
src/simd/_gen/simdgen/ops/FPonlyArith/go.yaml [new file with mode: 0644]
src/simd/_gen/simdgen/ops/GaloisField/categories.yaml [new file with mode: 0644]
src/simd/_gen/simdgen/ops/GaloisField/go.yaml [new file with mode: 0644]
src/simd/_gen/simdgen/ops/IntOnlyArith/categories.yaml [new file with mode: 0644]
src/simd/_gen/simdgen/ops/IntOnlyArith/go.yaml [new file with mode: 0644]
src/simd/_gen/simdgen/ops/MLOps/categories.yaml [new file with mode: 0644]
src/simd/_gen/simdgen/ops/MLOps/go.yaml [new file with mode: 0644]
src/simd/_gen/simdgen/ops/MinMax/categories.yaml [new file with mode: 0644]
src/simd/_gen/simdgen/ops/MinMax/go.yaml [new file with mode: 0644]
src/simd/_gen/simdgen/ops/Moves/categories.yaml [new file with mode: 0644]
src/simd/_gen/simdgen/ops/Moves/go.yaml [new file with mode: 0644]
src/simd/_gen/simdgen/ops/Mul/categories.yaml [new file with mode: 0644]
src/simd/_gen/simdgen/ops/Mul/go.yaml [new file with mode: 0644]
src/simd/_gen/simdgen/ops/ShiftRotate/categories.yaml [new file with mode: 0644]
src/simd/_gen/simdgen/ops/ShiftRotate/go.yaml [new file with mode: 0644]
src/simd/_gen/simdgen/pprint.go [new file with mode: 0644]
src/simd/_gen/simdgen/sort_test.go [new file with mode: 0644]
src/simd/_gen/simdgen/types.yaml [new file with mode: 0644]
src/simd/_gen/simdgen/xed.go [new file with mode: 0644]
src/simd/_gen/unify/closure.go [new file with mode: 0644]
src/simd/_gen/unify/domain.go [new file with mode: 0644]
src/simd/_gen/unify/dot.go [new file with mode: 0644]
src/simd/_gen/unify/env.go [new file with mode: 0644]
src/simd/_gen/unify/html.go [new file with mode: 0644]
src/simd/_gen/unify/pos.go [new file with mode: 0644]
src/simd/_gen/unify/testdata/stress.yaml [new file with mode: 0644]
src/simd/_gen/unify/testdata/unify.yaml [new file with mode: 0644]
src/simd/_gen/unify/testdata/vars.yaml [new file with mode: 0644]
src/simd/_gen/unify/trace.go [new file with mode: 0644]
src/simd/_gen/unify/unify.go [new file with mode: 0644]
src/simd/_gen/unify/unify_test.go [new file with mode: 0644]
src/simd/_gen/unify/value.go [new file with mode: 0644]
src/simd/_gen/unify/value_test.go [new file with mode: 0644]
src/simd/_gen/unify/yaml.go [new file with mode: 0644]
src/simd/_gen/unify/yaml_test.go [new file with mode: 0644]