[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 314/437: Add back files missed when reapplying patches
From: |
Andy Wingo |
Subject: |
[Guile-commits] 314/437: Add back files missed when reapplying patches |
Date: |
Mon, 2 Jul 2018 05:14:43 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit 5c0c5bde6d7e23826d8957887883f32cf9915ec9
Author: pcpa <address@hidden>
Date: Wed Oct 15 13:09:14 2014 -0300
Add back files missed when reapplying patches
---
check/align.ok | 1 +
check/align.tst | 27 ++++++++++++++
check/tramp.ok | 1 +
check/tramp.tst | 111 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 140 insertions(+)
diff --git a/check/align.ok b/check/align.ok
new file mode 100644
index 0000000..f599e28
--- /dev/null
+++ b/check/align.ok
@@ -0,0 +1 @@
+10
diff --git a/check/align.tst b/check/align.tst
new file mode 100644
index 0000000..59bbb56
--- /dev/null
+++ b/check/align.tst
@@ -0,0 +1,27 @@
+.data 32
+fmt:
+.c "%d\n"
+.code
+ prolog
+ movi %r0 1
+ jmpi L1 /* should not generate this */
+ align $(__WORDSIZE / 8) /* possible nops */
+L1:
+ bgei L4 %r0 10
+ addi %r0 %r0 1
+ jmpi L2
+ movr %r1 %r0 /* to force jump generation */
+ align $(__WORDSIZE / 8) /* possible nops */
+L2:
+ bgti L4 %r0 10 /* never executed */
+ align $(__WORDSIZE / 8) /* possible nops */
+L3:
+ jmpi L1
+ align $(__WORDSIZE / 8) /* possible nops */
+L4:
+ prepare
+ pushargi fmt
+ pushargr %r0
+ finishi @printf
+ ret
+ epilog
diff --git a/check/tramp.ok b/check/tramp.ok
new file mode 100644
index 0000000..6adb29f
--- /dev/null
+++ b/check/tramp.ok
@@ -0,0 +1 @@
+xfibs(32) = 7049155
diff --git a/check/tramp.tst b/check/tramp.tst
new file mode 100644
index 0000000..faf63d2
--- /dev/null
+++ b/check/tramp.tst
@@ -0,0 +1,111 @@
+#if __WORDSIZE == 32
+# define SIZE 4
+#else
+# define SIZE 8
+#endif
+.data 8192
+fmt:
+.c "xfibs(%d) = %d\n"
+/* Simulate a language specific stack */
+.align SIZE
+top:
+/* Top, or base of the stack */
+.size SIZE
+stk:
+.size 8160
+
+.code
+ jmpi main
+
+/* Usually a trampoline is created before the code that uses it, but
+ * for testing purposes it is not required.
+ * In this test case, it would mean "main" would be converted in a
+ * different jit_state_t to native code, before xfibs was know.
+ */
+ name xfibs
+xfibs:
+ /* return address is in %r0 */
+ /* argument and return value in %v0 */
+ prolog
+ tramp 64
+ blti_u out %v0 2
+ subi %v1 %v0 1 /* V1 = N-1 */
+ subi %v2 %v0 2 /* V1 = N-2 */
+
+ /* save return address */
+ ldi %r1 top
+ stxi $(SIZE * 0) %r1 %r0
+ /* save operands */
+ stxi $(SIZE * 1) %r1 %v0
+ stxi $(SIZE * 2) %r1 %v1
+ stxi $(SIZE * 3) %r1 %v2
+ /* adjust "language" stack */
+ addi %r1 %r1 $(SIZE * 4)
+ sti top %r1
+
+ /* return address */
+ movi %r0 ret1
+ /* argument */
+ movr %v0 %v1
+ /* indirect goto */
+ jmpi xfibs
+ret1:
+ movr %v1 %v0 /* V1 = rfibs(N-1) */
+ /* save V1 */
+ ldi %r1 top
+ stxi $(-SIZE * 2) %r1 %v1
+
+ /* reload V2 */
+ ldxi %v2 %r1 $(-SIZE * 1)
+
+ /* return address */
+ movi %r0 ret2
+ /* argument */
+ movr %v0 %v2
+ /* indirect goto */
+ jmpi xfibs
+ret2:
+ movr %v2 %v0 /* V2 = rfibs(N-2) */
+
+ /* reload return address */
+ ldi %r1 top
+ subi %r1 %r1 $(SIZE * 4)
+ ldxi %r0 %r1 $(SIZE * 0)
+ /* reload operands */
+ ldxi %v0 %r1 $(SIZE * 1)
+ ldxi %v1 %r1 $(SIZE * 2)
+ /* V2 already loaded */
+ /* update "language" stack */
+ sti top %r1
+
+ addi %v1 %v1 1
+ addr %v0 %v1 %v2
+ jmpr %r0
+out:
+ movi %v0 1
+ jmpr %r0
+ epilog
+
+ name main
+main:
+ prolog
+ frame 64
+
+ /* Initialize language stack */
+ movi %r0 stk
+ sti top %r0
+
+ /* return address */
+ movi %r0 done
+ /* argument */
+ movi %v0 32
+ jmpi xfibs
+done:
+ prepare
+ pushargi fmt
+ ellipsis
+ pushargi 32
+ pushargr %v0
+ finishi @printf
+ ret
+ epilog
- [Guile-commits] 434/437: Remove unused AM_CONDITIONAL statements from lightning configure, (continued)
- [Guile-commits] 434/437: Remove unused AM_CONDITIONAL statements from lightning configure, Andy Wingo, 2018/07/02
- [Guile-commits] 390/437: Correct make check for systems without gcc., Andy Wingo, 2018/07/02
- [Guile-commits] 388/437: sparc: Add initial jit_va_ calls to sparc, Andy Wingo, 2018/07/02
- [Guile-commits] 319/437: Properly handle jit_tramp and function descriptors, Andy Wingo, 2018/07/02
- [Guile-commits] 414/437: Always set t12 to address of called function, Andy Wingo, 2018/07/02
- [Guile-commits] 289/437: Remove the global but not advertised jit_progname variable, Andy Wingo, 2018/07/02
- [Guile-commits] 334/437: ARM: Correct several inconsistencies with ldrd and strd, Andy Wingo, 2018/07/02
- [Guile-commits] 210/437: Correct all ldst test cases., Andy Wingo, 2018/07/02
- [Guile-commits] 252/437: GNU lightning 2.0.1 release, Andy Wingo, 2018/07/02
- [Guile-commits] 327/437: Force creation of the m4 directory on a clean checkout, Andy Wingo, 2018/07/02
- [Guile-commits] 314/437: Add back files missed when reapplying patches,
Andy Wingo <=
- [Guile-commits] 354/437: Implement the jit_arg_register_p predicate., Andy Wingo, 2018/07/02
- [Guile-commits] 381/437: Remove wrong comment after cut and paste, Andy Wingo, 2018/07/02
- [Guile-commits] 209/437: Correct float division and LX with stop code generation., Andy Wingo, 2018/07/02
- [Guile-commits] 280/437: Implement the new jit_set_code interface., Andy Wingo, 2018/07/02
- [Guile-commits] 284/437: ARM: Do not emit a nop stack adjust instruction., Andy Wingo, 2018/07/02
- [Guile-commits] 345/437: PPC: Implement and use mcrxr emulation by default, Andy Wingo, 2018/07/02
- [Guile-commits] 246/437: Use the logic to workaround float NaN and Inf Hercules bug conditional, Andy Wingo, 2018/07/02
- [Guile-commits] 363/437: Correct typo, Andy Wingo, 2018/07/02
- [Guile-commits] 383/437: ia64: Implement cache flush., Andy Wingo, 2018/07/02
- [Guile-commits] 371/437: Correct read of freed memory, Andy Wingo, 2018/07/02