Files
betterxen/scripts/assemble-fixture.sh
T
elforeign cd59e081d9 isa, decoder: SOPC integer compares through the semantic registry (#215 stage D)
Adds a compare operation with a declared relation and the sopc_scalar
operand rule, so all twelve s_cmp_*_{i32,u32} forms are registry data.
The decoder dispatches them through the generated OP table and the
translator resolves SCC with ScalarCompareOp::test; the hand-written
s_cmp_eq_u32 path and its opcode constant are gone. A new LLVM-assembled
fixture records every compare's SCC, and the separately written oracle
from task/215-stage-d-oracle supplies the reference side.

Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
2026-11-24 04:16:09 -06:00

25 lines
938 B
Bash
Executable File

#!/bin/sh
# SPDX-License-Identifier: GPL-3.0-or-later
set -eu
cd "$(dirname "$0")/.."
llvm_bin=${LLVM_BIN:-$(brew --prefix llvm)/bin}
scratch=$(mktemp -d)
trap 'rm -rf "$scratch"' EXIT
case "${1:-}" in
--check|"") ;;
*) printf '%s\n' 'usage: scripts/assemble-fixture.sh [--check]' >&2; exit 2 ;;
esac
for name in add bitwise-branch float-exact or shifts ashr \
x9-constant-vs x9-constant-ps x9-varying-vs x9-varying-ps x9-transform-vs scalar-alu vector-compare scalar-logic scalar-compare; do
"$llvm_bin/llvm-mc" -triple=amdgcn-amd-amdhsa -mcpu=gfx1030 -mattr=+wavefrontsize32 \
-filetype=obj "fixtures/rdna2/$name.s" -o "$scratch/$name.o"
"$llvm_bin/llvm-objcopy" -O binary --only-section=.text "$scratch/$name.o" "$scratch/$name.bin"
if [ "${1:-}" = --check ]; then
cmp "$scratch/$name.bin" "fixtures/rdna2/$name.bin"
else
cp "$scratch/$name.bin" "fixtures/rdna2/$name.bin"
fi
done