Changes between Version 5 and Version 6 of PrimBool
 Timestamp:
 Jan 25, 2013 10:22:47 AM (3 years ago)
Legend:
 Unmodified
 Added
 Removed
 Modified

PrimBool
v5 v6 33 33 {{{ 34 34 case <# x 0 of _ { 35 36 37 38 39 40 41 42 43 44 45 46 47 48 35 False > 36 case >=# x width of _ { 37 False > 38 case <# y 0 of _ { 39 False > 40 case >=# y height of _ { 41 False > E2 42 True > E1 43 }; 44 True > E1 45 }; 46 True > E1 47 }; 48 True > E1 49 49 }; 50 50 }}} … … 54 54 {{{ 55 55 .Lc1rf: 56 57 58 59 60 61 62 63 64 65 56 testq %r14,%r14 57 jl .Lc1rk 58 cmpq %rdi,%r14 59 jge .Lc1rp 60 testq %rsi,%rsi 61 jl .Lc1ru 62 cmpq %r8,%rsi 63 jge .Lc1rz 64 movl $Main_g2_closure+1,%ebx 65 jmp *0(%rbp) 66 66 .Lc1rk: 67 68 67 movl $Main_g1_closure+1,%ebx 68 jmp *0(%rbp) 69 69 .Lc1rp: 70 71 70 movl $Main_g1_closure+1,%ebx 71 jmp *0(%rbp) 72 72 .Lc1ru: 73 74 73 movl $Main_g1_closure+1,%ebx 74 jmp *0(%rbp) 75 75 .Lc1rz: 76 77 76 movl $Main_g1_closure+1,%ebx 77 jmp *0(%rbp) 78 78 }}} 79 79 … … 83 83 84 84 Unnecessary branches could be eliminated by introducing primitive logical operators AND, OR and NOT (they will be denoted as `#`, `&&#` and `not#` respectively). These operators would be strict and treat their logical parameters as unboxed integers (`1#` for `True` and `0#` for `False`). Result would be produced by using lowlevel bitwise operations. This means that if logical operators were chained together like in a given example only the final result would have to be inspected and thus only one branch would be necessary. 85 86 Note (Jan Stolarek): My first thought was that introducing primitve logical operators will require changing `Bool` data type to a primitive unboxed version. This might not be the case. Please treat two solution apporaches as possibly wrong. 85 87 86 88 === First approach ===