18
18
define i32 @t0_32 (i32 %ptr , i32 %alignment ) nounwind {
19
19
; X86-LABEL: t0_32:
20
20
; X86: # %bb.0:
21
- ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
22
- ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
23
- ; X86-NEXT: decl %ecx
24
- ; X86-NEXT: andl %eax, %ecx
25
- ; X86-NEXT: subl %ecx, %eax
21
+ ; X86-NEXT: xorl %eax, %eax
22
+ ; X86-NEXT: subl {{[0-9]+}}(%esp), %eax
23
+ ; X86-NEXT: andl {{[0-9]+}}(%esp), %eax
26
24
; X86-NEXT: retl
27
25
;
28
26
; X64-LABEL: t0_32:
29
27
; X64: # %bb.0:
30
- ; X64-NEXT: movl %edi, %eax
31
- ; X64-NEXT: decl %esi
32
- ; X64-NEXT: andl %edi, %esi
33
- ; X64-NEXT: subl %esi, %eax
28
+ ; X64-NEXT: movl %esi, %eax
29
+ ; X64-NEXT: negl %eax
30
+ ; X64-NEXT: andl %edi, %eax
34
31
; X64-NEXT: retq
35
32
%mask = add i32 %alignment , -1
36
33
%bias = and i32 %ptr , %mask
@@ -40,26 +37,19 @@ define i32 @t0_32(i32 %ptr, i32 %alignment) nounwind {
40
37
define i64 @t1_64 (i64 %ptr , i64 %alignment ) nounwind {
41
38
; X86-LABEL: t1_64:
42
39
; X86: # %bb.0:
43
- ; X86-NEXT: pushl %esi
44
- ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
45
- ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
46
- ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
47
- ; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
48
- ; X86-NEXT: addl $-1, %ecx
49
- ; X86-NEXT: adcl $-1, %esi
50
- ; X86-NEXT: andl %edx, %esi
51
- ; X86-NEXT: andl %eax, %ecx
52
- ; X86-NEXT: subl %ecx, %eax
53
- ; X86-NEXT: sbbl %esi, %edx
54
- ; X86-NEXT: popl %esi
40
+ ; X86-NEXT: xorl %edx, %edx
41
+ ; X86-NEXT: xorl %eax, %eax
42
+ ; X86-NEXT: subl {{[0-9]+}}(%esp), %eax
43
+ ; X86-NEXT: sbbl {{[0-9]+}}(%esp), %edx
44
+ ; X86-NEXT: andl {{[0-9]+}}(%esp), %edx
45
+ ; X86-NEXT: andl {{[0-9]+}}(%esp), %eax
55
46
; X86-NEXT: retl
56
47
;
57
48
; X64-LABEL: t1_64:
58
49
; X64: # %bb.0:
59
- ; X64-NEXT: movq %rdi, %rax
60
- ; X64-NEXT: decq %rsi
61
- ; X64-NEXT: andq %rdi, %rsi
62
- ; X64-NEXT: subq %rsi, %rax
50
+ ; X64-NEXT: movq %rsi, %rax
51
+ ; X64-NEXT: negq %rax
52
+ ; X64-NEXT: andq %rdi, %rax
63
53
; X64-NEXT: retq
64
54
%mask = add i64 %alignment , -1
65
55
%bias = and i64 %ptr , %mask
@@ -70,19 +60,16 @@ define i64 @t1_64(i64 %ptr, i64 %alignment) nounwind {
70
60
define i32 @t2_commutative (i32 %ptr , i32 %alignment ) nounwind {
71
61
; X86-LABEL: t2_commutative:
72
62
; X86: # %bb.0:
73
- ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
74
- ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
75
- ; X86-NEXT: decl %ecx
76
- ; X86-NEXT: andl %eax, %ecx
77
- ; X86-NEXT: subl %ecx, %eax
63
+ ; X86-NEXT: xorl %eax, %eax
64
+ ; X86-NEXT: subl {{[0-9]+}}(%esp), %eax
65
+ ; X86-NEXT: andl {{[0-9]+}}(%esp), %eax
78
66
; X86-NEXT: retl
79
67
;
80
68
; X64-LABEL: t2_commutative:
81
69
; X64: # %bb.0:
82
- ; X64-NEXT: movl %edi, %eax
83
- ; X64-NEXT: decl %esi
84
- ; X64-NEXT: andl %edi, %esi
85
- ; X64-NEXT: subl %esi, %eax
70
+ ; X64-NEXT: movl %esi, %eax
71
+ ; X64-NEXT: negl %eax
72
+ ; X64-NEXT: andl %edi, %eax
86
73
; X64-NEXT: retq
87
74
%mask = add i32 %alignment , -1
88
75
%bias = and i32 %mask , %ptr ; swapped
@@ -95,22 +82,22 @@ define i32 @t2_commutative(i32 %ptr, i32 %alignment) nounwind {
95
82
define i32 @t3_extrause0 (i32 %ptr , i32 %alignment , i32* %mask_storage ) nounwind {
96
83
; X86-LABEL: t3_extrause0:
97
84
; X86: # %bb.0:
98
- ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
99
85
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
100
- ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
101
- ; X86-NEXT: decl %edx
86
+ ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
87
+ ; X86-NEXT: leal -1(%eax), %edx
102
88
; X86-NEXT: movl %edx, (%ecx)
103
- ; X86-NEXT: andl %eax, %edx
104
- ; X86-NEXT: subl %edx , %eax
89
+ ; X86-NEXT: negl %eax
90
+ ; X86-NEXT: andl {{[0-9]+}}(%esp) , %eax
105
91
; X86-NEXT: retl
106
92
;
107
93
; X64-LABEL: t3_extrause0:
108
94
; X64: # %bb.0:
109
- ; X64-NEXT: movl %edi, %eax
110
- ; X64-NEXT: decl %esi
111
- ; X64-NEXT: movl %esi, (%rdx)
112
- ; X64-NEXT: andl %edi, %esi
113
- ; X64-NEXT: subl %esi, %eax
95
+ ; X64-NEXT: movl %esi, %eax
96
+ ; X64-NEXT: leal -1(%rax), %ecx
97
+ ; X64-NEXT: movl %ecx, (%rdx)
98
+ ; X64-NEXT: negl %eax
99
+ ; X64-NEXT: andl %edi, %eax
100
+ ; X64-NEXT: # kill: def $eax killed $eax killed $rax
114
101
; X64-NEXT: retq
115
102
%mask = add i32 %alignment , -1
116
103
store i32 %mask , i32* %mask_storage
0 commit comments