diff options
| author | Gabriel Kerneis | 2014-02-07 12:00:08 +0000 |
|---|---|---|
| committer | Gabriel Kerneis | 2014-02-07 12:00:08 +0000 |
| commit | bf7ff7374afe6e01c1446a86d177d00193fa2784 (patch) | |
| tree | 7b0463a45c17e6d1c7d012e7f0b4ca33d2400c49 /src/test/power.sail | |
| parent | ede2cc7a69f8d025353ee9df75eca7da8a3cd0c3 (diff) | |
Use bit->bool coercion for power.sail
Diffstat (limited to 'src/test/power.sail')
| -rw-r--r-- | src/test/power.sail | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/test/power.sail b/src/test/power.sail index d693d08e..dc07f97e 100644 --- a/src/test/power.sail +++ b/src/test/power.sail @@ -4,9 +4,9 @@ val extern ( bit * bit ) -> bit effect pure (deinfix : ) = "vec_concat" val extern forall Type 'a . ( 'a * 'a ) -> bool effect pure (deinfix != ) = "neq" -val extern bit -> bool (* XXX *) effect pure (deinfix ~ ) = "bitwise-not" +val extern bit -> bit effect pure (deinfix ~ ) = "bitwise-not" val extern ( bit * bit ) -> bit effect pure (deinfix ^ ) = "bitwise-xor" -val extern ( bit * bit ) -> bool (* XXX *) effect pure (deinfix & ) = "bitwise-and" +val extern ( bit * bit ) -> bit effect pure (deinfix & ) = "bitwise-and" (* XXX sign extension *) function forall Type 'a . 'a exts ( x ) = x @@ -26,8 +26,8 @@ scattered function ast decode function clause execute ( Branch ( AA, LI, LK ) ) = { - if ( AA != bitzero ) then NIA := ( exts ( ( LI : 0b00 ) )) else NIA := ( CIA + ( exts ( ( LI : 0b00 ) )) ) ; - if ( LK != bitzero ) then LR := ( CIA + 4 ) ; + if AA then NIA := ( exts ( ( LI : 0b00 ) )) else NIA := ( CIA + ( exts ( ( LI : 0b00 ) )) ) ; + if LK then LR := ( CIA + 4 ) ; } @@ -43,9 +43,9 @@ scattered function ast decode ctr_ok := ( (( BO )[ 2 ]) | ( ( (( CTR )[ M .. 63 ]) != 0 ) ^ (( BO )[ 3 ]) ) ) ; cond_ok := ( (( BO )[ 0 ]) | ( (( CR )[ ( BI + 32 ) ]) ^ ( ~ ( (( BO )[ 1 ]) )) ) ) ; if ( ctr_ok & cond_ok ) then { - if ( AA != bitzero ) then NIA := ( exts ( ( BD : 0b00 ) )) else NIA := ( CIA + ( exts ( ( BD : 0b00 ) )) ) ; + if AA then NIA := ( exts ( ( BD : 0b00 ) )) else NIA := ( CIA + ( exts ( ( BD : 0b00 ) )) ) ; } ; - if ( LK != bitzero ) then LR := ( CIA + 4 ) ; + if LK then LR := ( CIA + 4 ) ; } @@ -61,7 +61,7 @@ scattered function ast decode ctr_ok := ( (( BO )[ 2 ]) | ( ( (( CTR )[ M .. 63 ]) != 0 ) ^ (( BO )[ 3 ]) ) ) ; cond_ok := ( (( BO )[ 0 ]) | ( (( CR )[ ( BI + 32 ) ]) ^ ( ~ ( (( BO )[ 1 ]) )) ) ) ; if ( ctr_ok & cond_ok ) then NIA := ( (( LR )[ 0 .. 61 ]) : 0b00 ) ; - if ( LK != bitzero ) then LR := ( CIA + 4 ) ; + if LK then LR := ( CIA + 4 ) ; } @@ -74,7 +74,7 @@ scattered function ast decode { cond_ok := ( (( BO )[ 0 ]) | ( (( CR )[ ( BI + 32 ) ]) ^ ( ~ ( (( BO )[ 1 ]) )) ) ) ; if cond_ok then NIA := ( (( CTR )[ 0 .. 61 ]) : 0b00 ) ; - if ( LK != bitzero ) then LR := ( CIA + 4 ) ; + if LK then LR := ( CIA + 4 ) ; } |
