From 42aeaad87f9bcb2f5487b40f893daf6772ce2a54 Mon Sep 17 00:00:00 2001 From: dje Date: Tue, 15 May 2001 19:27:13 +0000 Subject: [PATCH] * rs6000.md (movdi splitter): Sign extend more efficiently. * rs6000.c (reg_or_arith_cint_operand): Redefine 64-bit constant to "long long" valid on 32-bit and 64-bit hosts. (logical_operand): Cast trunc_int_for_mode rturn value. (rs6000_emit_move): Shift macro to encapsulate variable. (rs6000_va_start): Use HOST_WIDE_INT_PRINT_DEC. (rs6000_emit_{prologue,epilogue}): EH regno is unsigned but plus_constant requires signed argument. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42111 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 11 +++++++++++ gcc/config/rs6000/rs6000.c | 29 ++++++++++++++++++++--------- gcc/config/rs6000/rs6000.md | 2 +- 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 87b5c62..39f6c3d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2001-05-15 David Edelsohn + + * rs6000.md (movdi splitter): Sign extend more efficiently. + * rs6000.c (reg_or_arith_cint_operand): Redefine 64-bit constant + to "long long" valid on 32-bit and 64-bit hosts. + (logical_operand): Cast trunc_int_for_mode rturn value. + (rs6000_emit_move): Shift macro to encapsulate variable. + (rs6000_va_start): Use HOST_WIDE_INT_PRINT_DEC. + (rs6000_emit_{prologue,epilogue}): EH regno is unsigned but + plus_constant requires signed argument. + 2001-05-15 Loren J. Rittle * gthr-posix.h: Make additional pthread-* functions weak. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index a2b6b94..8d2a799 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -674,7 +674,7 @@ reg_or_arith_cint_operand (op, mode) || (GET_CODE (op) == CONST_INT #if HOST_BITS_PER_WIDE_INT != 32 && ((unsigned HOST_WIDE_INT) (INTVAL (op) + 0x80000000) - < 0x100000000u) + < (unsigned HOST_WIDE_INT) 0x100000000ll) #endif )); } @@ -1023,7 +1023,7 @@ logical_operand (op, mode) return 0; /* This must really be SImode, not MODE. */ - if (opl != trunc_int_for_mode (opl, SImode)) + if (opl != (unsigned HOST_WIDE_INT) trunc_int_for_mode (opl, SImode)) return 0; return ((opl & 0xffff) == 0 @@ -1795,10 +1795,10 @@ rs6000_emit_move (dest, source, mode) /* Darwin uses a special PIC legitimizer. */ if (DEFAULT_ABI == ABI_DARWIN && flag_pic) { +#if TARGET_MACHO rtx temp_reg = ((reload_in_progress || reload_completed) ? operands[0] : NULL); -#if TARGET_MACHO operands[1] = rs6000_machopic_legitimize_pic_address (operands[1], mode, temp_reg); @@ -2451,8 +2451,15 @@ rs6000_va_start (stdarg_p, valist, nextarg) n_fpr = current_function_args_info.fregno - FP_ARG_MIN_REG; if (TARGET_DEBUG_ARG) - fprintf (stderr, "va_start: words = %d, n_gpr = %d, n_fpr = %d\n", - words, n_gpr, n_fpr); + { + fputs ("va_start: words = ", stderr); + fprintf (stderr, HOST_WIDE_INT_PRINT_DEC, words); + fputs (", n_gpr = ", stderr); + fprintf (stderr, HOST_WIDE_INT_PRINT_DEC, n_gpr); + fputs (", n_fpr = ", stderr); + fprintf (stderr, HOST_WIDE_INT_PRINT_DEC, n_fpr); + putc ('\n', stderr); + } t = build (MODIFY_EXPR, TREE_TYPE (gpr), gpr, build_int_2 (n_gpr, 0)); TREE_SIDE_EFFECTS (t) = 1; @@ -5866,7 +5873,8 @@ rs6000_emit_prologue () easiest way to get the frame unwind information emitted. */ if (current_function_calls_eh_return) { - int i, regno; + unsigned int i, regno; + for (i = 0; ; ++i) { rtx addr, reg, mem; @@ -5877,7 +5885,8 @@ rs6000_emit_prologue () reg = gen_rtx_REG (reg_mode, regno); addr = plus_constant (frame_reg_rtx, - info->ehrd_offset + sp_offset + reg_size * i); + info->ehrd_offset + sp_offset + + reg_size * (int) i); mem = gen_rtx_MEM (reg_mode, addr); MEM_ALIAS_SET (mem) = rs6000_sr_alias_set; @@ -6123,7 +6132,8 @@ rs6000_emit_epilogue (sibcall) /* Load exception handler data registers, if needed. */ if (current_function_calls_eh_return) { - int i, regno; + unsigned int i, regno; + for (i = 0; ; ++i) { rtx addr, mem; @@ -6133,7 +6143,8 @@ rs6000_emit_epilogue (sibcall) break; addr = plus_constant (frame_reg_rtx, - info->ehrd_offset + sp_offset + reg_size * i); + info->ehrd_offset + sp_offset + + reg_size * (int) i); mem = gen_rtx_MEM (reg_mode, addr); MEM_ALIAS_SET (mem) = rs6000_sr_alias_set; diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 549f77b..28ebfb4 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -8132,7 +8132,7 @@ " { #if HOST_BITS_PER_WIDE_INT != 32 - operands[2] = GEN_INT ((INTVAL (operands[1]) << 32) >> 32); + operands[2] = GEN_INT ((INTVAL (operands[1]) ^ 0x80000000) - 0x80000000); #endif operands[3] = gen_lowpart_common (SImode, operands[0]); }") -- 2.7.4