llvm.org GIT mirror llvm / dbf293f
Merging r167718 into 3.2 release branch Fix PR14314 - Fix operand order for atomic sub, where the minuend is the value loaded from memory and the subtrahend is the parameter specified. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168336 91177308-0d34-0410-b5e6-96231b3b80d8 Pawel Wodnicki 6 years ago
3 changed file(s) with 19 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
1272812728 case X86::ATOMSUB6432: {
1272912729 unsigned HiOpc;
1273012730 unsigned LoOpc = getNonAtomic6432Opcode(Opc, HiOpc);
12731 BuildMI(mainMBB, DL, TII->get(LoOpc), t1L).addReg(SrcLoReg).addReg(LoReg);
12732 BuildMI(mainMBB, DL, TII->get(HiOpc), t1H).addReg(SrcHiReg).addReg(HiReg);
12731 BuildMI(mainMBB, DL, TII->get(LoOpc), t1L).addReg(LoReg).addReg(SrcLoReg);
12732 BuildMI(mainMBB, DL, TII->get(HiOpc), t1H).addReg(HiReg).addReg(SrcHiReg);
1273312733 break;
1273412734 }
1273512735 case X86::ATOMNAND6432: {
99 ; CHECK: movl ([[REG:%[a-z]+]]), %eax
1010 ; CHECK: movl 4([[REG]]), %edx
1111 ; CHECK: LBB0_1:
12 ; CHECK: movl $1
13 ; CHECK: addl
14 ; CHECK: movl $0
15 ; CHECK: adcl
12 ; CHECK: movl %eax, %ebx
13 ; CHECK: addl {{%[a-z]+}}, %ebx
14 ; CHECK: movl %edx, %ecx
15 ; CHECK: adcl {{%[a-z]+}}, %ecx
1616 ; CHECK: lock
1717 ; CHECK-NEXT: cmpxchg8b ([[REG]])
1818 ; CHECK-NEXT: jne
0 ; RUN: llc < %s -mtriple=i386-pc-linux -mcpu=corei7 | FileCheck %s
1
2 define i64 @atomicSub(i64* %a, i64 %b) nounwind {
3 entry:
4 %0 = atomicrmw sub i64* %a, i64 %b seq_cst
5 ret i64 %0
6 ; CHECK: atomicSub
7 ; movl %eax, %ebx
8 ; subl {{%[a-z]+}}, %ebx
9 ; movl %edx, %ecx
10 ; sbbl {{%[a-z]+}}, %ecx
11 ; CHECK: ret
12 }