mirror of
https://github.com/MacosPorters/betterxen.git
synced 2026-11-26 20:50:44 +00:00
Adds v_mul_{i32_i24,hi_i32_i24,u32_u24,hi_u32_u24}, v_min/max_{i32,u32},
v_xnor_b32 and v_{add,sub,subrev}_nc_u32 as registry data under a new
vop2_vgpr operand rule (VGPR destination; SRC0 a VGPR, s0-s105, vcc_lo,
an inline integer or a literal; VGPR VSRC1). Vector forms select a
per-lane VectorBinary from their declared operation and signedness, and
the shader lowers each VectorBinary through one typed MSL template; SUBREV
declares source_order = reversed. Variant names are now unique per
generated enum. The decoder shares the VOPC SRC0 decode, and the
translator binds a result to the slot it was pushed at, since operand
constants may now be pushed first. The oracle merged from
task/215-vop2-oracle supplies the reference side; a new LLVM-assembled
fixture computes every lane from its own input.
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
25 lines
979 B
Bash
Executable File
25 lines
979 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 scalar-unary scalar-arith vector-integer; 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
|