@@ -27,18 +27,16 @@ define i8 @add8(ptr %p) {
2727;
2828; X86-SLM-LABEL: add8:
2929; X86-SLM: # %bb.0:
30- ; X86-SLM-NEXT: movl {{[0-9]+}}(%esp), %ecx
31- ; X86-SLM-NEXT: xorl %eax, %eax
32- ; X86-SLM-NEXT: lock xaddb %al, (%ecx)
33- ; X86-SLM-NEXT: # kill: def $al killed $al killed $eax
30+ ; X86-SLM-NEXT: movl {{[0-9]+}}(%esp), %eax
31+ ; X86-SLM-NEXT: lock orl $0, (%esp)
32+ ; X86-SLM-NEXT: movzbl (%eax), %eax
3433; X86-SLM-NEXT: retl
3534;
3635; X86-ATOM-LABEL: add8:
3736; X86-ATOM: # %bb.0:
38- ; X86-ATOM-NEXT: movl {{[0-9]+}}(%esp), %ecx
39- ; X86-ATOM-NEXT: xorl %eax, %eax
40- ; X86-ATOM-NEXT: lock xaddb %al, (%ecx)
41- ; X86-ATOM-NEXT: # kill: def $al killed $al killed $eax
37+ ; X86-ATOM-NEXT: movl {{[0-9]+}}(%esp), %eax
38+ ; X86-ATOM-NEXT: lock orl $0, (%esp)
39+ ; X86-ATOM-NEXT: movzbl (%eax), %eax
4240; X86-ATOM-NEXT: nop
4341; X86-ATOM-NEXT: nop
4442; X86-ATOM-NEXT: retl
@@ -62,26 +60,18 @@ define i16 @or16(ptr %p) {
6260;
6361; X86-SLM-LABEL: or16:
6462; X86-SLM: # %bb.0:
65- ; X86-SLM-NEXT: movl {{[0-9]+}}(%esp), %ecx
66- ; X86-SLM-NEXT: movzwl (%ecx), %eax
67- ; X86-SLM-NEXT: .p2align 4, 0x90
68- ; X86-SLM-NEXT: .LBB1_1: # %atomicrmw.start
69- ; X86-SLM-NEXT: # =>This Inner Loop Header: Depth=1
70- ; X86-SLM-NEXT: lock cmpxchgw %ax, (%ecx)
71- ; X86-SLM-NEXT: jne .LBB1_1
72- ; X86-SLM-NEXT: # %bb.2: # %atomicrmw.end
63+ ; X86-SLM-NEXT: movl {{[0-9]+}}(%esp), %eax
64+ ; X86-SLM-NEXT: lock orl $0, (%esp)
65+ ; X86-SLM-NEXT: movzwl (%eax), %eax
7366; X86-SLM-NEXT: retl
7467;
7568; X86-ATOM-LABEL: or16:
7669; X86-ATOM: # %bb.0:
77- ; X86-ATOM-NEXT: movl {{[0-9]+}}(%esp), %ecx
78- ; X86-ATOM-NEXT: movzwl (%ecx), %eax
79- ; X86-ATOM-NEXT: .p2align 4, 0x90
80- ; X86-ATOM-NEXT: .LBB1_1: # %atomicrmw.start
81- ; X86-ATOM-NEXT: # =>This Inner Loop Header: Depth=1
82- ; X86-ATOM-NEXT: lock cmpxchgw %ax, (%ecx)
83- ; X86-ATOM-NEXT: jne .LBB1_1
84- ; X86-ATOM-NEXT: # %bb.2: # %atomicrmw.end
70+ ; X86-ATOM-NEXT: movl {{[0-9]+}}(%esp), %eax
71+ ; X86-ATOM-NEXT: lock orl $0, (%esp)
72+ ; X86-ATOM-NEXT: movzwl (%eax), %eax
73+ ; X86-ATOM-NEXT: nop
74+ ; X86-ATOM-NEXT: nop
8575; X86-ATOM-NEXT: retl
8676 %1 = atomicrmw or ptr %p , i16 0 acquire
8777 ret i16 %1
@@ -103,26 +93,18 @@ define i32 @xor32(ptr %p) {
10393;
10494; X86-SLM-LABEL: xor32:
10595; X86-SLM: # %bb.0:
106- ; X86-SLM-NEXT: movl {{[0-9]+}}(%esp), %ecx
107- ; X86-SLM-NEXT: movl (%ecx), %eax
108- ; X86-SLM-NEXT: .p2align 4, 0x90
109- ; X86-SLM-NEXT: .LBB2_1: # %atomicrmw.start
110- ; X86-SLM-NEXT: # =>This Inner Loop Header: Depth=1
111- ; X86-SLM-NEXT: lock cmpxchgl %eax, (%ecx)
112- ; X86-SLM-NEXT: jne .LBB2_1
113- ; X86-SLM-NEXT: # %bb.2: # %atomicrmw.end
96+ ; X86-SLM-NEXT: movl {{[0-9]+}}(%esp), %eax
97+ ; X86-SLM-NEXT: lock orl $0, (%esp)
98+ ; X86-SLM-NEXT: movl (%eax), %eax
11499; X86-SLM-NEXT: retl
115100;
116101; X86-ATOM-LABEL: xor32:
117102; X86-ATOM: # %bb.0:
118- ; X86-ATOM-NEXT: movl {{[0-9]+}}(%esp), %ecx
119- ; X86-ATOM-NEXT: movl (%ecx), %eax
120- ; X86-ATOM-NEXT: .p2align 4, 0x90
121- ; X86-ATOM-NEXT: .LBB2_1: # %atomicrmw.start
122- ; X86-ATOM-NEXT: # =>This Inner Loop Header: Depth=1
123- ; X86-ATOM-NEXT: lock cmpxchgl %eax, (%ecx)
124- ; X86-ATOM-NEXT: jne .LBB2_1
125- ; X86-ATOM-NEXT: # %bb.2: # %atomicrmw.end
103+ ; X86-ATOM-NEXT: movl {{[0-9]+}}(%esp), %eax
104+ ; X86-ATOM-NEXT: lock orl $0, (%esp)
105+ ; X86-ATOM-NEXT: movl (%eax), %eax
106+ ; X86-ATOM-NEXT: nop
107+ ; X86-ATOM-NEXT: nop
126108; X86-ATOM-NEXT: retl
127109 %1 = atomicrmw xor ptr %p , i32 0 release
128110 ret i32 %1
@@ -318,26 +300,18 @@ define i32 @and32 (ptr %p) {
318300;
319301; X86-SLM-LABEL: and32:
320302; X86-SLM: # %bb.0:
321- ; X86-SLM-NEXT: movl {{[0-9]+}}(%esp), %ecx
322- ; X86-SLM-NEXT: movl (%ecx), %eax
323- ; X86-SLM-NEXT: .p2align 4, 0x90
324- ; X86-SLM-NEXT: .LBB5_1: # %atomicrmw.start
325- ; X86-SLM-NEXT: # =>This Inner Loop Header: Depth=1
326- ; X86-SLM-NEXT: lock cmpxchgl %eax, (%ecx)
327- ; X86-SLM-NEXT: jne .LBB5_1
328- ; X86-SLM-NEXT: # %bb.2: # %atomicrmw.end
303+ ; X86-SLM-NEXT: movl {{[0-9]+}}(%esp), %eax
304+ ; X86-SLM-NEXT: lock orl $0, (%esp)
305+ ; X86-SLM-NEXT: movl (%eax), %eax
329306; X86-SLM-NEXT: retl
330307;
331308; X86-ATOM-LABEL: and32:
332309; X86-ATOM: # %bb.0:
333- ; X86-ATOM-NEXT: movl {{[0-9]+}}(%esp), %ecx
334- ; X86-ATOM-NEXT: movl (%ecx), %eax
335- ; X86-ATOM-NEXT: .p2align 4, 0x90
336- ; X86-ATOM-NEXT: .LBB5_1: # %atomicrmw.start
337- ; X86-ATOM-NEXT: # =>This Inner Loop Header: Depth=1
338- ; X86-ATOM-NEXT: lock cmpxchgl %eax, (%ecx)
339- ; X86-ATOM-NEXT: jne .LBB5_1
340- ; X86-ATOM-NEXT: # %bb.2: # %atomicrmw.end
310+ ; X86-ATOM-NEXT: movl {{[0-9]+}}(%esp), %eax
311+ ; X86-ATOM-NEXT: lock orl $0, (%esp)
312+ ; X86-ATOM-NEXT: movl (%eax), %eax
313+ ; X86-ATOM-NEXT: nop
314+ ; X86-ATOM-NEXT: nop
341315; X86-ATOM-NEXT: retl
342316 %1 = atomicrmw and ptr %p , i32 -1 acq_rel
343317 ret i32 %1
0 commit comments