From adb18b686c183763d2364dff91e5f2c987ee1b91 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Wed, 27 Dec 1995 15:28:55 -0500 Subject: ({non,}aligned_memory_operand): Test REGNO_POINTER_ALIGN. (reg_or_unaligned_mem_operand): New function. (get_unaligned_address): Add new arg, EXTRA_OFFSET. From-SVN: r10880 --- gcc/config/alpha/alpha.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'gcc') diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index d460e8b..ba505dc 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -459,10 +459,7 @@ aligned_memory_operand (op, mode) op = XEXP (op, 0); return (GET_CODE (op) == REG - && (REGNO (op) == STACK_POINTER_REGNUM - || op == hard_frame_pointer_rtx - || (REGNO (op) >= FIRST_VIRTUAL_REGISTER - && REGNO (op) <= LAST_VIRTUAL_REGISTER))); + && REGNO_POINTER_ALIGN (REGNO (op)) >= 4); } /* Similar, but return 1 if OP is a MEM which is not alignable. */ @@ -496,10 +493,17 @@ unaligned_memory_operand (op, mode) op = XEXP (op, 0); return (GET_CODE (op) != REG - || (REGNO (op) != STACK_POINTER_REGNUM - && op != hard_frame_pointer_rtx - && (REGNO (op) < FIRST_VIRTUAL_REGISTER - || REGNO (op) > LAST_VIRTUAL_REGISTER))); + || REGNO_POINTER_ALIGN (REGNO (op)) < 4); +} + +/* Return 1 if OP is either a register or an unaligned memory location. */ + +int +reg_or_unaligned_mem_operand (op, mode) + rtx op; + enum machine_mode mode; +{ + return register_operand (op, mode) || unaligned_memory_operand (op, mode); } /* Return 1 if OP is any memory location. During reload a pseudo matches. */ @@ -560,11 +564,13 @@ get_aligned_mem (ref, paligned_mem, pbitnum) *pbitnum = GEN_INT ((offset & 3) * 8); } -/* Similar, but just get the address. Handle the two reload cases. */ +/* Similar, but just get the address. Handle the two reload cases. + Add EXTRA_OFFSET to the address we return. */ rtx -get_unaligned_address (ref) +get_unaligned_address (ref, extra_offset) rtx ref; + int extra_offset; { rtx base; HOST_WIDE_INT offset = 0; @@ -590,7 +596,7 @@ get_unaligned_address (ref) if (GET_CODE (base) == PLUS) offset += INTVAL (XEXP (base, 1)), base = XEXP (base, 0); - return plus_constant (base, offset); + return plus_constant (base, offset + extra_offset); } /* Subfunction of the following function. Update the flags of any MEM -- cgit v1.1