diff --git a/src/ikarus.boot b/src/ikarus.boot index e96004e..9ff4ad1 100644 Binary files a/src/ikarus.boot and b/src/ikarus.boot differ diff --git a/src/libintelasm.ss b/src/libintelasm.ss index 1a056b7..2de3406 100644 --- a/src/libintelasm.ss +++ b/src/libintelasm.ss @@ -193,18 +193,20 @@ (cond [(int? n) (if (fixnum? n) - (list* (byte n) + (list* + (byte n) (byte (fxsra n 8)) (byte (fxsra n 16)) (byte (fxsra n 24)) ac) - (let ([lo (remainder n 256)] - [hi (quotient n 256)]) - (list* (byte lo) + (let* ([lo (remainder n 256)] + [hi (quotient (if (< n 0) (- n 255) n) 256)]) + (list* + (byte lo) (byte hi) (byte (fxsra hi 8)) (byte (fxsra hi 16)) - ac)))] + ac)))] [(obj? n) (let ([v (cadr n)]) (if (immediate? v) @@ -476,7 +478,7 @@ (cond [(and (imm8? src) (reg? dst)) (CODE #x83 (ModRM 3 '/0 dst (IMM8 src ac)))] - [(and (imm? src) (eq? dst '%eax)) + [(and (imm? src) (eq? dst '%eax)) (CODE #x05 (IMM32 src ac))] [(and (imm? src) (reg? dst)) (CODE #x81 (ModRM 3 '/0 dst (IMM32 src ac)))] diff --git a/src/racompiler.ss b/src/racompiler.ss index cad1f0e..a3a3b44 100755 --- a/src/racompiler.ss +++ b/src/racompiler.ss @@ -55,6 +55,16 @@ [boolean? 1 p] [char? 1 p] [not 1 not] + [$fx+ 2 v] + [$fx- 2 v] + [$fx* 2 v] + [$fxlogor 2 v] + [$fxlogand 2 v] + [$fx= 2 p] + [$fx< 2 p] + [$fx<= 2 p] + [$fx> 2 p] + [$fx>= 2 p] )) ;;; (define (primitive? x) @@ -202,8 +212,16 @@ (mkprm 'int= (V (car rands)) (immediate-rep 0))] [(null?) (mkprm 'int= (V (car rands)) (immediate-rep '()))] - [(eq?) + [(eq? $fx=) (mkprm 'int= (V (car rands)) (V (cadr rands)))] + [(eq? $fx<) + (mkprm 'int< (V (car rands)) (V (cadr rands)))] + [(eq? $fx<=) + (mkprm 'int<= (V (car rands)) (V (cadr rands)))] + [(eq? $fx>) + (mkprm 'int> (V (car rands)) (V (cadr rands)))] + [(eq? $fx>=) + (mkprm 'int>= (V (car rands)) (V (cadr rands)))] [else (error who "invalid value prim ~s" op)])] [else (error who "invalid value ~s" x)])) (define (V x) @@ -220,6 +238,33 @@ (mkprm 'int+ (V (car rands)) (immediate-rep 1))] [($fxsub1) (mkprm 'int+ (V (car rands)) (immediate-rep -1))] + [($fx+) + (mkprm 'int+ (V (car rands)) (V (cadr rands)))] + [($fxlogor) + (mkprm 'intor (V (car rands)) (V (cadr rands)))] + [($fxlogand) + (mkprm 'intand (V (car rands)) (V (cadr rands)))] + [($fx-) + (mkprm 'int- (V (car rands)) (V (cadr rands)))] + [($fx*) + (let ([a (car rands)] [b (cadr rands)]) + (let ([ai (record-case a + [(constant i) + (if (fixnum? i) i #f)] + [else #f])] + [bi (record-case b + [(constant i) + (if (fixnum? i) i #f)] + [else #f])]) + (cond + [ai + (mkprm 'int* (V b) (mkint ai))] + [bi + (mkprm 'int* (V a) (mkint bi))] + [else + (mkprm 'int* ;;; FIXME GC problem + (mkprm 'intsra (V a) (mkint fixnum-shift)) + (V b))])))] [($fxlognot) (mkprm 'intxor (V (car rands)) (immediate-rep -1))] [($char->fixnum) @@ -262,6 +307,14 @@ (case op [(int=) (prim 'int= 'int= (car rands) (cadr rands))] + [(int<) + (prim 'int< 'int> (car rands) (cadr rands))] + [(int<=) + (prim 'int<= 'int>= (car rands) (cadr rands))] + [(int>) + (prim 'int> 'int< (car rands) (cadr rands))] + [(int>=) + (prim 'int>= 'int<= (car rands) (cadr rands))] [else (error who "invalid pred prim ~s" op)])] [else (error who "invalid pred value ~s" x)])) (define (V x) @@ -283,12 +336,25 @@ (case op [(int+) (assoc 'int+ (car rands) (cadr rands))] + [(int*) + (assoc 'int* (car rands) (cadr rands))] [(intxor) (assoc 'intxor (car rands) (cadr rands))] [(intor) (assoc 'intor (car rands) (cadr rands))] [(intand) (assoc 'intand (car rands) (cadr rands))] + [(int-) + (let ([a (car rands)] [b (cadr rands)]) + (cond + [(simple? b) + (mkseq (V a) + (mkset rv-register (mkprm 'int- rv-register b)))] + [(simple? a) + (mkseq (mkseq (V b) + (mkset rv-register (mkprm 'intneg rv-register))) + (mkset rv-register (mkprm 'int+ rv-register a)))] + [else (error who "two complex operands ~s ~s" a b)]))] [(intsll intsra) (let ([a (car rands)] [b (cadr rands)]) (record-case b @@ -421,18 +487,18 @@ (record-case a [(reg ra) (cons `(cmpl ,(op b) ,(op a)) - (CJump (revcmp prim) lt lf ac))] + (CJump prim lt lf ac))] [(reg rb) (cons `(cmpl ,(op a) ,(op b)) - (CJump prim lt lf ac))] + (CJump (revcmp prim) lt lf ac))] [else (error who "invalid operands in pred ~s ~s" a b)]))] [else (error who "invalid pred ~s" x)])) - ;;; (define (Effect x ac) (define (primname x) (case x [(int+) 'addl] + [(int*) 'imull] [(intor) 'orl] [(intxor) 'xorl] [(intand) 'andl] @@ -456,7 +522,7 @@ [(constant c) (cons `(movl (obj ,c) ,(op targ)) ac)] [(primcall prim rands) (case prim - [(int+ intor intxor intand) + [(int+ intor intxor intand int*) (let ([asmprm (primname prim)]) (let ([a (car rands)] [b (cadr rands)]) (cond @@ -473,6 +539,18 @@ `(,asmprm ,(op a) ,(op targ)) ac)] [else (error who "invalid ops")])))] + [(int-) + (let ([a (car rands)] [b (cadr rands)]) + (cond + [(and (same? targ a) (indep? targ b)) + (cons `(subl ,(op b) ,(op a)) ac)] + [else (error who "invalid ops int-")]))] + [(intneg) + (let ([a (car rands)]) + (cond + [(same? targ a) + (cons `(negl ,(op a)) ac)] + [else (error who "invalid ops intneg")]))] [(intsll intsra) (let ([asmprm (primname prim)]) (let ([a (car rands)] [b (cadr rands)]) @@ -504,7 +582,8 @@ [else (error who "invalid tail prim ~s" op)])] [else (error who "invalid tail ~s" x)])) ;;; - (list (cons 0 (Tail x '())))) + (list (list* 0 + (Tail x '())))) ;;; (define (compile x) (let* ([x (parameterize ([expand-mode 'bootstrap] @@ -554,5 +633,6 @@ (load "tests/tests-1.2-req.scm") (load "tests/tests-1.3-req.scm") (load "tests/tests-1.4-req.scm") +(load "tests/tests-1.5-req.scm") (printf "ALL IS GOOD :-)\n") diff --git a/src/tests/tests-1.5-req.scm b/src/tests/tests-1.5-req.scm index 3b34d11..ee1678c 100644 --- a/src/tests/tests-1.5-req.scm +++ b/src/tests/tests-1.5-req.scm @@ -1,172 +1,173 @@ -(add-tests-with-string-output "fx+" - [(fx+ 1 2) => "3\n"] - [(fx+ 1 -2) => "-1\n"] - [(fx+ -1 2) => "1\n"] - [(fx+ -1 -2) => "-3\n"] - [(fx+ 536870911 -1) => "536870910\n"] - [(fx+ 536870910 1) => "536870911\n"] - [(fx+ -536870912 1) => "-536870911\n"] - [(fx+ -536870911 -1) => "-536870912\n"] - [(fx+ 536870911 -536870912) => "-1\n"] - [(fx+ 1 (fx+ 2 3)) => "6\n"] - [(fx+ 1 (fx+ 2 -3)) => "0\n"] - [(fx+ 1 (fx+ -2 3)) => "2\n"] - [(fx+ 1 (fx+ -2 -3)) => "-4\n"] - [(fx+ -1 (fx+ 2 3)) => "4\n"] - [(fx+ -1 (fx+ 2 -3)) => "-2\n"] - [(fx+ -1 (fx+ -2 3)) => "0\n"] - [(fx+ -1 (fx+ -2 -3)) => "-6\n"] - [(fx+ (fx+ 1 2) 3) => "6\n"] - [(fx+ (fx+ 1 2) -3) => "0\n"] - [(fx+ (fx+ 1 -2) 3) => "2\n"] - [(fx+ (fx+ 1 -2) -3) => "-4\n"] - [(fx+ (fx+ -1 2) 3) => "4\n"] - [(fx+ (fx+ -1 2) -3) => "-2\n"] - [(fx+ (fx+ -1 -2) 3) => "0\n"] - [(fx+ (fx+ -1 -2) -3) => "-6\n"] - [(fx+ (fx+ (fx+ (fx+ (fx+ (fx+ (fx+ (fx+ 1 2) 3) 4) 5) 6) 7) 8) 9) => "45\n"] - [(fx+ 1 (fx+ 2 (fx+ 3 (fx+ 4 (fx+ 5 (fx+ 6 (fx+ 7 (fx+ 8 9)))))))) => "45\n"] +(add-tests-with-string-output "$fx+" + [($fx+ 1 2) => "3\n"] + [($fx+ 1 -2) => "-1\n"] + [($fx+ -1 2) => "1\n"] + [($fx+ -1 -2) => "-3\n"] + [($fx+ 536870911 -1) => "536870910\n"] + [($fx+ 536870910 1) => "536870911\n"] + [($fx+ -536870912 1) => "-536870911\n"] + [($fx+ -536870911 0) => "-536870911\n"] + [($fx+ -536870911 -1) => "-536870912\n"] + [($fx+ 536870911 -536870912) => "-1\n"] + [($fx+ 1 ($fx+ 2 3)) => "6\n"] + [($fx+ 1 ($fx+ 2 -3)) => "0\n"] + [($fx+ 1 ($fx+ -2 3)) => "2\n"] + [($fx+ 1 ($fx+ -2 -3)) => "-4\n"] + [($fx+ -1 ($fx+ 2 3)) => "4\n"] + [($fx+ -1 ($fx+ 2 -3)) => "-2\n"] + [($fx+ -1 ($fx+ -2 3)) => "0\n"] + [($fx+ -1 ($fx+ -2 -3)) => "-6\n"] + [($fx+ ($fx+ 1 2) 3) => "6\n"] + [($fx+ ($fx+ 1 2) -3) => "0\n"] + [($fx+ ($fx+ 1 -2) 3) => "2\n"] + [($fx+ ($fx+ 1 -2) -3) => "-4\n"] + [($fx+ ($fx+ -1 2) 3) => "4\n"] + [($fx+ ($fx+ -1 2) -3) => "-2\n"] + [($fx+ ($fx+ -1 -2) 3) => "0\n"] + [($fx+ ($fx+ -1 -2) -3) => "-6\n"] + [($fx+ ($fx+ ($fx+ ($fx+ ($fx+ ($fx+ ($fx+ ($fx+ 1 2) 3) 4) 5) 6) 7) 8) 9) => "45\n"] + [($fx+ 1 ($fx+ 2 ($fx+ 3 ($fx+ 4 ($fx+ 5 ($fx+ 6 ($fx+ 7 ($fx+ 8 9)))))))) => "45\n"] ) -(add-tests-with-string-output "fx-" - [(fx- 1 2) => "-1\n"] - [(fx- 1 -2) => "3\n"] - [(fx- -1 2) => "-3\n"] - [(fx- -1 -2) => "1\n"] - [(fx- 536870910 -1) => "536870911\n"] - [(fx- 536870911 1) => "536870910\n"] - [(fx- -536870911 1) => "-536870912\n"] - [(fx- -536870912 -1) => "-536870911\n"] - [(fx- 1 536870911) => "-536870910\n"] - [(fx- -1 536870911) => "-536870912\n"] - [(fx- 1 -536870910) => "536870911\n"] - [(fx- -1 -536870912) => "536870911\n"] - [(fx- 536870911 536870911) => "0\n"] - ;[(fx- 536870911 -536870912) => "-1\n"] - [(fx- -536870911 -536870912) => "1\n"] - [(fx- 1 (fx- 2 3)) => "2\n"] - [(fx- 1 (fx- 2 -3)) => "-4\n"] - [(fx- 1 (fx- -2 3)) => "6\n"] - [(fx- 1 (fx- -2 -3)) => "0\n"] - [(fx- -1 (fx- 2 3)) => "0\n"] - [(fx- -1 (fx- 2 -3)) => "-6\n"] - [(fx- -1 (fx- -2 3)) => "4\n"] - [(fx- -1 (fx- -2 -3)) => "-2\n"] - [(fx- 0 (fx- -2 -3)) => "-1\n"] - [(fx- (fx- 1 2) 3) => "-4\n"] - [(fx- (fx- 1 2) -3) => "2\n"] - [(fx- (fx- 1 -2) 3) => "0\n"] - [(fx- (fx- 1 -2) -3) => "6\n"] - [(fx- (fx- -1 2) 3) => "-6\n"] - [(fx- (fx- -1 2) -3) => "0\n"] - [(fx- (fx- -1 -2) 3) => "-2\n"] - [(fx- (fx- -1 -2) -3) => "4\n"] - [(fx- (fx- (fx- (fx- (fx- (fx- (fx- (fx- 1 2) 3) 4) 5) 6) 7) 8) 9) => "-43\n"] - [(fx- 1 (fx- 2 (fx- 3 (fx- 4 (fx- 5 (fx- 6 (fx- 7 (fx- 8 9)))))))) => "5\n"] +(add-tests-with-string-output "$fx-" + [($fx- 1 2) => "-1\n"] + [($fx- 1 -2) => "3\n"] + [($fx- -1 2) => "-3\n"] + [($fx- -1 -2) => "1\n"] + [($fx- 536870910 -1) => "536870911\n"] + [($fx- 536870911 1) => "536870910\n"] + [($fx- -536870911 1) => "-536870912\n"] + [($fx- -536870912 -1) => "-536870911\n"] + [($fx- 1 536870911) => "-536870910\n"] + [($fx- -1 536870911) => "-536870912\n"] + [($fx- 1 -536870910) => "536870911\n"] + [($fx- -1 -536870912) => "536870911\n"] + [($fx- 536870911 536870911) => "0\n"] + ;[($fx- 536870911 -536870912) => "-1\n"] + [($fx- -536870911 -536870912) => "1\n"] + [($fx- 1 ($fx- 2 3)) => "2\n"] + [($fx- 1 ($fx- 2 -3)) => "-4\n"] + [($fx- 1 ($fx- -2 3)) => "6\n"] + [($fx- 1 ($fx- -2 -3)) => "0\n"] + [($fx- -1 ($fx- 2 3)) => "0\n"] + [($fx- -1 ($fx- 2 -3)) => "-6\n"] + [($fx- -1 ($fx- -2 3)) => "4\n"] + [($fx- -1 ($fx- -2 -3)) => "-2\n"] + [($fx- 0 ($fx- -2 -3)) => "-1\n"] + [($fx- ($fx- 1 2) 3) => "-4\n"] + [($fx- ($fx- 1 2) -3) => "2\n"] + [($fx- ($fx- 1 -2) 3) => "0\n"] + [($fx- ($fx- 1 -2) -3) => "6\n"] + [($fx- ($fx- -1 2) 3) => "-6\n"] + [($fx- ($fx- -1 2) -3) => "0\n"] + [($fx- ($fx- -1 -2) 3) => "-2\n"] + [($fx- ($fx- -1 -2) -3) => "4\n"] + [($fx- ($fx- ($fx- ($fx- ($fx- ($fx- ($fx- ($fx- 1 2) 3) 4) 5) 6) 7) 8) 9) => "-43\n"] + [($fx- 1 ($fx- 2 ($fx- 3 ($fx- 4 ($fx- 5 ($fx- 6 ($fx- 7 ($fx- 8 9)))))))) => "5\n"] ) -(add-tests-with-string-output "fx*" - [(fx* 2 3) => "6\n"] - [(fx* 2 -3) => "-6\n"] - [(fx* -2 3) => "-6\n"] - [(fx* -2 -3) => "6\n"] - [(fx* 536870911 1) => "536870911\n"] - [(fx* 536870911 -1) => "-536870911\n"] - [(fx* -536870912 1) => "-536870912\n"] - [(fx* -536870911 -1) => "536870911\n"] - [(fx* 2 (fx* 3 4)) => "24\n"] - [(fx* (fx* 2 3) 4) => "24\n"] - [(fx* (fx* (fx* (fx* (fx* 2 3) 4) 5) 6) 7) => "5040\n"] - [(fx* 2 (fx* 3 (fx* 4 (fx* 5 (fx* 6 7))))) => "5040\n"] +(add-tests-with-string-output "$fx*" + [($fx* 2 3) => "6\n"] + [($fx* 2 -3) => "-6\n"] + [($fx* -2 3) => "-6\n"] + [($fx* -2 -3) => "6\n"] + [($fx* 536870911 1) => "536870911\n"] + [($fx* 536870911 -1) => "-536870911\n"] + [($fx* -536870912 1) => "-536870912\n"] + [($fx* -536870911 -1) => "536870911\n"] + [($fx* 2 ($fx* 3 4)) => "24\n"] + [($fx* ($fx* 2 3) 4) => "24\n"] + [($fx* ($fx* ($fx* ($fx* ($fx* 2 3) 4) 5) 6) 7) => "5040\n"] + [($fx* 2 ($fx* 3 ($fx* 4 ($fx* 5 ($fx* 6 7))))) => "5040\n"] ) -(add-tests-with-string-output "fxlogand and fxlogor" - [(fxlogor 3 16) => "19\n"] - [(fxlogor 3 5) => "7\n"] - [(fxlogor 3 7) => "7\n"] - [(fxlognot (fxlogor (fxlognot 7) 1)) => "6\n"] - [(fxlognot (fxlogor 1 (fxlognot 7))) => "6\n"] - [(fxlogand 3 7) => "3\n"] - [(fxlogand 3 5) => "1\n"] - [(fxlogand 2346 (fxlognot 2346)) => "0\n"] - [(fxlogand (fxlognot 2346) 2346) => "0\n"] - [(fxlogand 2376 2376) => "2376\n"] +(add-tests-with-string-output "$fxlogand and $fxlogor" + [($fxlogor 3 16) => "19\n"] + [($fxlogor 3 5) => "7\n"] + [($fxlogor 3 7) => "7\n"] + [($fxlognot ($fxlogor ($fxlognot 7) 1)) => "6\n"] + [($fxlognot ($fxlogor 1 ($fxlognot 7))) => "6\n"] + [($fxlogand 3 7) => "3\n"] + [($fxlogand 3 5) => "1\n"] + [($fxlogand 2346 ($fxlognot 2346)) => "0\n"] + [($fxlogand ($fxlognot 2346) 2346) => "0\n"] + [($fxlogand 2376 2376) => "2376\n"] ) -(add-tests-with-string-output "fx=" - [(fx= 12 13) => "#f\n"] - [(fx= 12 12) => "#t\n"] - [(fx= 16 (fx+ 13 3)) => "#t\n"] - [(fx= 16 (fx+ 13 13)) => "#f\n"] - [(fx= (fx+ 13 3) 16) => "#t\n"] - [(fx= (fx+ 13 13) 16) => "#f\n"] +(add-tests-with-string-output "$fx=" + [($fx= 12 13) => "#f\n"] + [($fx= 12 12) => "#t\n"] + [($fx= 16 ($fx+ 13 3)) => "#t\n"] + [($fx= 16 ($fx+ 13 13)) => "#f\n"] + [($fx= ($fx+ 13 3) 16) => "#t\n"] + [($fx= ($fx+ 13 13) 16) => "#f\n"] ) -(add-tests-with-string-output "fx<" - [(fx< 12 13) => "#t\n"] - [(fx< 12 12) => "#f\n"] - [(fx< 13 12) => "#f\n"] - [(fx< 16 (fx+ 13 1)) => "#f\n"] - [(fx< 16 (fx+ 13 3)) => "#f\n"] - [(fx< 16 (fx+ 13 13)) => "#t\n"] - [(fx< (fx+ 13 1) 16) => "#t\n"] - [(fx< (fx+ 13 3) 16) => "#f\n"] - [(fx< (fx+ 13 13) 16) => "#f\n"] +(add-tests-with-string-output "$fx<" + [($fx< 12 13) => "#t\n"] + [($fx< 12 12) => "#f\n"] + [($fx< 13 12) => "#f\n"] + [($fx< 16 ($fx+ 13 1)) => "#f\n"] + [($fx< 16 ($fx+ 13 3)) => "#f\n"] + [($fx< 16 ($fx+ 13 13)) => "#t\n"] + [($fx< ($fx+ 13 1) 16) => "#t\n"] + [($fx< ($fx+ 13 3) 16) => "#f\n"] + [($fx< ($fx+ 13 13) 16) => "#f\n"] ) -(add-tests-with-string-output "fx<=" - [(fx<= 12 13) => "#t\n"] - [(fx<= 12 12) => "#t\n"] - [(fx<= 13 12) => "#f\n"] - [(fx<= 16 (fx+ 13 1)) => "#f\n"] - [(fx<= 16 (fx+ 13 3)) => "#t\n"] - [(fx<= 16 (fx+ 13 13)) => "#t\n"] - [(fx<= (fx+ 13 1) 16) => "#t\n"] - [(fx<= (fx+ 13 3) 16) => "#t\n"] - [(fx<= (fx+ 13 13) 16) => "#f\n"] +(add-tests-with-string-output "$fx<=" + [($fx<= 12 13) => "#t\n"] + [($fx<= 12 12) => "#t\n"] + [($fx<= 13 12) => "#f\n"] + [($fx<= 16 ($fx+ 13 1)) => "#f\n"] + [($fx<= 16 ($fx+ 13 3)) => "#t\n"] + [($fx<= 16 ($fx+ 13 13)) => "#t\n"] + [($fx<= ($fx+ 13 1) 16) => "#t\n"] + [($fx<= ($fx+ 13 3) 16) => "#t\n"] + [($fx<= ($fx+ 13 13) 16) => "#f\n"] ) -(add-tests-with-string-output "fx>" - [(fx> 12 13) => "#f\n"] - [(fx> 12 12) => "#f\n"] - [(fx> 13 12) => "#t\n"] - [(fx> 16 (fx+ 13 1)) => "#t\n"] - [(fx> 16 (fx+ 13 3)) => "#f\n"] - [(fx> 16 (fx+ 13 13)) => "#f\n"] - [(fx> (fx+ 13 1) 16) => "#f\n"] - [(fx> (fx+ 13 3) 16) => "#f\n"] - [(fx> (fx+ 13 13) 16) => "#t\n"] +(add-tests-with-string-output "$fx>" + [($fx> 12 13) => "#f\n"] + [($fx> 12 12) => "#f\n"] + [($fx> 13 12) => "#t\n"] + [($fx> 16 ($fx+ 13 1)) => "#t\n"] + [($fx> 16 ($fx+ 13 3)) => "#f\n"] + [($fx> 16 ($fx+ 13 13)) => "#f\n"] + [($fx> ($fx+ 13 1) 16) => "#f\n"] + [($fx> ($fx+ 13 3) 16) => "#f\n"] + [($fx> ($fx+ 13 13) 16) => "#t\n"] ) -(add-tests-with-string-output "fx>=" - [(fx>= 12 13) => "#f\n"] - [(fx>= 12 12) => "#t\n"] - [(fx>= 13 12) => "#t\n"] - [(fx>= 16 (fx+ 13 1)) => "#t\n"] - [(fx>= 16 (fx+ 13 3)) => "#t\n"] - [(fx>= 16 (fx+ 13 13)) => "#f\n"] - [(fx>= (fx+ 13 1) 16) => "#f\n"] - [(fx>= (fx+ 13 3) 16) => "#t\n"] - [(fx>= (fx+ 13 13) 16) => "#t\n"] +(add-tests-with-string-output "$fx>=" + [($fx>= 12 13) => "#f\n"] + [($fx>= 12 12) => "#t\n"] + [($fx>= 13 12) => "#t\n"] + [($fx>= 16 ($fx+ 13 1)) => "#t\n"] + [($fx>= 16 ($fx+ 13 3)) => "#t\n"] + [($fx>= 16 ($fx+ 13 13)) => "#f\n"] + [($fx>= ($fx+ 13 1) 16) => "#f\n"] + [($fx>= ($fx+ 13 3) 16) => "#t\n"] + [($fx>= ($fx+ 13 13) 16) => "#t\n"] ) (add-tests-with-string-output "if" - [(if (fx= 12 13) 12 13) => "13\n"] - [(if (fx= 12 12) 13 14) => "13\n"] - [(if (fx< 12 13) 12 13) => "12\n"] - [(if (fx< 12 12) 13 14) => "14\n"] - [(if (fx< 13 12) 13 14) => "14\n"] - [(if (fx<= 12 13) 12 13) => "12\n"] - [(if (fx<= 12 12) 12 13) => "12\n"] - [(if (fx<= 13 12) 13 14) => "14\n"] - [(if (fx> 12 13) 12 13) => "13\n"] - [(if (fx> 12 12) 12 13) => "13\n"] - [(if (fx> 13 12) 13 14) => "13\n"] - [(if (fx>= 12 13) 12 13) => "13\n"] - [(if (fx>= 12 12) 12 13) => "12\n"] - [(if (fx>= 13 12) 13 14) => "13\n"] + [(if ($fx= 12 13) 12 13) => "13\n"] + [(if ($fx= 12 12) 13 14) => "13\n"] + [(if ($fx< 12 13) 12 13) => "12\n"] + [(if ($fx< 12 12) 13 14) => "14\n"] + [(if ($fx< 13 12) 13 14) => "14\n"] + [(if ($fx<= 12 13) 12 13) => "12\n"] + [(if ($fx<= 12 12) 12 13) => "12\n"] + [(if ($fx<= 13 12) 13 14) => "14\n"] + [(if ($fx> 12 13) 12 13) => "13\n"] + [(if ($fx> 12 12) 12 13) => "13\n"] + [(if ($fx> 13 12) 13 14) => "13\n"] + [(if ($fx>= 12 13) 12 13) => "13\n"] + [(if ($fx>= 12 12) 12 13) => "12\n"] + [(if ($fx>= 13 12) 13 14) => "13\n"] )