66 lines · plain
1; RUN: llc < %s -mtriple=x86_64-- -verify-machineinstrs -mcpu=corei7 -mattr=-cx16 | FileCheck %s2; RUN: llc < %s -mtriple=i386-linux-gnu -verify-machineinstrs -mattr=cx16 | FileCheck -check-prefix=CHECK32 %s3 4;; Verify that 128-bit atomics emit a libcall without cx165;; available.6;;7;; We test 32-bit mode with -mattr=cx16, because it should have no8;; effect for 32-bit mode.9 10; CHECK-LABEL: test:11define void @test(ptr %a) nounwind {12entry:13; CHECK: __atomic_compare_exchange_1614; CHECK32: __atomic_compare_exchange15 %0 = cmpxchg ptr %a, i128 1, i128 1 seq_cst seq_cst16; CHECK: __atomic_exchange_1617; CHECK32: __atomic_exchange18 %1 = atomicrmw xchg ptr %a, i128 1 seq_cst19; CHECK: __atomic_fetch_add_1620; CHECK32: __atomic_compare_exchange21 %2 = atomicrmw add ptr %a, i128 1 seq_cst22; CHECK: __atomic_fetch_sub_1623; CHECK32: __atomic_compare_exchange24 %3 = atomicrmw sub ptr %a, i128 1 seq_cst25; CHECK: __atomic_fetch_and_1626; CHECK32: __atomic_compare_exchange27 %4 = atomicrmw and ptr %a, i128 1 seq_cst28; CHECK: __atomic_fetch_nand_1629; CHECK32: __atomic_compare_exchange30 %5 = atomicrmw nand ptr %a, i128 1 seq_cst31; CHECK: __atomic_fetch_or_1632; CHECK32: __atomic_compare_exchange33 %6 = atomicrmw or ptr %a, i128 1 seq_cst34; CHECK: __atomic_fetch_xor_1635; CHECK32: __atomic_compare_exchange36 %7 = atomicrmw xor ptr %a, i128 1 seq_cst37; CHECK: __atomic_load_1638; CHECK32: __atomic_load39 %8 = load atomic i128, ptr %a seq_cst, align 1640; CHECK: __atomic_store_1641; CHECK32: __atomic_store42 store atomic i128 %8, ptr %a seq_cst, align 1643 ret void44}45 46; CHECK-LABEL: test_fp:47define void @test_fp(ptr %a) nounwind {48entry:49; CHECK: __atomic_exchange_1650; CHECK32: __atomic_exchange51 %0 = atomicrmw xchg ptr %a, fp128 0xL00000000000000004000900000000000 seq_cst52; CHECK: __atomic_compare_exchange_1653; CHECK32: __atomic_compare_exchange54 %1 = atomicrmw fadd ptr %a, fp128 0xL00000000000000004000900000000000 seq_cst55; CHECK: __atomic_compare_exchange_1656; CHECK32: __atomic_compare_exchange57 %2 = atomicrmw fsub ptr %a, fp128 0xL00000000000000004000900000000000 seq_cst58; CHECK: __atomic_load_1659; CHECK32: __atomic_load60 %3 = load atomic fp128, ptr %a seq_cst, align 1661; CHECK: __atomic_store_1662; CHECK32: __atomic_store63 store atomic fp128 %3, ptr %a seq_cst, align 1664 ret void65}66