@@ -4,10 +4,9 @@ func @add_pos64:i64(i64) {
44 # check: function `add_pos64`:
55 # nextln: 000000: 55 push rbp
66 # nextln: 000001: 48 89 e5 mov rbp, rsp
7- # nextln: 000004: 48 89 f8 mov rax, rdi
8- # nextln: 000007: 48 83 c0 05 add rax, 5
9- # nextln: 00000b: 5d pop rbp
10- # nextln: 00000c: c3 ret
7+ # nextln: 000004: 48 8d 47 05 lea rax, [rdi + 5]
8+ # nextln: 000008: 5d pop rbp
9+ # nextln: 000009: c3 ret
1110
1211 %c:ctrl, %a:i64 = entry
1312 %b:i64 = iconst 5
@@ -19,10 +18,9 @@ func @add_neg64:i64(i64) {
1918 # check: function `add_neg64`:
2019 # nextln: 000000: 55 push rbp
2120 # nextln: 000001: 48 89 e5 mov rbp, rsp
22- # nextln: 000004: 48 89 f8 mov rax, rdi
23- # nextln: 000007: 48 83 c0 fb add rax, -5
24- # nextln: 00000b: 5d pop rbp
25- # nextln: 00000c: c3 ret
21+ # nextln: 000004: 48 8d 47 fb lea rax, [rdi - 5]
22+ # nextln: 000008: 5d pop rbp
23+ # nextln: 000009: c3 ret
2624
2725 %c:ctrl, %a:i64 = entry
2826 %b:i64 = iconst 18446744073709551611
@@ -34,11 +32,10 @@ func @add_pos_large64:i64(i64) {
3432 # check: function `add_pos_large64`:
3533 # nextln: 000000: 55 push rbp
3634 # nextln: 000001: 48 89 e5 mov rbp, rsp
37- # nextln: 000004: 48 89 f8 mov rax, rdi
38- # nextln: 000007: b9 ff ff ff ff mov ecx, 0xffffffff
39- # nextln: 00000c: 48 03 c1 add rax, rcx
40- # nextln: 00000f: 5d pop rbp
41- # nextln: 000010: c3 ret
35+ # nextln: 000004: b8 ff ff ff ff mov eax, 0xffffffff
36+ # nextln: 000009: 48 03 c7 add rax, rdi
37+ # nextln: 00000c: 5d pop rbp
38+ # nextln: 00000d: c3 ret
4239
4340 %c:ctrl, %a:i64 = entry
4441 %b:i64 = iconst 4294967295
@@ -50,11 +47,10 @@ func @add_neg_large64:i64(i64) {
5047 # check: function `add_neg_large64`:
5148 # nextln: 000000: 55 push rbp
5249 # nextln: 000001: 48 89 e5 mov rbp, rsp
53- # nextln: 000004: 48 89 f8 mov rax, rdi
54- # nextln: 000007: 48 b9 01 00 00 00 ff ff ff ff movabs rcx, 0xffffffff00000001
55- # nextln: 000011: 48 03 c1 add rax, rcx
56- # nextln: 000014: 5d pop rbp
57- # nextln: 000015: c3 ret
50+ # nextln: 000004: 48 b8 01 00 00 00 ff ff ff ff movabs rax, 0xffffffff00000001
51+ # nextln: 00000e: 48 03 c7 add rax, rdi
52+ # nextln: 000011: 5d pop rbp
53+ # nextln: 000012: c3 ret
5854
5955 %c:ctrl, %a:i64 = entry
6056 %b:i64 = iconst 18446744069414584321
@@ -66,10 +62,9 @@ func @add_pos32:i32(i32) {
6662 # check: function `add_pos32`:
6763 # nextln: 000000: 55 push rbp
6864 # nextln: 000001: 48 89 e5 mov rbp, rsp
69- # nextln: 000004: 48 89 f8 mov rax, rdi
70- # nextln: 000007: 83 c0 05 add eax, 5
71- # nextln: 00000a: 5d pop rbp
72- # nextln: 00000b: c3 ret
65+ # nextln: 000004: 8d 47 05 lea eax, [rdi + 5]
66+ # nextln: 000007: 5d pop rbp
67+ # nextln: 000008: c3 ret
7368
7469 %c:ctrl, %a:i32 = entry
7570 %b:i32 = iconst 5
@@ -81,10 +76,9 @@ func @add_neg32:i32(i32) {
8176 # check: function `add_neg32`:
8277 # nextln: 000000: 55 push rbp
8378 # nextln: 000001: 48 89 e5 mov rbp, rsp
84- # nextln: 000004: 48 89 f8 mov rax, rdi
85- # nextln: 000007: 83 c0 fb add eax, -5
86- # nextln: 00000a: 5d pop rbp
87- # nextln: 00000b: c3 ret
79+ # nextln: 000004: 8d 47 fb lea eax, [rdi - 5]
80+ # nextln: 000007: 5d pop rbp
81+ # nextln: 000008: c3 ret
8882
8983 %c:ctrl, %a:i32 = entry
9084 %b:i32 = iconst 4294967291
@@ -96,10 +90,9 @@ func @add_max32:i32(i32) {
9690 # check: function `add_max32`:
9791 # nextln: 000000: 55 push rbp
9892 # nextln: 000001: 48 89 e5 mov rbp, rsp
99- # nextln: 000004: 48 89 f8 mov rax, rdi
100- # nextln: 000007: 81 c0 ff ff ff 7f add eax, 0x7fffffff
101- # nextln: 00000d: 5d pop rbp
102- # nextln: 00000e: c3 ret
93+ # nextln: 000004: 8d 87 ff ff ff 7f lea eax, [rdi + 0x7fffffff]
94+ # nextln: 00000a: 5d pop rbp
95+ # nextln: 00000b: c3 ret
10396
10497 %c:ctrl, %a:i32 = entry
10598 %b:i32 = iconst 2147483647
0 commit comments