aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-08-22 17:58:05 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-08-22 17:58:05 +0000
commit36c216e5d0fc6780aa2a5390d252ffade976d21a (patch)
tree030aae9cb1eb3899bb3f6fdb73eaf4622b55b42d
parent078cfb668e34f7cf6d23f5b26eab1d756bef4ad9 (diff)
downloadgcc-36c216e5d0fc6780aa2a5390d252ffade976d21a.zip
gcc-36c216e5d0fc6780aa2a5390d252ffade976d21a.tar.gz
gcc-36c216e5d0fc6780aa2a5390d252ffade976d21a.tar.bz2
ia64.md (*ptr_extend_plus_1): Rename to ...
* config/ia64/ia64.md (*ptr_extend_plus_1): Rename to ... (ptr_extend_plus_imm): ... this. * config/ia64/ia64.c (addp4_optimize_ok): Do not disable addp4 optimization in C++. (ia64_output_mi_thunk): Support ILP32 mode. From-SVN: r70692
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/ia64/ia64.c55
-rw-r--r--gcc/config/ia64/ia64.md2
3 files changed, 50 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 113b98b..8b238d0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2003-08-22 Mark Mitchell <mark@codesourcery.com>
+
+ * config/ia64/ia64.md (*ptr_extend_plus_1): Rename to ...
+ (ptr_extend_plus_imm): ... this.
+ * config/ia64/ia64.c (addp4_optimize_ok): Do not disable addp4
+ optimization in C++.
+ (ia64_output_mi_thunk): Support ILP32 mode.
+
2003-08-22 bernardo innocenti <bernie@develer.com>
* gcc/config/m68k/m68k.c (m68k_coff_asm_named_section): remove unused
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index efed0b1..816f089 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -1106,16 +1106,9 @@ ia64_move_ok (rtx dst, rtx src)
return GET_CODE (src) == CONST_DOUBLE && CONST_DOUBLE_OK_FOR_G (src);
}
-/* Return 0 if we are doing C++ code. This optimization fails with
- C++ because of GNAT c++/6685. */
-
int
addp4_optimize_ok (rtx op1, rtx op2)
{
-
- if (!strcmp (lang_hooks.name, "GNU C++"))
- return 0;
-
return (basereg_operand (op1, GET_MODE(op1)) !=
basereg_operand (op2, GET_MODE(op2)));
}
@@ -8360,6 +8353,18 @@ ia64_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
emit_note (NOTE_INSN_PROLOGUE_END);
this = gen_rtx_REG (Pmode, IN_REG (0));
+ if (TARGET_ILP32)
+ {
+ rtx tmp = gen_rtx_REG (ptr_mode, IN_REG (0));
+ REG_POINTER (tmp) = 1;
+ if (delta && CONST_OK_FOR_I (delta))
+ {
+ emit_insn (gen_ptr_extend_plus_imm (this, tmp, GEN_INT (delta)));
+ delta = 0;
+ }
+ else
+ emit_insn (gen_ptr_extend (this, tmp));
+ }
/* Apply the constant offset, if required. */
if (delta)
@@ -8381,17 +8386,39 @@ ia64_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
rtx vcall_offset_rtx = GEN_INT (vcall_offset);
rtx tmp = gen_rtx_REG (Pmode, 2);
- emit_move_insn (tmp, gen_rtx_MEM (Pmode, this));
+ if (TARGET_ILP32)
+ {
+ rtx t = gen_rtx_REG (ptr_mode, 2);
+ REG_POINTER (t) = 1;
+ emit_move_insn (t, gen_rtx_MEM (ptr_mode, this));
+ if (CONST_OK_FOR_I (vcall_offset))
+ {
+ emit_insn (gen_ptr_extend_plus_imm (tmp, t,
+ vcall_offset_rtx));
+ vcall_offset = 0;
+ }
+ else
+ emit_insn (gen_ptr_extend (tmp, t));
+ }
+ else
+ emit_move_insn (tmp, gen_rtx_MEM (Pmode, this));
- if (!CONST_OK_FOR_J (vcall_offset))
+ if (vcall_offset)
{
- rtx tmp2 = gen_rtx_REG (Pmode, next_scratch_gr_reg ());
- emit_move_insn (tmp2, vcall_offset_rtx);
- vcall_offset_rtx = tmp2;
+ if (!CONST_OK_FOR_J (vcall_offset))
+ {
+ rtx tmp2 = gen_rtx_REG (Pmode, next_scratch_gr_reg ());
+ emit_move_insn (tmp2, vcall_offset_rtx);
+ vcall_offset_rtx = tmp2;
+ }
+ emit_insn (gen_adddi3 (tmp, tmp, vcall_offset_rtx));
}
- emit_insn (gen_adddi3 (tmp, tmp, vcall_offset_rtx));
- emit_move_insn (tmp, gen_rtx_MEM (Pmode, tmp));
+ if (TARGET_ILP32)
+ emit_move_insn (gen_rtx_REG (ptr_mode, 2),
+ gen_rtx_MEM (ptr_mode, tmp));
+ else
+ emit_move_insn (tmp, gen_rtx_MEM (Pmode, tmp));
emit_insn (gen_adddi3 (this, this, tmp));
}
diff --git a/gcc/config/ia64/ia64.md b/gcc/config/ia64/ia64.md
index 0d0999f..9ead086 100644
--- a/gcc/config/ia64/ia64.md
+++ b/gcc/config/ia64/ia64.md
@@ -5472,7 +5472,7 @@
;;
;; Optimizations for ptr_extend
-(define_insn "*ptr_extend_plus_1"
+(define_insn "ptr_extend_plus_imm"
[(set (match_operand:DI 0 "gr_register_operand" "=r")
(unspec:DI
[(plus:SI (match_operand:SI 1 "basereg_operand" "r")