summaryrefslogtreecommitdiff
path: root/js/src/lirasm/tests/softfloat/ii2d.in
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/lirasm/tests/softfloat/ii2d.in')
-rw-r--r--js/src/lirasm/tests/softfloat/ii2d.in20
1 files changed, 20 insertions, 0 deletions
diff --git a/js/src/lirasm/tests/softfloat/ii2d.in b/js/src/lirasm/tests/softfloat/ii2d.in
new file mode 100644
index 0000000..7189917
--- /dev/null
+++ b/js/src/lirasm/tests/softfloat/ii2d.in
@@ -0,0 +1,20 @@
+; It's very difficult to test that the 'lo' part is actually doing anything
+; because it tends to get lost when lirasm dumps the result to the console.
+; By far the easiest way to check this is to use dlo2i and dhi2i to see if we
+; get what we started with (assuming that those instructions work).
+
+hi = immi 1127219201 ; 0x43300001 (positive, exponent of +52 ...
+lo = immi -1 ; 0xffffffff (... mantissa of 0x100001ffffffff)
+d = ii2d lo hi
+hi2 = dhi2i d
+lo2 = dlo2i d
+
+; XOR to check for differences, then OR the two results. 0 indicates success,
+; but anything else indicates some kind of loss of data.
+rhi = xori hi hi2
+rlo = xori lo lo2
+
+res = ori rhi rlo
+
+reti res
+