projects
/
scheme.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4a6161c
)
Fix = codegen
author
Luke Lau
<luke_lau@icloud.com>
Mon, 29 Jul 2019 23:48:00 +0000
(
00:48
+0100)
committer
Luke Lau
<luke_lau@icloud.com>
Mon, 29 Jul 2019 23:48:00 +0000
(
00:48
+0100)
Use the sete instruction instead of the just plain wrong subtraction
method
codegen.scm
patch
|
blob
|
history
diff --git
a/codegen.scm
b/codegen.scm
index 00e01296af20661539f8fda3d882c6fa39547092..c73677325f899e064200b678182e6290d9fe6b2d 100644
(file)
--- a/
codegen.scm
+++ b/
codegen.scm
@@
-46,9
+46,9
@@
(codegen-expr a si env)
(emit "movq %rax, ~a(%rbp)" si)
(codegen-expr b (- si wordsize) env)
- (emit "
subq ~a(%rbp), %rax" si
)
- (emit "
not %rax"
)
- (emit "
andq $1, %rax
"))
+ (emit "
## ~a = ~b" a b
)
+ (emit "
cmpq ~a(%rbp), %rax" si
)
+ (emit "
sete %al
"))
; 'write file handle addr-string num-bytes