[PATCH] [ARM] Add CRC32 intrinsics for AArch32.

Tim Northover t.p.northover at gmail.com
Tue Sep 17 05:57:22 PDT 2013


  Hi Bradley,

  I think this looks fine other than one minor test issue.


================
Comment at: test/CodeGen/arm-crc32.c:48-52
@@ +47,7 @@
+        return __builtin_arm_crc32d(a,b);
+// CHECK: %0 = trunc i64 %b to i32
+// CHECK: %1 = lshr i64 %b, 32
+// CHECK: %2 = trunc i64 %1 to i32
+// CHECK: %3 = tail call i32 @llvm.arm.crc32w(i32 %a, i32 %0)
+// CHECK: call i32 @llvm.arm.crc32w(i32 %3, i32 %2)
+}
----------------
%0-%3 might be rather fragile names if some optimisation comes comes along. Usually Clang tests use named regexps to make sure propagated values are consistent. For example:

// CHECK: [[LO:%[0-9]+]] = trunc i64 %b to i32
[...]
// CHECK: tail call i32 @llvm.arm.crc32w(i32 %a, i32 [[LO]])

I think you can rely on the arguments coming in as %a and %b though.


http://llvm-reviews.chandlerc.com/D1673



More information about the cfe-commits mailing list