diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2001-10-08 21:55:05 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2001-10-08 21:55:05 +0000 |
commit | e052f1a966427305f58c5c580b94e1e5a012bb51 (patch) | |
tree | 171d5a0438ed08588a5ac088e6771b51b6e3cef9 /gcc/config | |
parent | da905677f1192d67ba9ec28235674ab91437cbbf (diff) | |
download | gcc-e052f1a966427305f58c5c580b94e1e5a012bb51.zip gcc-e052f1a966427305f58c5c580b94e1e5a012bb51.tar.gz gcc-e052f1a966427305f58c5c580b94e1e5a012bb51.tar.bz2 |
romp-protos.h (romp_initialize_trampoline): New function.
* romp-protos.h (romp_initialize_trampoline): New function.
* romp.c (romp_initialize_trampoline): Likewise.
* romp.h (INITIALIZE_TRAMPOLINE): Define in terms of
romp_initialize_trampoline.
From-SVN: r46104
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/romp/romp-protos.h | 1 | ||||
-rw-r--r-- | gcc/config/romp/romp.c | 25 | ||||
-rw-r--r-- | gcc/config/romp/romp.h | 32 |
3 files changed, 27 insertions, 31 deletions
diff --git a/gcc/config/romp/romp-protos.h b/gcc/config/romp/romp-protos.h index fcf2439..8ec306f 100644 --- a/gcc/config/romp/romp-protos.h +++ b/gcc/config/romp/romp-protos.h @@ -47,6 +47,7 @@ extern int reg_15_operand PARAMS ((rtx, enum machine_mode)); extern int float_binary PARAMS ((rtx, enum machine_mode)); extern int float_unary PARAMS ((rtx, enum machine_mode)); extern int float_conversion PARAMS ((rtx, enum machine_mode)); +extern void romp_initialize_trampoline PARAMS ((rtx, rtx, rtx)); #endif /* RTX_CODE */ extern int first_reg_to_save PARAMS ((void)); diff --git a/gcc/config/romp/romp.c b/gcc/config/romp/romp.c index 6cdb77e..2d9f977 100644 --- a/gcc/config/romp/romp.c +++ b/gcc/config/romp/romp.c @@ -2046,3 +2046,28 @@ romp_debugger_arg_correction (offset) return (offset - fp_to_argp); } + +void +romp_initialize_trampoline (tramp, fnaddr, cxt) + rtx tramp, fnaddr, cxt; +{ + rtx addr, temp, val; + + temp = expand_simple_binop (SImode, PLUS, tramp, GEN_INT (4), + 0, 1, OPTAB_LIB_WIDEN); + emit_move_insn (gen_rtx_MEM (SImode, memory_address (SImode, tramp)), temp); + + val = force_reg (SImode, cxt); + addr = memory_address (HImode, plus_constant (tramp, 10)); + emit_move_insn (gen_rtx_MEM (HImode, addr), gen_lowpart (HImode, val)); + temp = expand_shift (RSHIFT_EXPR, SImode, val, build_int_2 (16, 0), 0, 1); + addr = memory_address (HImode, plus_constant (tramp, 6)); + emit_move_insn (gen_rtx_MEM (HImode, addr), gen_lowpart (HImode, temp)); + + val = force_reg (SImode, fnaddr); + addr = memory_address (HImode, plus_constant (tramp, 24)); + emit_move_insn (gen_rtx_MEM (HImode, addr), gen_lowpart (HImode, val)); + temp = expand_shift (RSHIFT_EXPR, SImode, val, build_int_2 (16, 0), 0, 1); + addr = memory_address (HImode, plus_constant (tramp, 20)); + emit_move_insn (gen_rtx_MEM (HImode, addr), gen_lowpart (HImode, temp)); +} diff --git a/gcc/config/romp/romp.h b/gcc/config/romp/romp.h index 2e517a1..d1d3174 100644 --- a/gcc/config/romp/romp.h +++ b/gcc/config/romp/romp.h @@ -785,37 +785,7 @@ struct rt_cargs {int gregs, fregs; }; data area. */ #define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, CXT) \ -{ \ - rtx _addr, _temp; \ - rtx _val; \ - \ - _temp = expand_binop (SImode, add_optab, ADDR, \ - GEN_INT (4), \ - 0, 1, OPTAB_LIB_WIDEN); \ - emit_move_insn (gen_rtx_MEM (SImode, \ - memory_address (SImode, ADDR)), _temp); \ - \ - _val = force_reg (SImode, CXT); \ - _addr = memory_address (HImode, plus_constant (ADDR, 10)); \ - emit_move_insn (gen_rtx_MEM (HImode, _addr), \ - gen_lowpart (HImode, _val)); \ - _temp = expand_shift (RSHIFT_EXPR, SImode, _val, \ - build_int_2 (16, 0), 0, 1); \ - _addr = memory_address (HImode, plus_constant (ADDR, 6)); \ - emit_move_insn (gen_rtx_MEM (HImode, _addr), \ - gen_lowpart (HImode, _temp)); \ - \ - _val = force_reg (SImode, FNADDR); \ - _addr = memory_address (HImode, plus_constant (ADDR, 24)); \ - emit_move_insn (gen_rtx_MEM (HImode, _addr), \ - gen_lowpart (HImode, _val)); \ - _temp = expand_shift (RSHIFT_EXPR, SImode, _val, \ - build_int_2 (16, 0), 0, 1); \ - _addr = memory_address (HImode, plus_constant (ADDR, 20)); \ - emit_move_insn (gen_rtx_MEM (HImode, _addr), \ - gen_lowpart (HImode, _temp)); \ - \ -} + romp_initialize_trampoline (ADDR, FNADDR, CXT) /* Definitions for register eliminations. |