From aaf166234fff42ba7aa5af8f3b1151e01d8b806f Mon Sep 17 00:00:00 2001 From: daney Date: Sat, 8 Dec 2007 19:57:40 +0000 Subject: [PATCH] 2007-12-08 David Daney * src/mips/n32.S (ffi_call_N32): Replace dadd with ADDU, dsub with SUBU, add with ADDU and use smaller code sequences. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130711 138bc75d-0d04-0410-961f-82ee72b054a4 --- libffi/ChangeLog | 5 +++++ libffi/src/mips/n32.S | 35 ++++++++++++----------------------- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/libffi/ChangeLog b/libffi/ChangeLog index b23058687fd..b547ec77801 100644 --- a/libffi/ChangeLog +++ b/libffi/ChangeLog @@ -1,3 +1,8 @@ +2007-12-08 David Daney + + * src/mips/n32.S (ffi_call_N32): Replace dadd with ADDU, dsub with + SUBU, add with ADDU and use smaller code sequences. + 2007-12-07 David Daney * src/mips/ffi.c (ffi_prep_cif_machdep): Handle long double return type. diff --git a/libffi/src/mips/n32.S b/libffi/src/mips/n32.S index 59a905da5c2..2f9edb48a9b 100644 --- a/libffi/src/mips/n32.S +++ b/libffi/src/mips/n32.S @@ -78,14 +78,12 @@ sixteen: SUBU $sp, $sp, v0 # move the stack pointer to reflect the # arg space - ADDU a0, $sp, 0 # 4 * FFI_SIZEOF_ARG + move a0, $sp # 4 * FFI_SIZEOF_ARG ADDU a3, $fp, 3 * FFI_SIZEOF_ARG # Call ffi_prep_args jal t9 - # ADDU $sp, $sp, 4 * FFI_SIZEOF_ARG # adjust $sp to new args - # Copy the stack pointer to t9 move t9, $sp @@ -96,18 +94,16 @@ sixteen: REG_L t6, 2*FFI_SIZEOF_ARG($fp) # Is it bigger than 8 * FFI_SIZEOF_ARG? - dadd t7, $0, 8 * FFI_SIZEOF_ARG - dsub t8, t6, t7 + daddiu t8, t6, -(8 * FFI_SIZEOF_ARG) bltz t8, loadregs - add t9, t9, t8 + ADDU t9, t9, t8 loadregs: - REG_L t4, 3*FFI_SIZEOF_ARG($fp) # load the flags word - add t6, t4, 0 # and copy it into t6 + REG_L t6, 3*FFI_SIZEOF_ARG($fp) # load the flags word into t6. - and t4, ((1<