Permalink
Browse files

Changed call to ##not from x86-call to x86-jmp (added necessary push/…

…pop of r0)
  • Loading branch information...
1 parent 4228270 commit d6e59a6e7af671398e4eb5ed5b277c824eb5db2e @gnuvince gnuvince committed Jul 18, 2012
Showing with 9 additions and 4 deletions.
  1. +9 −4 gsc/_t-x86.scm
View
@@ -1048,19 +1048,24 @@
(let ((targ (codegen-context-target cgc)))
;; ##not
(let ((entry-label (nat-label-ref targ (lbl->id 1 "##not")))
- (eq-label (asm-make-label cgc (lbl->id 1 (symbol->string (gensym))))))
+ (eq-label (asm-make-label cgc (lbl->id 1 (symbol->string (gensym)))))
+ (ret-label (asm-make-label cgc (lbl->id 1 (symbol->string (gensym))))))
(x86-label cgc entry-label)
(x86-cmp cgc (vector-ref (nat-target-gvm-reg-map targ) 1) false)
(x86-je cgc eq-label)
(x86-mov cgc (vector-ref (nat-target-gvm-reg-map targ) 1) false)
- (x86-ret cgc)
+ (x86-jmp cgc (vector-ref (nat-target-gvm-reg-map targ) 0))
(x86-label cgc eq-label)
(x86-mov cgc (vector-ref (nat-target-gvm-reg-map targ) 1) true)
- (x86-ret cgc)
+ (x86-jmp cgc (vector-ref (nat-target-gvm-reg-map targ) 0))
(let ((not-prim (x86-prim-info* '##not)))
(proc-obj-test-set! not-prim
(lambda (cgc args)
- (x86-call cgc entry-label)))))))
+ (x86-push cgc (x86-esi))
+ (x86-mov cgc (x86-esi) (x86-imm-lbl ret-label))
+ (x86-jmp cgc entry-label)
+ (x86-label cgc ret-label)
+ (x86-pop cgc (x86-esi))))))))

0 comments on commit d6e59a6

Please sign in to comment.