[compiler-rt] r311555 - [ARM][Compiler-rt] Fix AEABI builtins to correctly pass arguments to non-AEABI functions on HF targets

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 23 08:23:18 PDT 2017


Hans,

Could you please crossport this to the 5.0 release branch?  It is a fix for
a release blocker, and has been reviewed by multiple people.  I don't
expect it to be a stability concern.

Thanks!

On Wed, Aug 23, 2017 at 7:27 AM Oleg Ranevskyy via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: oleg
> Date: Wed Aug 23 07:26:31 2017
> New Revision: 311555
>
> URL: http://llvm.org/viewvc/llvm-project?rev=311555&view=rev
> Log:
> [ARM][Compiler-rt] Fix AEABI builtins to correctly pass arguments to
> non-AEABI functions on HF targets
>
> Summary:
> This is a patch for PR34167.
>
> On HF targets functions like `__{eq,lt,le,ge,gt}df2` and
> `__{eq,lt,le,ge,gt}sf2` expect their arguments to be passed in d/s
> registers, while some of the AEABI builtins pass them in r registers.
>
> Reviewers: compnerd, peter.smith, asl
>
> Reviewed By: peter.smith, asl
>
> Subscribers: peter.smith, aemerson, dberris, javed.absar, llvm-commits,
> asl, kristof.beyls
>
> Differential Revision: https://reviews.llvm.org/D36675
>
> Modified:
>     compiler-rt/trunk/lib/builtins/arm/aeabi_dcmp.S
>     compiler-rt/trunk/lib/builtins/arm/aeabi_fcmp.S
>
> Modified: compiler-rt/trunk/lib/builtins/arm/aeabi_dcmp.S
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/arm/aeabi_dcmp.S?rev=311555&r1=311554&r2=311555&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/lib/builtins/arm/aeabi_dcmp.S (original)
> +++ compiler-rt/trunk/lib/builtins/arm/aeabi_dcmp.S Wed Aug 23 07:26:31
> 2017
> @@ -18,11 +18,20 @@
>  //   }
>  // }
>
> +#if defined(COMPILER_RT_ARMHF_TARGET)
> +#  define CONVERT_DCMP_ARGS_TO_DF2_ARGS                    \
> +        vmov      d0, r0, r1                     SEPARATOR \
> +        vmov      d1, r2, r3
> +#else
> +#  define CONVERT_DCMP_ARGS_TO_DF2_ARGS
> +#endif
> +
>  #define DEFINE_AEABI_DCMP(cond)                            \
>          .syntax unified                          SEPARATOR \
>          .p2align 2                               SEPARATOR \
>  DEFINE_COMPILERRT_FUNCTION(__aeabi_dcmp ## cond)           \
>          push      { r4, lr }                     SEPARATOR \
> +        CONVERT_DCMP_ARGS_TO_DF2_ARGS            SEPARATOR \
>          bl        SYMBOL_NAME(__ ## cond ## df2) SEPARATOR \
>          cmp       r0, #0                         SEPARATOR \
>          b ## cond 1f                             SEPARATOR \
>
> Modified: compiler-rt/trunk/lib/builtins/arm/aeabi_fcmp.S
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/arm/aeabi_fcmp.S?rev=311555&r1=311554&r2=311555&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/lib/builtins/arm/aeabi_fcmp.S (original)
> +++ compiler-rt/trunk/lib/builtins/arm/aeabi_fcmp.S Wed Aug 23 07:26:31
> 2017
> @@ -18,11 +18,20 @@
>  //   }
>  // }
>
> +#if defined(COMPILER_RT_ARMHF_TARGET)
> +#  define CONVERT_FCMP_ARGS_TO_SF2_ARGS                    \
> +        vmov      s0, r0                         SEPARATOR \
> +        vmov      s1, r1
> +#else
> +#  define CONVERT_FCMP_ARGS_TO_SF2_ARGS
> +#endif
> +
>  #define DEFINE_AEABI_FCMP(cond)                            \
>          .syntax unified                          SEPARATOR \
>          .p2align 2                               SEPARATOR \
>  DEFINE_COMPILERRT_FUNCTION(__aeabi_fcmp ## cond)           \
>          push      { r4, lr }                     SEPARATOR \
> +        CONVERT_FCMP_ARGS_TO_SF2_ARGS            SEPARATOR \
>          bl        SYMBOL_NAME(__ ## cond ## sf2) SEPARATOR \
>          cmp       r0, #0                         SEPARATOR \
>          b ## cond 1f                             SEPARATOR \
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-- 
Saleem Abdulrasool
compnerd (at) compnerd (dot) org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170823/af4c0949/attachment.html>


More information about the llvm-commits mailing list