[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 137/437: Make mips backend compile on a qemu image.
From: |
Andy Wingo |
Subject: |
[Guile-commits] 137/437: Make mips backend compile on a qemu image. |
Date: |
Mon, 2 Jul 2018 05:14:03 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit 01be83d480de4cb1512cb2f3da9b958ad188861f
Author: pcpa <address@hidden>
Date: Tue Dec 4 00:27:44 2012 -0200
Make mips backend compile on a qemu image.
* include/lightning/jit_mips.h, lib/jit_mips.c: Update to
make the mips backend compile in a qemu image.
* lib/jit_ppc.c: Minor adaptations to help in having the
ppc backend compilable.
---
ChangeLog | 8 +++++++
include/lightning/jit_mips.h | 4 ++--
lib/jit_mips.c | 50 +++++++++++++++++++++++++++++++-------------
lib/jit_ppc.c | 30 +++++++++++++-------------
4 files changed, 61 insertions(+), 31 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 87da374..ca08554 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-12-04 Paulo Andrade <address@hidden>
+
+ * include/lightning/jit_mips.h, lib/jit_mips.c: Update to
+ make the mips backend compile in a qemu image.
+
+ * lib/jit_ppc.c: Minor adaptations to help in having the
+ ppc backend compilable.
+
2012-12-03 Paulo Andrade <address@hidden>
* configure.ac, include/lightning/jit_private.h, lib/jit_arm-cpu.c,
diff --git a/include/lightning/jit_mips.h b/include/lightning/jit_mips.h
index cb7235f..5a0043b 100644
--- a/include/lightning/jit_mips.h
+++ b/include/lightning/jit_mips.h
@@ -33,8 +33,8 @@ typedef enum {
#define jit_r(i) (_V0 + (i))
#define jit_r_num() 12
#define jit_v(i) (_S0 + (i))
-#define jit_r_num() 8
-#define jit_arg_reg_p(i) ((i) >= 0 && (i) < 4)
+#define jit_v_num() 8
+#define jit_arg_f_reg_p(i) ((i) >= 0 && (i) < 4)
#define jit_f(i) (_F0 + (i))
#define jit_f_num() 14
_AT,
diff --git a/lib/jit_mips.c b/lib/jit_mips.c
index ffeb291..1fc1c09 100644
--- a/lib/jit_mips.c
+++ b/lib/jit_mips.c
@@ -109,7 +109,7 @@ jit_get_cpu(void)
void
_jit_init(jit_state_t *_jit)
{
- _jit->reglen = esize(_rvs) - 1;
+ _jit->reglen = jit_size(_rvs) - 1;
jit_carry = _NOREG;
}
@@ -248,7 +248,7 @@ _jit_arg(jit_state_t *_jit)
return (offset);
}
-ebool_t
+jit_bool_t
_jit_arg_reg_p(jit_state_t *_jit, jit_int32_t offset)
{
return (offset >= 0 && offset < 4);
@@ -277,7 +277,7 @@ _jit_arg_f(jit_state_t *_jit)
return (offset);
}
-ebool_t
+jit_bool_t
_jit_arg_f_reg_p(jit_state_t *_jit, jit_int32_t offset)
{
return (offset >= 0 && offset < 4);
@@ -306,7 +306,7 @@ _jit_arg_d(jit_state_t *_jit)
return (offset);
}
-ebool_t
+jit_bool_t
_jit_arg_d_reg_p(jit_state_t *_jit, jit_int32_t offset)
{
return (jit_arg_f_reg_p(offset));
@@ -383,6 +383,28 @@ _jit_getarg_l(jit_state_t *_jit, jit_int32_t u,
jit_int32_t v)
#endif
void
+_jit_getarg_f(jit_state_t *_jit, jit_int32_t u, jit_int32_t v)
+{
+ if (v < 4)
+ jit_extr_f(u, _A0 - v);
+ else if (v < 8)
+ jit_movr_f(u, _F12 + ((v - 4) >> 1));
+ else
+ jit_ldxi_f(u, _FP, v);
+}
+
+void
+_jit_getarg_d(jit_state_t *_jit, jit_int32_t u, jit_int32_t v)
+{
+ if (v < 4)
+ jit_extr_d(u, _A0 - v);
+ else if (v < 8)
+ jit_movr_d(u, _F12 + ((v - 4) >> 1));
+ else
+ jit_ldxi_d(u, _FP, v);
+}
+
+void
_jit_pushargr(jit_state_t *_jit, jit_int32_t u)
{
assert(_jit->function);
@@ -429,7 +451,7 @@ _jit_pushargr_f(jit_state_t *_jit, jit_int32_t u)
}
void
-_jit_pushargi_f(jit_state_t *_jit, efloat32_t u)
+_jit_pushargi_f(jit_state_t *_jit, jit_float32_t u)
{
jit_int32_t regno;
@@ -463,7 +485,7 @@ _jit_pushargr_d(jit_state_t *_jit, jit_int32_t u)
}
void
-_jit_pushargi_d(jit_state_t *_jit, efloat64_t u)
+_jit_pushargi_d(jit_state_t *_jit, jit_float64_t u)
{
jit_int32_t regno;
@@ -622,12 +644,12 @@ _jit_emit(jit_state_t *_jit)
_jit->emit = 1;
- _jit->code_length = 16 * 1024 * 1024;
- _jit->code = mmap(NULL, _jit->code_length,
- PROT_EXEC | PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_ANON, -1, 0);
- assert(_jit->code != MAP_FAILED);
- _jit->pc.uc = _jit->code;
+ _jit->code.length = 16 * 1024 * 1024;
+ _jit->code.ptr = mmap(NULL, _jit->code.length,
+ PROT_EXEC | PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANON, -1, 0);
+ assert(_jit->code.ptr != MAP_FAILED);
+ _jit->pc.uc = _jit->code.ptr;
/* clear jit_flag_patch from label nodes if reallocating buffer
* and starting over
@@ -1155,11 +1177,11 @@ _jit_emit(jit_state_t *_jit)
for (offset = 0; offset < _jit->patches.offset; offset++) {
node = _jit->patches.ptr[offset].node;
word = node->code == jit_code_movi ? node->v.n->u.w : node->u.n->u.w;
- patch_at(_jit->patches.ptr[offset].instr, word);
+ patch_at(_jit->patches.ptr[offset].inst, word);
}
#if defined(__linux__)
- _flush_cache((char *)_jit->code, _jit->pc.uc - _jit->code.ptr, ICACHE);
+ _flush_cache((char *)_jit->code.ptr, _jit->pc.uc - _jit->code.ptr, ICACHE);
#endif
return (_jit->code.ptr);
diff --git a/lib/jit_ppc.c b/lib/jit_ppc.c
index 17af6a6..a27a228 100644
--- a/lib/jit_ppc.c
+++ b/lib/jit_ppc.c
@@ -111,7 +111,7 @@ jit_get_cpu(void)
void
_jit_init(jit_state_t *_jit)
{
- _jit->reglen = esize(_rvs) - 1;
+ _jit->reglen = jit_size(_rvs) - 1;
}
void
@@ -245,7 +245,7 @@ _jit_arg(jit_state_t *_jit)
return (offset);
}
-ebool_t
+jit_bool_t
_jit_arg_reg_p(jit_state_t *_jit, jit_int32_t offset)
{
return (offset >= 0 && offset < 8);
@@ -257,7 +257,7 @@ _jit_arg_f(jit_state_t *_jit)
return (jit_arg_d());
}
-ebool_t
+jit_bool_t
_jit_arg_f_reg_p(jit_state_t *_jit, jit_int32_t offset)
{
return (jit_arg_d_reg_p(offset));
@@ -275,7 +275,7 @@ _jit_arg_d(jit_state_t *_jit)
return (offset);
}
-ebool_t
+jit_bool_t
_jit_arg_d_reg_p(jit_state_t *_jit, jit_int32_t offset)
{
return (offset >= 0 && offset < 8);
@@ -400,7 +400,7 @@ _jit_pushargr_f(jit_state_t *_jit, jit_int32_t u)
}
void
-_jit_pushargi_f(jit_state_t *_jit, efloat32_t u)
+_jit_pushargi_f(jit_state_t *_jit, jit_float32_t u)
{
jit_pushargi_d(u);
}
@@ -420,7 +420,7 @@ _jit_pushargr_d(jit_state_t *_jit, jit_int32_t u)
}
void
-_jit_pushargi_d(jit_state_t *_jit, efloat64_t u)
+_jit_pushargi_d(jit_state_t *_jit, jit_float64_t u)
{
jit_int32_t regno;
@@ -569,12 +569,12 @@ _jit_emit(jit_state_t *_jit)
_jit->emit = 1;
- _jit->code_length = 16 * 1024 * 1024;
- _jit->code = mmap(NULL, _jit->code_length,
- PROT_EXEC | PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_ANON, -1, 0);
- assert(_jit->code != MAP_FAILED);
- _jit->pc.uc = _jit->code;
+ _jit->code.length = 16 * 1024 * 1024;
+ _jit->code.ptr = mmap(NULL, _jit->code.length,
+ PROT_EXEC | PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANON, -1, 0);
+ assert(_jit->code.ptr != MAP_FAILED);
+ _jit->pc.uc = _jit->code.ptr;
/* clear jit_flag_patch from label nodes if reallocating buffer
* and starting over
@@ -1030,7 +1030,7 @@ _jit_emit(jit_state_t *_jit)
}
node = undo.node;
_jit->pc.w = undo.word;
- _jit->patches->offset = undo.patch_offset;
+ _jit->patches.offset = undo.patch_offset;
goto restart_function;
}
/* remember label is defined */
@@ -1057,10 +1057,10 @@ _jit_emit(jit_state_t *_jit)
#undef case_rw
#undef case_rr
- for (offset = 0; offset < _jit->patches->offset; offset++) {
+ for (offset = 0; offset < _jit->patches.offset; offset++) {
node = _jit->patches.ptr[offset].node;
word = node->code == jit_code_movi ? node->v.n->u.w : node->u.n->u.w;
- patch_at(_jit->patches.ptr[offset].instr, word);
+ patch_at(_jit->patches.ptr[offset].inst, word);
}
return (_jit->code.ptr);
- [Guile-commits] 208/437: Implement fpr register arguments and minor extra fixes., (continued)
- [Guile-commits] 208/437: Implement fpr register arguments and minor extra fixes., Andy Wingo, 2018/07/02
- [Guile-commits] 211/437: Correct the cvt.tst test case on Itanium., Andy Wingo, 2018/07/02
- [Guile-commits] 187/437: Correct regression with float arguments in arm hardp, Andy Wingo, 2018/07/02
- [Guile-commits] 200/437: Add a simple memory management wrapper., Andy Wingo, 2018/07/02
- [Guile-commits] 196/437: Add missing __ppc__ definition., Andy Wingo, 2018/07/02
- [Guile-commits] 159/437: Correct stack.tst test case on ppc. Now all tests pass in all backends., Andy Wingo, 2018/07/02
- [Guile-commits] 172/437: Rework {get, push}arg{, i, r}_{f, d} to a more descriptive name and usage., Andy Wingo, 2018/07/02
- [Guile-commits] 221/437: Correct build and pass all tests on Solaris Sparc., Andy Wingo, 2018/07/02
- [Guile-commits] 228/437: Properly check tests output., Andy Wingo, 2018/07/02
- [Guile-commits] 186/437: Add code to release all memory used by the jit state., Andy Wingo, 2018/07/02
- [Guile-commits] 137/437: Make mips backend compile on a qemu image.,
Andy Wingo <=
- [Guile-commits] 222/437: Correct build and pass all tests on Solaris x86., Andy Wingo, 2018/07/02
- [Guile-commits] 219/437: Remove redundancy in the hppa cache synchronization code., Andy Wingo, 2018/07/02
- [Guile-commits] 245/437: S390X: Correct values of float registers saved on stack., Andy Wingo, 2018/07/02
- [Guile-commits] 224/437: Correct mips o32 abi that was broken when adding n32 abi support., Andy Wingo, 2018/07/02
- [Guile-commits] 230/437: New s390x port built on the hercules emulator and fedora 16 image., Andy Wingo, 2018/07/02
- [Guile-commits] 234/437: GNU lightning 2.0.0 release, Andy Wingo, 2018/07/02
- [Guile-commits] 256/437: X86: %r12 may be used as an index register., Andy Wingo, 2018/07/02
- [Guile-commits] 229/437: Do not assume cast of nan or inf double to float always work., Andy Wingo, 2018/07/02
- [Guile-commits] 231/437: Cosmetic removal of white spaces in end of lines., Andy Wingo, 2018/07/02
- [Guile-commits] 232/437: Correct off by one bug on s390x subi., Andy Wingo, 2018/07/02