Patchwork [2/4] mips: Install the __sync libfuncs for mips16

login
register
mail settings
Submitter Richard Henderson
Date Nov. 11, 2011, 11:32 p.m.
Message ID <1321054334-21865-3-git-send-email-rth@redhat.com>
Download mbox | patch
Permalink /patch/125310/
State New
Headers show

Comments

Richard Henderson - Nov. 11, 2011, 11:32 p.m.
Cc: Richard Sandiford <rdsandiford@googlemail.com>
---
 gcc/config/mips/mips.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
Richard Sandiford - Nov. 20, 2011, 8:52 p.m.
Richard Henderson <rth@redhat.com> writes:
>  gcc/config/mips/mips.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
> index ff72e28..75e73bd 100644
> --- a/gcc/config/mips/mips.c
> +++ b/gcc/config/mips/mips.c
> @@ -11218,9 +11218,13 @@ mips_init_libfuncs (void)
>      }
>  
>    /* The MIPS16 ISA does not have an encoding for "sync", so we rely
> -     on an external non-MIPS16 routine to implement __sync_synchronize.  */
> +     on an external non-MIPS16 routine to implement __sync_synchronize.
> +     Similarly for the rest of the ll/sc libfuncs.  */
>    if (TARGET_MIPS16)
> -    synchronize_libfunc = init_one_libfunc ("__sync_synchronize");
> +    {
> +      synchronize_libfunc = init_one_libfunc ("__sync_synchronize");
> +      init_sync_libfuncs (UNITS_PER_WORD);
> +    }
>  }
>  
>  /* Build up a multi-insn sequence that loads label TARGET into $AT.  */

Finally tested on mips64-linux-gnu with -mabi=32/-mips16 multilibs
(sorry for the delay).  Results look good, so please go ahead.

Thanks,
Richard

Patch

diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index ff72e28..75e73bd 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -11218,9 +11218,13 @@  mips_init_libfuncs (void)
     }
 
   /* The MIPS16 ISA does not have an encoding for "sync", so we rely
-     on an external non-MIPS16 routine to implement __sync_synchronize.  */
+     on an external non-MIPS16 routine to implement __sync_synchronize.
+     Similarly for the rest of the ll/sc libfuncs.  */
   if (TARGET_MIPS16)
-    synchronize_libfunc = init_one_libfunc ("__sync_synchronize");
+    {
+      synchronize_libfunc = init_one_libfunc ("__sync_synchronize");
+      init_sync_libfuncs (UNITS_PER_WORD);
+    }
 }
 
 /* Build up a multi-insn sequence that loads label TARGET into $AT.  */