aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-08-31 23:14:26 +0200
committerhachem <im@hachem.wtf>2026-08-31 23:14:26 +0200
commit9dc06d01c2224ee1dbeb11ebee7c8afecfac8b05 (patch)
tree110fe30b5b1f228568087a8fe7b0f7e0ca43fbb1 /scripts
parent5b06b0e4b8effaacd23308d6a6b26c525e7d3af4 (diff)
feat: add support for floats through xmm registers
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/run.sh28
-rwxr-xr-xscripts/test_examples.sh1
2 files changed, 29 insertions, 0 deletions
diff --git a/scripts/run.sh b/scripts/run.sh
new file mode 100755
index 0000000..6d71521
--- /dev/null
+++ b/scripts/run.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+root="$(cd "$(dirname "$0")/.." && pwd)"
+cd "$root"
+
+if [ $# -lt 1 ]; then
+ echo "usage: $(basename "$0") <file.hdass>" >&2
+ exit 1
+fi
+
+file="$1"
+name="$(basename "${file%.*}")"
+
+docker compose up -d >/dev/null
+
+docker compose exec -T -e SRC="$file" -e NAME="$name" hdass bash -c '
+ set -e
+ cd /hdass
+ premake5 gmake >/dev/null
+ make config=debug >/dev/null
+ ./bin/debug-linux/hdass "$SRC" -o "/tmp/$NAME.asm"
+ nasm -f elf64 "/tmp/$NAME.asm" -o "/tmp/$NAME.o"
+ ld -e main "/tmp/$NAME.o" -o "/tmp/$NAME"
+ set +e
+ "/tmp/$NAME"
+ printf "\n[exit %s]\n" "$?"
+' </dev/null
diff --git a/scripts/test_examples.sh b/scripts/test_examples.sh
index 0928f7c..5290f09 100755
--- a/scripts/test_examples.sh
+++ b/scripts/test_examples.sh
@@ -85,6 +85,7 @@ check mul_div "multiply and non-rax division" examples/mul_div.hdass
check load "stores then loads through a pointer" examples/load.hdass 7 ""
check constants "hex literals and constant folding" examples/constants.hdass 42 ""
check records "enum values and struct field offsets" examples/records.hdass 42 ""
+check circle "floating-point math on SSE registers" examples/circle.hdass 28 ""
check fibonacci "prints the first ten Fibonacci numbers" examples/fibonacci.hdass 0 "0
1
1