1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-19 18:20:22 +02:00

prepare for automatic variables support

2006-10-31  Paolo Bonzini  <bonzini@gnu.org>

	* doc/porting.texi: Rename JIT_FP to JIT_AP.
	* lightning/core-common.h: Likewise.
	* lightning/i386/core-i386.h: Likewise.
	* lightning/fp-common.h: Provide default versions of jit_getarg_[fd].
	* lightning/i386/fp-32.h: Don't provide jit_getarg_[fd].
	* lightning/ppc/fp.h: Likewise.

git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-33
This commit is contained in:
Paolo Bonzini 2006-10-31 14:58:03 +00:00
parent e2cb4af6aa
commit e70005878a
8 changed files with 54 additions and 22 deletions

View file

@ -1,3 +1,19 @@
2006-10-31 Paolo Bonzini <bonzini@gnu.org>
* doc/porting.texi: Rename JIT_FP to JIT_AP.
* lightning/core-common.h: Likewise.
* lightning/i386/core-i386.h: Likewise.
* lightning/fp-common.h: Provide default versions of jit_getarg_[fd].
* lightning/i386/fp-32.h: Don't provide jit_getarg_[fd].
* lightning/ppc/fp.h: Likewise.
2006-10-31 Ludovic Courtes <ludo@chbouib.org>
* doc/using.texi (The instruction set): Clarified the use of `JIT_RET' and
documented `jit_retval'.
* tests/ret.c (generate_function_proxy): After `jit_finish', use
`jit_retval_i' to move FUNC's return value into the correct register.
2006-10-31 Paolo Bonzini <bonzini@gnu.org>
Ludovic Courtes <ludo@chbouib.org>

13
NEWS
View file

@ -1,6 +1,15 @@
NEWS FROM VERSION 1.2 TO 1.2a
NEWS FROM VERSION 1.2 TO 1.3
This is a bug fix release with no visible changes.
o Initial support for x86-64 back-end.
[a promise for now, code is there but is untested!]
o Many bug fixes.
o Support for stack-allocated variables. Because of this,
backends defining JIT_FP should now rename it to JIT_AP.
JIT_FP is now a user-visible register used in ldxi/ldxr
to access stack-allocated variables.
[a promise for now, not yet implemented!]
---

View file

@ -833,16 +833,16 @@ to employ them automatically. If you do not define the
presume that you intend to pass parameters through either the registers
or the stack.
If you define @code{JIT_FP}, stack-based parameter passing will be
If you define @code{JIT_AP}, stack-based parameter passing will be
employed and the @code{jit_getarg} macros will be defined like this:
@example
#define jit_getarg_c(reg, ofs) jit_ldxi_c((reg), JIT_FP, (ofs));
#define jit_getarg_c(reg, ofs) jit_ldxi_c((reg), JIT_AP, (ofs));
@end example
In other words, the @code{jit_arg} macros (which are still to be defined
by the platform-specific back-end) shall return an offset into the stack
frame. On the other hand, if you don't define @code{JIT_FP},
frame. On the other hand, if you don't define @code{JIT_AP},
register-based parameter passing will be employed and the @code{jit_arg}
macros shall return a register number; in this case, @code{jit_getarg}
will be implemented in terms of @code{jit_extr} and @code{jit_movr}
@ -867,7 +867,7 @@ operations:
#define JIT_FPR
#define JIT_FPR_NUM
#define JIT_SP
#define JIT_FP
#define JIT_AP
#define JIT_RZERO
@end example

View file

@ -449,7 +449,7 @@ typedef union jit_code {
#endif
#ifndef jit_getarg_c
#ifndef JIT_FP
#ifndef JIT_AP
#define jit_getarg_c(reg, ofs) jit_extr_c_i ((reg), (ofs))
#define jit_getarg_i(reg, ofs) jit_movr_i ((reg), (ofs))
#define jit_getarg_l(reg, ofs) jit_movr_l ((reg), (ofs))
@ -460,15 +460,15 @@ typedef union jit_code {
#define jit_getarg_ul(reg, ofs) jit_extr_uc_ul((reg), (ofs))
#define jit_getarg_us(reg, ofs) jit_extr_us_ul((reg), (ofs))
#else
#define jit_getarg_c(reg, ofs) jit_ldxi_c((reg), JIT_FP, (ofs));
#define jit_getarg_uc(reg, ofs) jit_ldxi_uc((reg), JIT_FP, (ofs));
#define jit_getarg_s(reg, ofs) jit_ldxi_s((reg), JIT_FP, (ofs));
#define jit_getarg_us(reg, ofs) jit_ldxi_us((reg), JIT_FP, (ofs));
#define jit_getarg_i(reg, ofs) jit_ldxi_i((reg), JIT_FP, (ofs));
#define jit_getarg_ui(reg, ofs) jit_ldxi_ui((reg), JIT_FP, (ofs));
#define jit_getarg_l(reg, ofs) jit_ldxi_l((reg), JIT_FP, (ofs));
#define jit_getarg_ul(reg, ofs) jit_ldxi_ul((reg), JIT_FP, (ofs));
#define jit_getarg_p(reg, ofs) jit_ldxi_p((reg), JIT_FP, (ofs));
#define jit_getarg_c(reg, ofs) jit_ldxi_c((reg), JIT_AP, (ofs));
#define jit_getarg_uc(reg, ofs) jit_ldxi_uc((reg), JIT_AP, (ofs));
#define jit_getarg_s(reg, ofs) jit_ldxi_s((reg), JIT_AP, (ofs));
#define jit_getarg_us(reg, ofs) jit_ldxi_us((reg), JIT_AP, (ofs));
#define jit_getarg_i(reg, ofs) jit_ldxi_i((reg), JIT_AP, (ofs));
#define jit_getarg_ui(reg, ofs) jit_ldxi_ui((reg), JIT_AP, (ofs));
#define jit_getarg_l(reg, ofs) jit_ldxi_l((reg), JIT_AP, (ofs));
#define jit_getarg_ul(reg, ofs) jit_ldxi_ul((reg), JIT_AP, (ofs));
#define jit_getarg_p(reg, ofs) jit_ldxi_p((reg), JIT_AP, (ofs));
#endif
#endif

View file

@ -84,3 +84,15 @@
#define jit_unordr_f(d, s1, s2) jit_unordr_d(d, s1, s2)
#define jit_retval_f(rs) jit_retval_d(rs)
#endif
#ifndef jit_getarg_f
#ifndef JIT_AP
#define jit_getarg_f(reg, ofs) jit_movr_f ((reg), (ofs))
#define jit_getarg_d(reg, ofs) jit_movr_d ((reg), (ofs))
#else
#define jit_getarg_f(reg, ofs) jit_ldxi_f((reg), JIT_AP, (ofs));
#define jit_getarg_d(reg, ofs) jit_ldxi_d((reg), JIT_AP, (ofs));
#endif
#endif

View file

@ -34,7 +34,7 @@
#ifndef __lightning_core_i386_h
#define __lightning_core_i386_h
#define JIT_FP _EBP
#define JIT_AP _EBP
#define JIT_SP _ESP
#define JIT_RET _EAX

View file

@ -314,8 +314,6 @@ union jit_double_imm {
#define jit_bordr_d(d, s1, s2) jit_fp_btest((d), (s1), (s2), 11, 0, 0, JNCm)
#define jit_bunordr_d(d, s1, s2) jit_fp_btest((d), (s1), (s2), 11, 0, 0, JCm)
#define jit_getarg_f(rd, ofs) jit_ldxi_f((rd), JIT_FP,(ofs))
#define jit_getarg_d(rd, ofs) jit_ldxi_d((rd), JIT_FP,(ofs))
#define jit_pusharg_d(rs) (jit_subi_i(JIT_SP,JIT_SP,sizeof(double)), jit_str_d(JIT_SP,(rs)))
#define jit_pusharg_f(rs) (jit_subi_i(JIT_SP,JIT_SP,sizeof(float)), jit_str_f(JIT_SP,(rs)))
#define jit_retval_d(op1) jit_movr_d(0, (op1))

View file

@ -39,7 +39,6 @@
#define JIT_FPR_NUM 6
#define JIT_FPR(i) (8+(i))
#define JIT_FPFR 0
/* Make space for 1 or 2 words, store address in REG */
#define jit_data(REG, D1) (_FBA (18, 8, 0, 1), _jit_L(D1), MFLRr(REG))
@ -177,8 +176,6 @@
#define jit_bltgtr_d(d, s1, s2) jit_fpbur_or ((d), (s1), (s2), _gt, _lt)
#define jit_buneqr_d(d, s1, s2) jit_fpbur_or ((d), (s1), (s2), _un, _eq)
#define jit_getarg_f(rd, ofs) jit_movr_f((rd),(ofs))
#define jit_getarg_d(rd, ofs) jit_movr_d((rd),(ofs))
#define jit_pusharg_d(rs) (_jitl.nextarg_putd--,jit_movr_d((_jitl.nextarg_putf+_jitl.nextarg_putd+1), (rs)))
#define jit_pusharg_f(rs) (_jitl.nextarg_putf--,jit_movr_f((_jitl.nextarg_putf+_jitl.nextarg_putd+1), (rs)))
#define jit_retval_d(op1) jit_movr_d(1, (op1))