[PATCH] arm_acle: Implement data processing intrinsics

Tim Northover t.p.northover at gmail.com
Wed Aug 20 07:11:30 PDT 2014


Hi Yi,

Thanks for working on this. I spotted a couple of issues (but I'm going away for a week tomorrow, so you may want to dig up another reviewer too):

================
Comment at: lib/Headers/arm_acle.h:102
@@ +101,3 @@
+  __ror(uint32_t x, uint32_t y) {
+  return (x >> y) | (x << 32 - y);
+}
----------------
This is undefined behaviour when y >= 32 or == 0.

================
Comment at: lib/Headers/arm_acle.h:134
@@ +133,3 @@
+  __cls(uint32_t t) {
+  return __clz(((t ^ ((int32_t)t >> 31)) << 1) + 1);
+}
----------------
This seems to be off-by-1 from what I'd expect. It certainly returns an incorrect value for t == 0 (according to ACLE).

http://reviews.llvm.org/D4983






More information about the llvm-commits mailing list