Permalink
Browse files

Put ##not as a procedure back in until I figure out how to do it 'pro…

…perly'.
  • Loading branch information...
1 parent f35e29d commit 2956e762d045f34b464021344b4ce985c8a39ca1 @gnuvince gnuvince committed Jul 27, 2012
Showing with 11 additions and 25 deletions.
  1. +11 −25 gsc/_t-x86.scm
View
@@ -1048,35 +1048,21 @@
(define (generate-primitives cgc)
(let ((targ (codegen-context-target cgc)))
;; ##not
- ;; (let ((entry-label (nat-label-ref targ (lbl->id 1 "##not")))
- ;; (eq-label (make-temp-label cgc)))
- ;; (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-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-jmp cgc (vector-ref (nat-target-gvm-reg-map targ) 0))
+ (let ((entry-label (nat-label-ref targ (lbl->id 1 "##not")))
+ (eq-label (make-temp-label cgc)))
+ (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-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-jmp cgc (vector-ref (nat-target-gvm-reg-map targ) 0))
;; Update primitives table.
(let ((not-prim (x86-prim-info* '##not)))
- (proc-obj-inlinable?-set! not-prim #t)
- (proc-obj-jump-inlinable?-set! not-prim #t)
- (proc-obj-inline-set! not-prim
- (lambda (cgc)
- (let ((is-false-lbl (make-temp-label cgc))
- (end-if-lbl (make-temp-label cgc)))
- (x86-cmp cgc (vector-ref (nat-target-gvm-reg-map targ) 1) false)
- (x86-je cgc is-false-lbl)
- (x86-mov cgc (vector-ref (nat-target-gvm-reg-map targ) 1) true)
- (x86-jmp cgc end-if-lbl)
- (x86-label cgc is-false-lbl)
- (x86-mov cgc (vector-ref (nat-target-gvm-reg-map targ) 1) false)
- (x86-label cgc end-if-lbl))))
-
(proc-obj-test-set! not-prim
(lambda (cgc args true-lbl false-lbl)
(x86-cmp cgc (nat-opnd cgc (make-ctx targ #f) (car args)) false)
(x86-jne cgc false-lbl)
- (x86-jmp cgc true-lbl))))))
+ (x86-jmp cgc true-lbl)))))))

0 comments on commit 2956e76

Please sign in to comment.