[PATCH] Bugfix for Codegen of atomic load/store ops.

Alexey Bataev a.bataev at hotmail.com
Wed Dec 3 22:52:44 PST 2014


John, thanks for the review! Also I need to add a test for 32 bit mode (long double has size 96 bits there) and check that in this mode we create a libcall.

================
Comment at: test/CodeGen/x86_64-atomic-long_double.c:7
@@ +6,3 @@
+  // CHECK: load atomic i128*
+  // CHECK: bitcast x86_fp80* %{{.+}} to i128*
+  // CHECK: store i128 %{{.+}}, i128*
----------------
rjmccall wrote:
> You need to be more specific in this test.  You should be able to match the alloca.
Ok, I'll improve test

================
Comment at: test/CodeGen/x86_64-atomic-long_double.c:14
@@ +13,3 @@
+
+void  test_store(_Atomic long double *addr, long double val) {
+  // CHECK-LABEL: @test_store
----------------
rjmccall wrote:
> This isn't good enough; x86_fp80's store size doesn't fill its rounded-up size.  So you also need to ensure that the extra bits have some consistent value — i.e. zero.  In other words, there needs to be a memset of the alloca to zero before you can store the long double into it.
Ok, I'll add additional checks

http://reviews.llvm.org/D6499






More information about the cfe-commits mailing list