[PATCH] D143287: [Clang][X86] Change X86 cast intrinsics to use __builtin_nondeterministic_value

Simon Pilgrim via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 15 02:16:25 PDT 2023


RKSimon accepted this revision.
RKSimon added a comment.

LGTM - just simplify the shuffle masks (even if it break 80-col).

Please keep an eye out for any regressions, I'm not certain we've shaken out every possible issue.



================
Comment at: clang/lib/Headers/avx512fintrin.h:401
+  return __builtin_shufflevector(__a, __builtin_nondeterministic_value(__a), 0,
+                                 1, 2, 3, 4, 5, 6, 7);
 }
----------------
We don't always keep to clang formatting in the headers if it confuses things - better to keep the entire shuffle mask on a single line if possible - same for the others
```
  return __builtin_shufflevector(__a, __builtin_nondeterministic_value(__a),
                                 0, 1, 2, 3, 4, 5, 6, 7);
```


================
Comment at: clang/lib/Headers/avx512fintrin.h:409
+                                 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+                                 15);
 }
----------------
Maybe:
```
  return __builtin_shufflevector(__a, __builtin_nondeterministic_value(__a), 0,
                                 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
```


================
Comment at: clang/test/CodeGen/X86/avx-cast-builtins.c:102
+}
\ No newline at end of file

----------------
fixme


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143287



More information about the cfe-commits mailing list