From ae49d6e592571b46ae39832868e53958e94e26b4 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Wed, 14 May 2003 10:46:50 -0700 Subject: [PATCH] ia64.c (ia64_expand_load_address): Force destination to be DImode register. * config/ia64/ia64.c (ia64_expand_load_address): Force destination to be DImode register. Merge load_symptr. * config/ia64/ia64.md (load_symptr): Remove. From-SVN: r66808 --- gcc/ChangeLog | 6 ++++++ gcc/config/ia64/ia64.c | 20 ++++++++++++++++++-- gcc/config/ia64/ia64.md | 11 ----------- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0d42be6c71d..d41138f548c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2003-05-14 Richard Henderson + + * config/ia64/ia64.c (ia64_expand_load_address): Force destination + to be DImode register. Merge load_symptr. + * config/ia64/ia64.md (load_symptr): Remove. + 2003-05-14 Richard Henderson * rtl.h (TREE_CONSTANT_POOL_ADDRESS_P): Rename from diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 7a7bcda235e..b3f25b60349 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -1099,6 +1099,13 @@ ia64_expand_load_address (dest, src) if (GET_CODE (dest) != REG) abort (); + /* ILP32 mode still loads 64-bits of data from the GOT. This avoids + having to pointer-extend the value afterward. Other forms of address + computation below are also more natural to compute as 64-bit quantities. + If we've been given an SImode destination register, change it. */ + if (GET_MODE (dest) != Pmode) + dest = gen_rtx_REG (Pmode, REGNO (dest)); + if (TARGET_AUTO_PIC) { emit_insn (gen_load_gprel64 (dest, src)); @@ -1129,11 +1136,20 @@ ia64_expand_load_address (dest, src) lo = ((ofs & 0x3fff) ^ 0x2000) - 0x2000; hi = ofs - lo; - emit_insn (gen_load_symptr (dest, plus_constant (sym, hi), dest)); + ia64_expand_load_address (dest, plus_constant (sym, hi)); emit_insn (gen_adddi3 (dest, dest, GEN_INT (lo))); } else - emit_insn (gen_load_symptr (dest, src, dest)); + { + rtx tmp; + + tmp = gen_rtx_HIGH (Pmode, src); + tmp = gen_rtx_PLUS (Pmode, tmp, pic_offset_table_rtx); + emit_insn (gen_rtx_SET (VOIDmode, dest, tmp)); + + tmp = gen_rtx_LO_SUM (GET_MODE (dest), dest, src); + emit_insn (gen_rtx_SET (VOIDmode, dest, tmp)); + } } static GTY(()) rtx gen_tls_tga; diff --git a/gcc/config/ia64/ia64.md b/gcc/config/ia64/ia64.md index 8a503cea539..93dff972a74 100644 --- a/gcc/config/ia64/ia64.md +++ b/gcc/config/ia64/ia64.md @@ -410,17 +410,6 @@ operands[3] = pic_offset_table_rtx; }) -(define_expand "load_symptr" - [(set (match_operand:DI 2 "register_operand" "") - (plus:DI (high:DI (match_operand:DI 1 "got_symbolic_operand" "")) - (match_dup 3))) - (set (match_operand:DI 0 "register_operand" "") - (lo_sum:DI (match_dup 2) (match_dup 1)))] - "" -{ - operands[3] = pic_offset_table_rtx; -}) - (define_insn "*load_symptr_high" [(set (match_operand:DI 0 "register_operand" "=r") (plus:DI (high:DI (match_operand 1 "got_symbolic_operand" "s"))