aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/ia64
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2003-05-14 10:46:50 -0700
committerRichard Henderson <rth@gcc.gnu.org>2003-05-14 10:46:50 -0700
commitae49d6e592571b46ae39832868e53958e94e26b4 (patch)
tree86bec960cb29fc4b16756c0e764fcff10378f2e5 /gcc/config/ia64
parent2adb9af1f88f1454435e8469cbc3c523ab5db42f (diff)
downloadgcc-ae49d6e592571b46ae39832868e53958e94e26b4.zip
gcc-ae49d6e592571b46ae39832868e53958e94e26b4.tar.gz
gcc-ae49d6e592571b46ae39832868e53958e94e26b4.tar.bz2
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
Diffstat (limited to 'gcc/config/ia64')
-rw-r--r--gcc/config/ia64/ia64.c20
-rw-r--r--gcc/config/ia64/ia64.md11
2 files changed, 18 insertions, 13 deletions
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 7a7bcda..b3f25b6 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 8a503ce..93dff97 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"))