Switch to -1 for true, 0 for false
This means you can use the bitwise operators for booleans too.
This commit is contained in:
12
wipforth.wat
12
wipforth.wat
@@ -345,6 +345,7 @@
|
|||||||
call $pop
|
call $pop
|
||||||
call $pop
|
call $pop
|
||||||
i32.eq
|
i32.eq
|
||||||
|
i32.const 0 i32.sub
|
||||||
call $push
|
call $push
|
||||||
call $next)
|
call $next)
|
||||||
|
|
||||||
@@ -352,6 +353,7 @@
|
|||||||
call $pop
|
call $pop
|
||||||
call $pop
|
call $pop
|
||||||
i32.ne
|
i32.ne
|
||||||
|
i32.const 0 i32.sub
|
||||||
call $push
|
call $push
|
||||||
call $next)
|
call $next)
|
||||||
|
|
||||||
@@ -361,6 +363,7 @@
|
|||||||
call $pop
|
call $pop
|
||||||
local.get $tmp
|
local.get $tmp
|
||||||
i32.lt_s
|
i32.lt_s
|
||||||
|
i32.const 0 i32.sub
|
||||||
call $push
|
call $push
|
||||||
call $next)
|
call $next)
|
||||||
|
|
||||||
@@ -370,6 +373,7 @@
|
|||||||
call $pop
|
call $pop
|
||||||
local.get $tmp
|
local.get $tmp
|
||||||
i32.gt_s
|
i32.gt_s
|
||||||
|
i32.const 0 i32.sub
|
||||||
call $push
|
call $push
|
||||||
call $next)
|
call $next)
|
||||||
|
|
||||||
@@ -379,6 +383,7 @@
|
|||||||
call $pop
|
call $pop
|
||||||
local.get $tmp
|
local.get $tmp
|
||||||
i32.le_s
|
i32.le_s
|
||||||
|
i32.const 0 i32.sub
|
||||||
call $push
|
call $push
|
||||||
call $next)
|
call $next)
|
||||||
|
|
||||||
@@ -388,12 +393,14 @@
|
|||||||
call $pop
|
call $pop
|
||||||
local.get $tmp
|
local.get $tmp
|
||||||
i32.ge_s
|
i32.ge_s
|
||||||
|
i32.const 0 i32.sub
|
||||||
call $push
|
call $push
|
||||||
call $next)
|
call $next)
|
||||||
|
|
||||||
(func $zeq
|
(func $zeq
|
||||||
call $pop
|
call $pop
|
||||||
i32.eqz
|
i32.eqz
|
||||||
|
i32.const 0 i32.sub
|
||||||
call $push
|
call $push
|
||||||
call $next)
|
call $next)
|
||||||
|
|
||||||
@@ -401,6 +408,7 @@
|
|||||||
call $pop
|
call $pop
|
||||||
i32.const 0
|
i32.const 0
|
||||||
i32.ne
|
i32.ne
|
||||||
|
i32.const 0 i32.sub
|
||||||
call $push
|
call $push
|
||||||
call $next)
|
call $next)
|
||||||
|
|
||||||
@@ -408,6 +416,7 @@
|
|||||||
call $pop
|
call $pop
|
||||||
i32.const 0
|
i32.const 0
|
||||||
i32.lt_s
|
i32.lt_s
|
||||||
|
i32.const 0 i32.sub
|
||||||
call $push
|
call $push
|
||||||
call $next)
|
call $next)
|
||||||
|
|
||||||
@@ -415,6 +424,7 @@
|
|||||||
call $pop
|
call $pop
|
||||||
i32.const 0
|
i32.const 0
|
||||||
i32.gt_s
|
i32.gt_s
|
||||||
|
i32.const 0 i32.sub
|
||||||
call $push
|
call $push
|
||||||
call $next)
|
call $next)
|
||||||
|
|
||||||
@@ -422,6 +432,7 @@
|
|||||||
call $pop
|
call $pop
|
||||||
i32.const 0
|
i32.const 0
|
||||||
i32.le_s
|
i32.le_s
|
||||||
|
i32.const 0 i32.sub
|
||||||
call $push
|
call $push
|
||||||
call $next)
|
call $next)
|
||||||
|
|
||||||
@@ -429,6 +440,7 @@
|
|||||||
call $pop
|
call $pop
|
||||||
i32.const 0
|
i32.const 0
|
||||||
i32.ge_s
|
i32.ge_s
|
||||||
|
i32.const 0 i32.sub
|
||||||
call $push
|
call $push
|
||||||
call $next)
|
call $next)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user