That makes lzcntintrin.h completely pointless.  They'd just be alternate names 
for the functions in Intrin.h.
--paulr

From: Sean Silva [mailto:[email protected]]
Sent: Monday, October 27, 2014 4:18 PM
To: Robinson, Paul
Cc: Arthur O'Dwyer; [email protected]
Subject: Re: [PATCH][X86] __builtin_ctz/clz sometimed defined for zero input

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]<mailto:[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