1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
; RUN: llc < %s -mtriple=x86_64-- -verify-machineinstrs -mcpu=corei7 -mattr=-cx16 | FileCheck %s
; RUN: llc < %s -mtriple=i386-linux-gnu -verify-machineinstrs -mattr=cx16 | FileCheck -check-prefix=CHECK32 %s
;; Verify that 128-bit atomics emit a libcall without cx16
;; available.
;;
;; We test 32-bit mode with -mattr=cx16, because it should have no
;; effect for 32-bit mode.
; CHECK-LABEL: test:
define void @test(ptr %a) nounwind {
entry:
; CHECK: __atomic_compare_exchange_16
; CHECK32: __atomic_compare_exchange
%0 = cmpxchg ptr %a, i128 1, i128 1 seq_cst seq_cst
; CHECK: __atomic_exchange_16
; CHECK32: __atomic_exchange
%1 = atomicrmw xchg ptr %a, i128 1 seq_cst
; CHECK: __atomic_fetch_add_16
; CHECK32: __atomic_compare_exchange
%2 = atomicrmw add ptr %a, i128 1 seq_cst
; CHECK: __atomic_fetch_sub_16
; CHECK32: __atomic_compare_exchange
%3 = atomicrmw sub ptr %a, i128 1 seq_cst
; CHECK: __atomic_fetch_and_16
; CHECK32: __atomic_compare_exchange
%4 = atomicrmw and ptr %a, i128 1 seq_cst
; CHECK: __atomic_fetch_nand_16
; CHECK32: __atomic_compare_exchange
%5 = atomicrmw nand ptr %a, i128 1 seq_cst
; CHECK: __atomic_fetch_or_16
; CHECK32: __atomic_compare_exchange
%6 = atomicrmw or ptr %a, i128 1 seq_cst
; CHECK: __atomic_fetch_xor_16
; CHECK32: __atomic_compare_exchange
%7 = atomicrmw xor ptr %a, i128 1 seq_cst
; CHECK: __atomic_load_16
; CHECK32: __atomic_load
%8 = load atomic i128, ptr %a seq_cst, align 16
; CHECK: __atomic_store_16
; CHECK32: __atomic_store
store atomic i128 %8, ptr %a seq_cst, align 16
ret void
}
; CHECK-LABEL: test_fp:
define void @test_fp(ptr %a) nounwind {
entry:
; CHECK: __atomic_exchange_16
; CHECK32: __atomic_exchange
%0 = atomicrmw xchg ptr %a, fp128 0xL00000000000000004000900000000000 seq_cst
; CHECK: __atomic_compare_exchange_16
; CHECK32: __atomic_compare_exchange
%1 = atomicrmw fadd ptr %a, fp128 0xL00000000000000004000900000000000 seq_cst
; CHECK: __atomic_compare_exchange_16
; CHECK32: __atomic_compare_exchange
%2 = atomicrmw fsub ptr %a, fp128 0xL00000000000000004000900000000000 seq_cst
; CHECK: __atomic_load_16
; CHECK32: __atomic_load
%3 = load atomic fp128, ptr %a seq_cst, align 16
; CHECK: __atomic_store_16
; CHECK32: __atomic_store
store atomic fp128 %3, ptr %a seq_cst, align 16
ret void
}
|