Why not just

-  return __builtin_clzs(__X);
+  return (__X == 0 ? 16 : __builtin_clzs(__X));

and corresponding changes in the other functions in lzcntintrin.h

(+ the test changes)

Adding new builtins adds a maintenance and documentation burden.

-- Sean Silva

On Mon, Oct 27, 2014 at 4:05 PM, Robinson, Paul <
[email protected]> wrote:

>  New patch attached that defines new builtins and uses them in
> lzcntintrin.h.  This patch doesn't change anything about the behavior of
> the old builtins (although they come along for the ride when I refactored
> the CGBuiltins.cpp implementation).  I also tightened up the test for the
> lzcntintrin.h functions, as it didn't notice the incorrect translation.
>
> Yeah I know I should have a doc update as well; I'll get to it, but I have
> to leave right now.
>
> --paulr
>
>
>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to