[PATCH] Introduce arm_acle.h supporting existing LLVM builtin intrinsics

Saleem Abdulrasool compnerd at compnerd.org
Fri Jun 27 08:28:48 PDT 2014


================
Comment at: lib/Headers/arm_acle.h:78
@@ +77,3 @@
+#if __ARM_32BIT_STATE
+#define __ssat(x, y) __builtin_arm_ssat(x, y)
+#define __usat(x, y) __builtin_arm_usat(x, y)
----------------
Saleem Abdulrasool wrote:
> Saleem Abdulrasool wrote:
> > Why are these macros and the others static inline functions?  It should be possible to do that here as well I believe?
> > 
> >     static __inline__ int32_t __attribute__ (( always_inline, nodebug ))
> >     __ssat(int32_t x, unsigned int y) {
> >       return __builtin_arm_ssat(x, y);
> >     }
> >     static __inline__ uint32_t __attribute__ (( always_inline, nodebug ))
> >     __usat(int32_t x, unsigned int y) {
> >       return __builtin_arm_usat(x, y);
> >     }
> Ugh, this took me a while to reason out ... yeah, these need to be macros.  Can you please add a diagnostics test to ensure that we catch non-constant values?
Ugh, this took a while for me to reason out.  Can you add a diagnostics test case to ensure that we correctly diagnose use of a non-constant value with these macros?

http://reviews.llvm.org/D4296






More information about the cfe-commits mailing list