From e70005878abc4571d14adfb7f9d51c4c9260940b Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 31 Oct 2006 14:58:03 +0000 Subject: [PATCH] prepare for automatic variables support 2006-10-31 Paolo Bonzini * 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 --- ChangeLog | 16 ++++++++++++++++ NEWS | 13 +++++++++++-- doc/porting.texi | 8 ++++---- lightning/core-common.h | 20 ++++++++++---------- lightning/fp-common.h | 12 ++++++++++++ lightning/i386/core-i386.h | 2 +- lightning/i386/fp-32.h | 2 -- lightning/ppc/fp.h | 3 --- 8 files changed, 54 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2633f387e..a6288c1db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2006-10-31 Paolo Bonzini + + * 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 + + * 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 Ludovic Courtes diff --git a/NEWS b/NEWS index cfa4ad800..ac0e383bc 100644 --- a/NEWS +++ b/NEWS @@ -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!] --- diff --git a/doc/porting.texi b/doc/porting.texi index 9f68d86e9..4608587ee 100644 --- a/doc/porting.texi +++ b/doc/porting.texi @@ -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 diff --git a/lightning/core-common.h b/lightning/core-common.h index 5ff4d7631..d9edaabd8 100644 --- a/lightning/core-common.h +++ b/lightning/core-common.h @@ -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 diff --git a/lightning/fp-common.h b/lightning/fp-common.h index dddbdc70b..8258cfe09 100644 --- a/lightning/fp-common.h +++ b/lightning/fp-common.h @@ -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 + diff --git a/lightning/i386/core-i386.h b/lightning/i386/core-i386.h index 2540b8431..234546772 100644 --- a/lightning/i386/core-i386.h +++ b/lightning/i386/core-i386.h @@ -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 diff --git a/lightning/i386/fp-32.h b/lightning/i386/fp-32.h index 8e65a871e..dda7396d5 100644 --- a/lightning/i386/fp-32.h +++ b/lightning/i386/fp-32.h @@ -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)) diff --git a/lightning/ppc/fp.h b/lightning/ppc/fp.h index 6710c846e..07327d76d 100644 --- a/lightning/ppc/fp.h +++ b/lightning/ppc/fp.h @@ -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))