summaryrefslogtreecommitdiff
path: root/04/in03
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-01-21 23:24:18 -0500
committerpommicket <pommicket@gmail.com>2022-01-21 23:24:18 -0500
commit08c49a193fd0167da3f65de7998106fbef3e337d (patch)
tree9158e2d1b27e3b5ab102a90a984613ac690ade38 /04/in03
parenta7ace346b76f4135ee7d6d9e9b49dc196e15c7d5 (diff)
more consterxprs
Diffstat (limited to '04/in03')
-rw-r--r--04/in0329
1 files changed, 10 insertions, 19 deletions
diff --git a/04/in03 b/04/in03
index 99b3c6e..a0cee4f 100644
--- a/04/in03
+++ b/04/in03
@@ -1005,7 +1005,7 @@ align
I=:line
call :set_rax_to_rvalue
call :set_rbx_to_rdi
- call :emit_zero_rdx_idiv_rbx
+ call :emit_cqo_idiv_rbx
I=:line
call :set_lvalue_to_rax
!:read_line
@@ -1014,7 +1014,7 @@ align
I=:line
call :set_rax_to_rvalue
call :set_rbx_to_rdi
- call :emit_zero_rdx_idiv_rbx
+ call :emit_cqo_idiv_rbx
call :set_rax_to_rdx
I=:line
call :set_lvalue_to_rax
@@ -1475,11 +1475,11 @@ align
:rvalue_div
call :set_rbx_to_rsi
- !:emit_zero_rdx_idiv_rbx
+ !:emit_cqo_idiv_rbx
:rvalue_rem
call :set_rbx_to_rsi
- call :emit_zero_rdx_idiv_rbx
+ call :emit_cqo_idiv_rbx
call :set_rax_to_rdx
return
@@ -1745,16 +1745,6 @@ align
x31
xc0
-:zero_rdx
- J=d4
- I=:xor_edx_edx
- D=d2
- syscall x1
- return
-:xor_edx_edx
- x31
- xd2
-
:set_rbx_to_rax
J=d4
I=:mov_rbx_rax
@@ -2014,14 +2004,15 @@ align
xf7
xeb
-:emit_zero_rdx_idiv_rbx
- call :zero_rdx
+:emit_cqo_idiv_rbx
J=d4
- I=:idiv_rbx
- D=d3
+ I=:cqo_idiv_rbx
+ D=d5
syscall x1
return
-:idiv_rbx
+:cqo_idiv_rbx
+ x48
+ x99
x48
xf7
xfb