summaryrefslogtreecommitdiff
path: root/gcc/config/ia64/ia64.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-14 17:46:50 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-14 17:46:50 +0000
commit22637cc0301fc87915a60c47c0fbf169b6f6f684 (patch)
tree86bec960cb29fc4b16756c0e764fcff10378f2e5 /gcc/config/ia64/ia64.c
parent658782a5da1ca20a66861f31b68600b76ee59cd7 (diff)
downloadgcc-22637cc0301fc87915a60c47c0fbf169b6f6f684.tar.gz
* config/ia64/ia64.c (ia64_expand_load_address): Force destination
to be DImode register. Merge load_symptr. * config/ia64/ia64.md (load_symptr): Remove. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66808 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/ia64/ia64.c')
-rw-r--r--gcc/config/ia64/ia64.c20
1 files changed, 18 insertions, 2 deletions
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;