1 ; RUN: llc -march=x86 -mattr=+cmov,cx16 -mtriple=i386-pc-linux -verify-machineinstrs < %s | FileCheck %s -check-prefix=LINUX 2 ; RUN: llc -march=x86 -mattr=cx16 -mtriple=i386-macosx -relocation-model=pic -verify-machineinstrs < %s | FileCheck %s -check-prefix=PIC 3 4 @sc64 = external global i64 5 6 define void @atomic_maxmin_i6432() { 7 ; LINUX: atomic_maxmin_i6432 8 %1 = atomicrmw max i64* @sc64, i64 5 acquire 9 ; LINUX: [[LABEL:.LBB[0-9]+_[0-9]+]] 10 ; LINUX: cmpl 11 ; LINUX: sbbl 12 ; LINUX: cmovne 13 ; LINUX: cmovne 14 ; LINUX: lock cmpxchg8b 15 ; LINUX: jne [[LABEL]] 16 %2 = atomicrmw min i64* @sc64, i64 6 acquire 17 ; LINUX: [[LABEL:.LBB[0-9]+_[0-9]+]] 18 ; LINUX: cmpl 19 ; LINUX: sbbl 20 ; LINUX: cmovne 21 ; LINUX: cmovne 22 ; LINUX: lock cmpxchg8b 23 ; LINUX: jne [[LABEL]] 24 %3 = atomicrmw umax i64* @sc64, i64 7 acquire 25 ; LINUX: [[LABEL:.LBB[0-9]+_[0-9]+]] 26 ; LINUX: cmpl 27 ; LINUX: sbbl 28 ; LINUX: cmovne 29 ; LINUX: cmovne 30 ; LINUX: lock cmpxchg8b 31 ; LINUX: jne [[LABEL]] 32 %4 = atomicrmw umin i64* @sc64, i64 8 acquire 33 ; LINUX: [[LABEL:.LBB[0-9]+_[0-9]+]] 34 ; LINUX: cmpl 35 ; LINUX: sbbl 36 ; LINUX: cmovne 37 ; LINUX: cmovne 38 ; LINUX: lock cmpxchg8b 39 ; LINUX: jne [[LABEL]] 40 ret void 41 } 42 43 ; rdar://12453106 44 @id = internal global i64 0, align 8 45 46 define void @tf_bug(i8* %ptr) nounwind { 47 ; PIC-LABEL: tf_bug: 48 ; PIC-DAG: movl _id-L1$pb( 49 ; PIC-DAG: movl (_id-L1$pb)+4( 50 %tmp1 = atomicrmw add i64* @id, i64 1 seq_cst 51 %tmp2 = add i64 %tmp1, 1 52 %tmp3 = bitcast i8* %ptr to i64* 53 store i64 %tmp2, i64* %tmp3, align 4 54 ret void 55 } 56