It seems as though the first line seems to have caught my eye.
In most languages, ~ is used for bitwise not, and not bitwise xor which
is given ^. Parrot seems to do things a tad differently. An analysis
of the generated pir shows how parrot treats it now.
.sub main
$I0 = 5
$I1 = 3
$I2 = ~$I0
$I3 = $I0 ~ $I1
$I4 = $I0 ~~ $I1
.end
main:
set I0, 5
set I1, 3
bnot I2, I0
bxor I3, I0, I1
xor I4, I0, I1
set_returns
returncc
Not, `bxor $I0, 0` is the same as `bnot $I0` so it's logical for that,
but it still seems odd that parrot's different. Is there a reason why
parrot's using ~ instead of ^ for xor?
On Oct 19, 2007, at 8:21 AM, [EMAIL PROTECTED] wrote:
Author: ambs
Date: Fri Oct 19 06:21:28 2007
New Revision: 22268
Modified:
trunk/docs/pdds/draft/pdd19_pir.pod
Log:
Added proposal for simple change on binary operators
Modified: trunk/docs/pdds/draft/pdd19_pir.pod
=======================================================================
=======
--- trunk/docs/pdds/draft/pdd19_pir.pod (original)
+++ trunk/docs/pdds/draft/pdd19_pir.pod Fri Oct 19 06:21:28 2007
@@ -534,6 +534,9 @@
B<&>, B<|> and B<~> are binary B<band>, B<bor> and B<bxor>.
+{{PROPOSAL: Change description to support logic operators
(comparisons) as
+implemented (and working) in imcc.y.}}
+
=item <var1> <op>= <var2>
This is equivalent to