aboutsummaryrefslogtreecommitdiff
path: root/deps/lightning/check/ldstr.tst
diff options
context:
space:
mode:
authorPaul Cercueil2020-01-30 12:33:44 -0300
committerPaul Cercueil2020-02-08 11:44:52 -0300
commit4a71579b757d3a2eb6902c84391f429838ad4912 (patch)
treec57430315f1b82497eebd3fef24c0f4c0336bf0d /deps/lightning/check/ldstr.tst
parentea884d3029c673e06a4084156ceb662598d8945a (diff)
downloadpcsx_rearmed-4a71579b757d3a2eb6902c84391f429838ad4912.tar.gz
pcsx_rearmed-4a71579b757d3a2eb6902c84391f429838ad4912.tar.bz2
pcsx_rearmed-4a71579b757d3a2eb6902c84391f429838ad4912.zip
git subrepo clone https://git.savannah.gnu.org/git/lightning.git deps/lightning
subrepo: subdir: "deps/lightning" merged: "b0b8eb5" upstream: origin: "https://git.savannah.gnu.org/git/lightning.git" branch: "master" commit: "b0b8eb5" git-subrepo: version: "0.4.1" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "a04d8c2"
Diffstat (limited to 'deps/lightning/check/ldstr.tst')
-rw-r--r--deps/lightning/check/ldstr.tst183
1 files changed, 183 insertions, 0 deletions
diff --git a/deps/lightning/check/ldstr.tst b/deps/lightning/check/ldstr.tst
new file mode 100644
index 0000000..1ed26b1
--- /dev/null
+++ b/deps/lightning/check/ldstr.tst
@@ -0,0 +1,183 @@
+#include "ldst.inc"
+
+#if __WORDSIZE == 64
+# define LDSTL(N, R0, R1) \
+ movi %R0 $(t0 + $offui) \
+ str_i %R0 %R1 \
+ movi %R0 $(t0 + $offl) \
+ movi %R1 L##N \
+ str_l %R0 %R1
+
+# define SI(C, N, x, X, R0, R1) \
+ movi %R0 $(t0 + $off##x) \
+ ldr_##x %R1 %R0 \
+ beqi L##x##C %R1 L##X##N \
+ calli @abort \
+L##x##C:
+
+# define LDRL(C, N, R0, R1) \
+ UI(C, N, i, I, R0, R1) \
+ SI(C, N, l, L, R0, R1)
+#else
+# define LDSTL(C, R0, R1)
+# define SI(C, N, x, X, R0, R1) \
+ movi %R0 $(t0 + $off##x) \
+ ldr_##x %R1 %R0 \
+ beqi L##x##C %R1 I##X##N \
+ calli @abort \
+L##x##C:
+
+# define LDRL(C, N, R0, R1)
+
+#endif
+
+#define UI(C, N, x, X, R0, R1) \
+ movi %R0 $(t0 + $offu##x) \
+ ldr_u##x %R1 %R0 \
+ beqi Lu##x##C %R1 X##N \
+ calli @abort \
+Lu##x##C:
+
+#define FF(C, N, x, X, R0, F0) \
+ movi %R0 $(t0 + $off##x) \
+ ldr_##x %F0 %R0 \
+ beqi_##x L##x##C %F0 X##N \
+L##x##C:
+
+#define LDST1(X, N, R0, R1, F0) \
+ movi %R0 $(t0 + $offc) \
+ movi %R1 C##N \
+ str_c %R0 %R1 \
+ movi %R0 $(t0 + $offuc) \
+ str_c %R0 %R1 \
+ movi %R0 $(t0 + $offs) \
+ movi %R1 S##N \
+ str_s %R0 %R1 \
+ movi %R0 $(t0 + $offus) \
+ str_s %R0 %R1 \
+ movi %R0 $(t0 + $offi) \
+ movi %R1 I##N \
+ str_i %R0 %R1 \
+ LDSTL(N, R0, R1) \
+ movi %R0 $(t0 + $offf) \
+ movi_f %F0 F##N \
+ str_f %R0 %F0 \
+ movi %R0 $(t0 + $offd) \
+ movi_d %F0 D##N \
+ str_d %R0 %F0 \
+ SI(X, N, c, C, R0, R1) \
+ UI(X, N, c, C, R0, R1) \
+ SI(X, N, s, S, R0, R1) \
+ UI(X, N, s, S, R0, R1) \
+ SI(X, N, i, I, R0, R1) \
+ LDRL(X, N, R0, R1) \
+ FF(X, N, f, F, R0, F0) \
+ FF(X, N, d, D, R0, F0)
+
+#define LDST0(R0, R1, F0) \
+ LDST1(0_##R0##_##R1##_##F0, 0, R0, R1, F0) \
+ LDST1(1_##R0##_##R1##_##F0, 1, R0, R1, F0) \
+ LDST1(2_##R0##_##R1##_##F0, 2, R0, R1, F0) \
+ LDST1(3_##R0##_##R1##_##F0, 3, R0, R1, F0)
+
+#define LDST(V0, V1, V2, R0, R1, R2, F0, F1, F2, F3, F4, F5) \
+ LDST0(V0, V1, F0) \
+ LDST0(V0, V2, F1) \
+ LDST0(V0, R0, F3) \
+ LDST0(V0, R1, F4) \
+ LDST0(V0, R2, F5) \
+ LDST0(V1, V2, F0) \
+ LDST0(V1, R0, F1) \
+ LDST0(V1, R1, F2) \
+ LDST0(V1, R2, F3) \
+ LDST0(V2, R0, F4) \
+ LDST0(V2, R1, F5) \
+ LDST0(V2, R2, F0)
+
+.code
+ prolog
+
+ /* Simple test to simplify validating encodings before
+ * brute force tests */
+ movi %r0 $(t0 + $offc)
+ movi %r1 0x81
+ str_c %r0 %r1
+ movi %r0 $(t0 + $offuc)
+ str_c %r0 %r1
+ movi %r0 $(t0 + $offs)
+ movi %r1 0x8001
+ str_s %r0 %r1
+ movi %r0 $(t0 + $offus)
+ str_s %r0 %r1
+ movi %r0 $(t0 + $offi)
+ movi %r1 0x80000001
+ str_i %r0 %r1
+#if __WORDSIZE == 64
+ movi %r0 $(t0 + $offui)
+ str_i %r0 %r1
+ movi %r0 $(t0 + $offl)
+ movi %r1 0x8000000000000001
+ str_l %r0 %r1
+#endif
+ movi %r0 $(t0 + $offf)
+ movi_f %f0 0.5
+ str_f %r0 %f0
+ movi %r0 $(t0 + $offd)
+ movi_d %f0 0.25
+ str_d %r0 %f0
+ movi %r0 $(t0 + $offc)
+ ldr_c %r1 %r0
+ beqi Lc %r1 XC
+ calli @abort
+Lc:
+ movi %r0 $(t0 + $offuc)
+ ldr_uc %r1 %r0
+ beqi Luc %r1 0x81
+ calli @abort
+Luc:
+ movi %r0 $(t0 + $offs)
+ ldr_s %r1 %r0
+ beqi Ls %r1 XS
+ calli @abort
+Ls:
+ movi %r0 $(t0 + $offus)
+ ldr_us %r1 %r0
+ beqi Lus %r1 0x8001
+ calli @abort
+Lus:
+ movi %r0 $(t0 + $offi)
+ ldr_i %r1 %r0
+ beqi Li %r1 XI
+ calli @abort
+Li:
+#if __WORDSIZE == 64
+ movi %r0 $(t0 + $offui)
+ ldr_ui %r1 %r0
+ beqi Lui %r1 0x80000001
+ calli @abort
+Lui:
+ movi %r0 $(t0 + $offl)
+ ldr_l %r1 %r0
+ beqi Ll %r1 0x8000000000000001
+ calli @abort
+Ll:
+#endif
+ movi %r0 $(t0 + $offf)
+ ldr_f %f0 %r0
+ beqi_f Lf %f0 0.5
+ calli @abort
+Lf:
+ movi %r0 $(t0 + $offd)
+ ldr_d %f0 %r0
+ beqi_d Ld %f0 0.25
+ calli @abort
+Ld:
+
+ LDST(v0, v1, v2, r0, r1, r2, f0, f1, f2, f3, f4, f5)
+ // just to know did not abort
+ prepare
+ pushargi ok
+ ellipsis
+ finishi @printf
+ ret
+ epilog