[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 175/437: Make JIT_RET, JIT_FRET and JIT_SP private.
From: |
Andy Wingo |
Subject: |
[Guile-commits] 175/437: Make JIT_RET, JIT_FRET and JIT_SP private. |
Date: |
Mon, 2 Jul 2018 05:14:12 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit c5421a8c7646f4ebb72979ee9f63dcf659bfc282
Author: pcpa <address@hidden>
Date: Thu Jan 17 16:13:29 2013 -0200
Make JIT_RET, JIT_FRET and JIT_SP private.
* check/add.tst, check/allocai.tst, check/bp.tst, check/divi.tst,
check/fib.tst, check/lightning.c, include/lightning/jit_arm.h,
include/lightning/jit_mips.h, include/lightning/jit_ppc.h,
include/lightning/jit_private.h, include/lightning/jit_x86.h:
Make JIT_RET, JIT_FRET and JIT_SP private. These should not be
used in any operations due to frequently having special
constraints (usually JIT_FRET). JIT_FP must be made available
because it must be used as the base register to access stack
space allocated with jit_allocai.
---
ChangeLog | 12 ++++++++++++
TODO | 3 ---
check/add.tst | 4 ++--
check/allocai.tst | 5 +++--
check/bp.tst | 7 +++----
check/divi.tst | 6 ++++--
check/fib.tst | 3 +--
check/lightning.c | 14 --------------
include/lightning/jit_arm.h | 7 -------
include/lightning/jit_mips.h | 3 ---
include/lightning/jit_ppc.h | 3 ---
include/lightning/jit_private.h | 26 ++++++++++++++++++++++++++
include/lightning/jit_x86.h | 4 ----
13 files changed, 51 insertions(+), 46 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 942b325..41b0498 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2013-01-17 Paulo Andrade <address@hidden>
+
+ * check/add.tst, check/allocai.tst, check/bp.tst, check/divi.tst,
+ check/fib.tst, check/lightning.c, include/lightning/jit_arm.h,
+ include/lightning/jit_mips.h, include/lightning/jit_ppc.h,
+ include/lightning/jit_private.h, include/lightning/jit_x86.h:
+ Make JIT_RET, JIT_FRET and JIT_SP private. These should not be
+ used in any operations due to frequently having special
+ constraints (usually JIT_FRET). JIT_FP must be made available
+ because it must be used as the base register to access stack
+ space allocated with jit_allocai.
+
2013-01-14 Paulo Andrade <address@hidden>
* include/lightning.h, lib/lightning.c: Add an extra align
diff --git a/TODO b/TODO
index 8cb2657..fb21097 100644
--- a/TODO
+++ b/TODO
@@ -6,6 +6,3 @@
* Update documentation to match new implementation.
* Make an sparc port to not remove previous functionality.
-
- * Test and correct the ppc and mips ports, after the import and
- adaptation of the code to lightning.
diff --git a/check/add.tst b/check/add.tst
index d849fce..5ef50a3 100644
--- a/check/add.tst
+++ b/check/add.tst
@@ -11,8 +11,8 @@ test:
arg $i1
getarg %r0 $i0
getarg %r1 $i1
- addr %ret %r0 %r1
- ret
+ addr %r0 %r0 %r1
+ retr %r0
epilog
main:
diff --git a/check/allocai.tst b/check/allocai.tst
index 9bb6cbe..bcfe3c4 100644
--- a/check/allocai.tst
+++ b/check/allocai.tst
@@ -79,11 +79,12 @@ main:
prepare
pushargi 7777
finishi identity_func
- beqi succeeded %ret 7777
+ retval %r0
+ beqi succeeded %r0 7777
prepare
pushargi report_message
ellipsis
- pushargr %ret
+ pushargr %r0
pushargi 7777
finishi @printf
reti 1
diff --git a/check/bp.tst b/check/bp.tst
index 487217b..e312e55 100644
--- a/check/bp.tst
+++ b/check/bp.tst
@@ -22,11 +22,10 @@ rfibs:
finishi rfibs
retval %v2 /* V2 = rfibs(N-2) */
addi %v1 %v1 1
- addr %ret %v1 %v2
- ret
+ addr %r0 %v1 %v2
+ retr %r0
out:
- movi %ret 1
- ret
+ reti 1
epilog
main:
diff --git a/check/divi.tst b/check/divi.tst
index 94bd3d6..c54a436 100644
--- a/check/divi.tst
+++ b/check/divi.tst
@@ -68,12 +68,14 @@ main:
pushargi small_ops
pushargi 3
finishi test_divider_8
- bnei fail %ret 0
+ retval %r0
+ bnei fail %r0 0
prepare
pushargi large_ops
pushargi 3
finishi test_divider_32768
- bnei fail %ret 0
+ retval %r0
+ bnei fail %r0 0
reti 0
fail:
reti 1
diff --git a/check/fib.tst b/check/fib.tst
index 6891de0..0bb441f 100644
--- a/check/fib.tst
+++ b/check/fib.tst
@@ -20,8 +20,7 @@ loop:
addi %r1 %v0 1 // R1 = V0 + 1
bnei loop %r2 0 // if (R2) goto loop
ref:
- movr %ret %r1 // RET = R1
- ret
+ retr %r1 // RET = R1
epilog
main:
diff --git a/check/lightning.c b/check/lightning.c
index 90bdd7c..dc31792 100644
--- a/check/lightning.c
+++ b/check/lightning.c
@@ -1827,10 +1827,6 @@ regname(void)
case '0': parser.regval = JIT_R0; break;
case '1': parser.regval = JIT_R1; break;
case '2': parser.regval = JIT_R2; break;
- case 'e':
- if (getch() != 't') goto fail;
- parser.regval = JIT_RET;
- break;
case '(':
num = get_int(skip_none);
if (num < 0 || num >= JIT_R_NUM) goto fail;
@@ -1869,10 +1865,6 @@ regname(void)
case 'p':
parser.regtype = type_l; /* oops */
parser.regval = JIT_FP; break;
- case 'r':
- if (getch() != 'e' || getch() != 't') goto fail;
- parser.regval = JIT_FRET;
- break;
case '(':
num = get_int(skip_none);
if (num < 0 || num >= JIT_F_NUM) goto fail;
@@ -1883,12 +1875,6 @@ regname(void)
default: goto fail;
}
break;
- case 's':
- parser.regtype = type_l;
- if (getch() != 'p')
- goto fail;
- parser.regval = JIT_SP;
- break;
default:
fail:
error("bad register");
diff --git a/include/lightning/jit_arm.h b/include/lightning/jit_arm.h
index 9ee7b2c..f981a85 100644
--- a/include/lightning/jit_arm.h
+++ b/include/lightning/jit_arm.h
@@ -27,8 +27,6 @@
#define jit_swf_p() (jit_cpu.vfp == 0)
#define jit_hardfp_p() jit_cpu.abi
-#define JIT_RET _R0
-#define JIT_SP _R13
#define JIT_FP _R11
typedef enum {
#define jit_arg_reg_p(i) ((i) >= 0 && (i) < 4)
@@ -65,11 +63,6 @@ typedef enum {
_R2, /* r2 - argument/result */
_R1, /* r1 - argument/result */
_R0, /* r0 - argument/result */
-#if defined(__ARM_PCS_VFP)
-# define JIT_FRET _D0
-#else
-# define JIT_FRET _R0
-#endif
#define JIT_F0 (jit_hardfp_p() ? _D8 : _D0)
#define JIT_F1 (jit_hardfp_p() ? _D9 : _D1)
#define JIT_F2 (jit_hardfp_p() ? _D10 : _D2)
diff --git a/include/lightning/jit_mips.h b/include/lightning/jit_mips.h
index 505e066..fc2ab56 100644
--- a/include/lightning/jit_mips.h
+++ b/include/lightning/jit_mips.h
@@ -24,9 +24,6 @@
/*
* Types
*/
-#define JIT_RET _V0
-#define JIT_FRET _F0
-#define JIT_SP _SP
#define JIT_FP _FP
typedef enum {
#define jit_arg_reg_p(i) ((i) >= 0 && (i) < 4)
diff --git a/include/lightning/jit_ppc.h b/include/lightning/jit_ppc.h
index dcdc8f1..b824410 100644
--- a/include/lightning/jit_ppc.h
+++ b/include/lightning/jit_ppc.h
@@ -59,11 +59,9 @@ typedef enum {
_R14, _R15, _R16, _R17, _R18, _R19, _R20, _R21,
_R22, _R23, _R24, _R25, _R26, _R27, _R28, _R29,
_R30,
-#define JIT_SP _R1
_R1,
#define JIT_FP _R31
_R31,
-#define JIT_RET _R3
#define JIT_RA0 _R3
#define JIT_RA1 _R4
#define JIT_RA2 _R5
@@ -103,7 +101,6 @@ typedef enum {
* saved/restored (if used) */
_F22, _F23, _F24, _F25, _F26, _F27, _F28, _F29,
_F30, _F31,
-#define JIT_FRET _F1
#define JIT_FA0 _F1
#define JIT_FA1 _F2
#define JIT_FA2 _F3
diff --git a/include/lightning/jit_private.h b/include/lightning/jit_private.h
index 5efeee8..854e325 100644
--- a/include/lightning/jit_private.h
+++ b/include/lightning/jit_private.h
@@ -42,6 +42,32 @@
# define HIDDEN /**/
#endif
+#if defined(__i386__) || defined(__x86_64__)
+# define JIT_SP _RSP
+# define JIT_RET _RAX
+# if __WORDSIZE == 32
+# define JIT_FRET _ST0
+# else
+# define JIT_FRET _XMM0
+# endif
+#elif defined(__mips__)
+# define JIT_SP _SP
+# define JIT_RET _V0
+# define JIT_FRET _F0
+#elif defined(__arm__)
+# define JIT_SP _R13
+# define JIT_RET _R0
+# if defined(__ARM_PCS_VFP)
+# define JIT_FRET _D0
+# else
+# define JIT_FRET _R0
+# endif
+#elif defined(__ppc__)
+# define JIT_SP _R1
+# define JIT_RET _R3
+# define JIT_FRET _F1
+#endif
+
#define jit_size(vector) (sizeof(vector) / sizeof((vector)[0]))
#define jit_reg_free_p(regno) \
diff --git a/include/lightning/jit_x86.h b/include/lightning/jit_x86.h
index 003a28d..1cd3137 100644
--- a/include/lightning/jit_x86.h
+++ b/include/lightning/jit_x86.h
@@ -27,8 +27,6 @@
#define jit_sse2_p() jit_cpu.sse2
#define jit_x87_reg_p(reg) ((reg) >= _ST0 && (reg) <= _ST7)
-#define JIT_RET _RAX
-#define JIT_SP _RSP
#define JIT_FP _RBP
typedef enum {
#if __WORDSIZE == 32
@@ -40,7 +38,6 @@ typedef enum {
# define jit_arg_f_reg_p(i) 0
# define jit_f(i) (jit_cpu.sse2 ? _XMM0 + (i) : _ST0 + (i))
# define jit_f_num() (jit_cpu.sse2 ? 8 : 6)
-# define JIT_FRET _ST0
# define JIT_R0 _RAX
# define JIT_R1 _RCX
# define JIT_R2 _RDX
@@ -69,7 +66,6 @@ typedef enum {
# define jit_arg_f_reg_p(i) ((i) >= 0 && (i) < 8)
# define jit_f(index) (_XMM0 + (index))
# define jit_f_num() 8
-# define JIT_FRET _XMM0
# define JIT_R0 _RAX
# define JIT_R1 _R10
# define JIT_R2 _R11
- [Guile-commits] 235/437: Correct build on FreeBSD/amd64, (continued)
- [Guile-commits] 235/437: Correct build on FreeBSD/amd64, Andy Wingo, 2018/07/02
- [Guile-commits] 240/437: Correct wrong test and update of arm thumb offset information., Andy Wingo, 2018/07/02
- [Guile-commits] 215/437: Add functional hppa port. All tests pass., Andy Wingo, 2018/07/02
- [Guile-commits] 369/437: Correct typo in x87.nodata test list, Andy Wingo, 2018/07/02
- [Guile-commits] 307/437: x86: Build and pass all tests on 32 bit cygwin, Andy Wingo, 2018/07/02
- [Guile-commits] 401/437: Implement a correct generation of Fibonacci numbers., Andy Wingo, 2018/07/02
- [Guile-commits] 318/437: Add label predicates, Andy Wingo, 2018/07/02
- [Guile-commits] 373/437: Update copyright date, Andy Wingo, 2018/07/02
- [Guile-commits] 403/437: Correct wrong movr simplification, Andy Wingo, 2018/07/02
- [Guile-commits] 324/437: misc: Enable silent rules to make warnings stick out, Andy Wingo, 2018/07/02
- [Guile-commits] 175/437: Make JIT_RET, JIT_FRET and JIT_SP private.,
Andy Wingo <=
- [Guile-commits] 430/437: Remove special cflags for obsolete Lightning targets, Andy Wingo, 2018/07/02
- [Guile-commits] 375/437: Update the correct fp offset and add assertions, Andy Wingo, 2018/07/02
- [Guile-commits] 413/437: Correct logic error with jit_live in jit_retr, Andy Wingo, 2018/07/02
- [Guile-commits] 140/437: Add new test cases to exercise memory load/store., Andy Wingo, 2018/07/02
- [Guile-commits] 267/437: GNU lightning 2.0.2 release, Andy Wingo, 2018/07/02
- [Guile-commits] 275/437: GNU lightning 2.0.3 release, Andy Wingo, 2018/07/02
- [Guile-commits] 338/437: Add missing ellipsis mark to align.tst, Andy Wingo, 2018/07/02
- [Guile-commits] 269/437: ARM: Minor changes that should allow building on non gnu-linux/gcc., Andy Wingo, 2018/07/02
- [Guile-commits] 260/437: Correct source of the self test case and a missed check failure., Andy Wingo, 2018/07/02
- [Guile-commits] 216/437: Prepare for the first alpha release of lightning 2.0., Andy Wingo, 2018/07/02