RKSimon added inline comments.

================
Comment at: clang/lib/Headers/immintrin.h:301
+  unsigned long long tmp;
+  if (__builtin_ia32_rdrand32_step((unsigned int *)&tmp) &
+      __builtin_ia32_rdrand32_step(((unsigned int *)&tmp) + 1)) {
----------------
craig.topper wrote:
> craig.topper wrote:
> > Should `&` be `&&`?
> Can we avoid the pointer cast here? Use two unsigned ints and manually 
> concatenate them to a 64-bit value.
+1
```
unsigned int lo, hi;
if (__builtin_ia32_rdrand32_step(&lo) &&
    __builtin_ia32_rdrand32_step(&hi)) {
  *p = ((unsigned long)hi << 32) | lo;
  return 1;
}
```


================
Comment at: clang/test/CodeGen/X86/rdrand-builtins.c:2
 // RUN: %clang_cc1 -no-opaque-pointers -ffreestanding %s 
-triple=x86_64-unknown-unknown -target-feature +rdrnd -target-feature +rdseed 
-emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=CHECK,X64
-// RUN: %clang_cc1 -no-opaque-pointers -ffreestanding %s 
-triple=i386-unknown-unknown -target-feature +rdrnd -target-feature +rdseed 
-emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=CHECK
+// RUN: %clang_cc1 -no-opaque-pointers -ffreestanding %s 
-triple=i386-unknown-unknown -target-feature +rdrnd -target-feature +rdseed 
-emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=CHECK,X32
 
----------------
X86 not X32 :) 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132141/new/

https://reviews.llvm.org/D132141

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to