|
|
Author: particle
Date: Tue Dec 11 06:51:07 2007
New Revision: 23742
Modified:
branches/punie-devel/languages/punie/lib/builtins.pir
branches/punie-devel/languages/punie/lib/punie.pg
Log:
[punie]: implemented logical ops; t/op_math.t passes
Modified: branches/punie-devel/languages/punie/lib/builtins.pir
==============================================================================
--- branches/punie-devel/languages/punie/lib/builtins.pir (original)
+++ branches/punie-devel/languages/punie/lib/builtins.pir Tue Dec 11
06:51:07 2007
@@ -139,6 +139,51 @@
.return ($S0)
.end
+.sub 'infix:<<'
+ .param int a
+ .param int b
+ $I0 = shl a, b
+ $P0 = new 'Integer'
+ $P0 = $I0
+ .return ($P0)
+.end
+
+.sub 'infix:>>'
+ .param int a
+ .param int b
+ $I0 = shr a, b
+ $P0 = new 'Integer'
+ $P0 = $I0
+ .return ($P0)
+.end
+
+.sub 'infix:&'
+ .param int a
+ .param int b
+ $I0 = band a, b
+ $P0 = new 'Integer'
+ $P0 = $I0
+ .return ($P0)
+.end
+
+.sub 'infix:|'
+ .param int a
+ .param int b
+ $I0 = bor a, b
+ $P0 = new 'Integer'
+ $P0 = $I0
+ .return ($P0)
+.end
+
+.sub 'infix:^'
+ .param int a
+ .param int b
+ $I0 = bxor a, b
+ $P0 = new 'Integer'
+ $P0 = $I0
+ .return ($P0)
+.end
+
.sub 'print'
.param pmc list :slurpy
.local pmc iter
Modified: branches/punie-devel/languages/punie/lib/punie.pg
==============================================================================
--- branches/punie-devel/languages/punie/lib/punie.pg (original)
+++ branches/punie-devel/languages/punie/lib/punie.pg Tue Dec 11 06:51:07 2007
@@ -106,11 +106,11 @@
{...}
proto infix:Â<<Â is looser(infix:<+>)
- is pirop('shl')
+# is pirop('shl') # XXX pirop()s with non PREG destinations don't work yet
{...}
proto infix:Â>>Â is equiv(infix:Â<<Â)
- is pirop('shr')
+# is pirop('shr') # XXX pirop()s with non PREG destinations don't work yet
{...}
proto infix:Â<Â is looser(infix:Â<<Â) is assoc('non') {...}
@@ -131,15 +131,15 @@
{...}
proto infix:<&> is looser(infix:<==>) is assoc('left')
- is pirop('band')
+# is pirop('band') # XXX pirop()s with non PREG destinations don't work yet
{...}
proto infix:<|> is looser(infix:<&>) is assoc('left')
- is pirop('bor')
+# is pirop('bor') # XXX pirop()s with non PREG destinations don't work yet
{...}
proto infix:<^> is equiv(infix:<|>) is assoc('left')
- is pirop('bxor')
+# is pirop('bxor') # XXX pirop()s with non PREG destinations don't work yet
{...}
proto infix:<&&> is looser(infix:<|>) is assoc('left')
|
|