aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Chambers <[email protected]>2021-10-10 17:40:56 +1300
committerAndrew Chambers <[email protected]>2021-10-10 17:40:56 +1300
commitbf562b2c9b6fa61751d22ab30365fe9289425d84 (patch)
tree01d47c44ede7f80427edd23b966ab5c010222475 /test
parentd6f46d0e72aefed61e2887ce1d6f4601b48648fb (diff)
Add test instruction.
Diffstat (limited to 'test')
-rw-r--r--test/test.sh31
1 files changed, 19 insertions, 12 deletions
diff --git a/test/test.sh b/test/test.sh
index 6126d1c..271f815 100644
--- a/test/test.sh
+++ b/test/test.sh
@@ -114,7 +114,7 @@ for r in a b
t "leaw (%r${r}x), %${r}x"
done
-for op in mov add and cmp or sub xor
+for op in mov add and cmp or sub xor test
do
# rip relative
t "${op}b \$127, (%rip)"
@@ -126,7 +126,7 @@ do
for r in a b
do
- # immediate variants.
+ # immediate variants
t "${op}b \$127, (%r${r}x)"
t "${op}w \$32767, (%r${r}x)"
t "${op}l \$2147483647, (%r${r}x)"
@@ -136,16 +136,7 @@ do
t "${op}l \$2147483647, %e${r}x"
t "${op}q \$2147483647, %r${r}x"
- # r rm variants
- t "${op}b (%rip), %${r}l"
- t "${op}b (%rax), %${r}l"
- t "${op}b (%rax), %${r}l"
- t "${op}w (%rax), %${r}x"
- t "${op}l (%rax), %e${r}x"
- t "${op}q (%rax), %r${r}x"
- t "${op}q (%rbp), %r${r}x"
- t "${op}q (%r8), %r${r}x"
- t "${op}q (%r13), %r${r}x"
+ # r -> m variants
t "${op}b %${r}l, (%rip)"
t "${op}b %${r}l, (%rax)"
t "${op}w %${r}x, (%rax)"
@@ -158,6 +149,22 @@ do
t "${op}w %${r}x, %ax"
t "${op}l %e${r}x, %eax"
t "${op}q %r${r}x, %rax"
+
+ if test "$op" = "test" # m -> variants are not supported by test
+ then
+ continue
+ fi
+
+ # m -> r variants
+ t "${op}b (%rip), %${r}l"
+ t "${op}b (%rax), %${r}l"
+ t "${op}b (%rax), %${r}l"
+ t "${op}w (%rax), %${r}x"
+ t "${op}l (%rax), %e${r}x"
+ t "${op}q (%rax), %r${r}x"
+ t "${op}q (%rbp), %r${r}x"
+ t "${op}q (%r8), %r${r}x"
+ t "${op}q (%r13), %r${r}x"
done
done