Brent Dax wrote: > > Jeff: > # I haven't been tracking assembly speed at all. Keep in mind > # that a perl assembler is only a temporary measure, and it'll > # be rewritten in C eventually. It's only written in Perl so > > C or PASM (or Perl 6)? The latter might be better.
PASM is tempting, if only for the bootstrap potential... In other news, I've rewritten the test suite, and with the most recent checkin (adds one PMC type I missed and stops processing when it encounters a flying argument), it passes everything but one Regex test. The diffs are rather large, and will be attached to this file. If there are no objections, I might simply spruce up the documentation, add a '.include' statement, and change assemble.pl over to this style, after going through the rest of the languages/ directory. Of course, the people that are responsible for their language could do it themselves, letting me get back to converting the assembler to .pasm or maybe just ..c or .perl... -- Jeff <[EMAIL PROTECTED]>
diff -ru parrot_foo/t/op/ifunless.t parrot/t/op/ifunless.t --- parrot_foo/t/op/ifunless.t Tue May 28 21:34:07 2002 +++ parrot/t/op/ifunless.t Fri May 17 23:52:34 2002 @@ -7,18 +7,21 @@ set I1, -2147483648 set I2, 0 +# if_i_ic I0, ONE if I0, ONE branch ERROR print "bad\\n" ONE: print "ok 1\\n" +# if_i_ic I1, TWO if I1, TWO branch ERROR print "bad\\n" TWO: print "ok 2\\n" +# if_i_ic I2, ERROR if I2, ERROR branch THREE print "bad\\n" @@ -100,12 +103,14 @@ set I0, 0 set I1, -2147483648 +# unless_i_ic I0, ONE unless I0, ONE branch ERROR print "bad\\n" ONE: print "ok 1\\n" +# unless_i_ic I1, ERROR unless I1, ERROR branch TWO print "bad\\n" diff -ru parrot_foo/t/op/integer.t parrot/t/op/integer.t --- parrot_foo/t/op/integer.t Tue May 28 21:36:53 2002 +++ parrot/t/op/integer.t Fri May 17 23:52:34 2002 @@ -340,6 +340,7 @@ output_is(<<CODE, <<OUTPUT, "cmod_i"); set I0, 5 set I1, 3 +# cmod_i I2, I0, I1 cmod I2, I0, I1 print I2 print "\\n" diff -ru parrot_foo/t/op/macro.t parrot/t/op/macro.t --- parrot_foo/t/op/macro.t Tue May 28 21:40:34 2002 +++ parrot/t/op/macro.t Wed May 15 23:18:48 2002 @@ -4,21 +4,21 @@ use Test::More; output_is( <<'CODE', <<OUTPUT, "macro, zero parameters" ); -.macro answer() +answer macro print 42 print "\n" -.endm - .answer() +endm + answer end CODE 42 OUTPUT output_is( <<'CODE', <<OUTPUT, "macro, one unused parameter, literal term" ); -.macro answer(A) +answer macro A print 42 -.endm - .answer(42) +endm + answer 42 print "\n" end CODE @@ -26,11 +26,11 @@ OUTPUT output_is( <<'CODE', <<OUTPUT, "macro, one unused parameter, register term" ); -.macro answer(A) +answer macro A print 42 -.endm +endm set I0, 43 - .answer(I0) + answer I0 print "\n" end CODE @@ -38,10 +38,10 @@ OUTPUT output_is( <<'CODE', <<OUTPUT, "macro, one used parameter, literal" ); -.macro answer(A) - print .A -.endm - .answer(42) +answer macro A + print A +endm + answer 42 print "\n" end CODE @@ -51,10 +51,10 @@ SKIP: { skip("Await exceptions", 1); output_is( <<'CODE', <<OUTPUT, "macro, one parameter in call, not in def" ); -.macro answer(A) - print .A -.endm - .answer(42) +answer macro + print A +endm + answer 42 print "\n" end CODE @@ -63,11 +63,11 @@ } output_is( <<'CODE', <<OUTPUT, "macro, one used parameter, register" ); -.macro answer(A) - print .A -.endm +answer macro A + print A +endm set I0,42 - .answer(I0) + answer I0 print "\n" end CODE @@ -75,14 +75,14 @@ OUTPUT output_is( <<'CODE', <<OUTPUT, "macro, one used parameter, called twice" ); -.macro answer(A) - print .A +answer macro A + print A print "\n" - inc .A -.endm + inc A +endm set I0,42 - .answer(I0) - .answer(I0) + answer I0 + answer I0 end CODE 42 @@ -90,29 +90,29 @@ OUTPUT output_is( <<'CODE', <<OUTPUT, "macro, one used parameter, label" ); -.macro answer(A) - ne I0,42,.$done - print .A +answer macro A + ne I0,42,$done + print A print "\n" -.local $done: -.endm +$done: +endm set I0,42 - .answer(I0) + answer I0 end CODE 42 OUTPUT output_is( <<'CODE', <<OUTPUT, "macro, one used parameter run twice, label" ); -.macro answer(A) - ne I0,42,.$done - print .A +answer macro A + ne I0,42,$done + print A print "\n" -.local $done: -.endm +$done: +endm set I0,42 - .answer(I0) - .answer(I0) + answer I0 + answer I0 end CODE 42 diff -ru parrot_foo/t/op/rx.t parrot/t/op/rx.t --- parrot_foo/t/op/rx.t Tue May 28 21:45:03 2002 +++ parrot/t/op/rx.t Sun Mar 10 16:58:59 2002 @@ -10,10 +10,10 @@ rx_allocinfo P0, S0 bsr RX_0 rx_info_successful P0, I0 - if I0, YUP + if I0, \$yup print "no match\\n" end - YUP: + \$yup: rx_info_getstartindex P0, I1 rx_info_getindex P0, I2 length I3, S0 @@ -38,122 +38,122 @@ RX_0: rx_setprops P0, "$_[2]", $_[3] - branch START - ADVANCE: - rx_advance P0, FAIL - START: + branch \$start + \$advance: + rx_advance P0, \$fail + \$start: $_[1] rx_succeed P0 ret - FAIL: + \$fail: rx_fail P0 ret END } output_is(gentest('a', <<'CODE'), <<'OUTPUT', 'A is A'); - rx_literal P0, "a", ADVANCE + rx_literal P0, "a", $advance CODE <><a><> OUTPUT output_is(gentest('b', <<'CODE'), <<'OUTPUT', 'A is not B'); - rx_literal P0, "a", ADVANCE + rx_literal P0, "a", $advance CODE no match OUTPUT output_is(gentest('a', <<'CODE'), <<'OUTPUT', 'Pattern longer than string'); - rx_literal P0, "aa", ADVANCE + rx_literal P0, "aa", $advance CODE no match OUTPUT output_is(gentest('ba', <<'CODE'), <<'OUTPUT', 'inching through the string'); - rx_literal P0, "a", ADVANCE + rx_literal P0, "a", $advance CODE <b><a><> OUTPUT output_is(gentest('a', <<'CODE'), <<'OUTPUT', 'character classes (successful)'); - rx_oneof P0, "aeiou", ADVANCE + rx_oneof P0, "aeiou", $advance CODE <><a><> OUTPUT output_is(gentest('b', <<'CODE'), <<'OUTPUT', 'character classes (failure)'); - rx_oneof P0, "aeiou", ADVANCE + rx_oneof P0, "aeiou", $advance CODE no match OUTPUT output_is(gentest('a', <<'CODE'), <<'OUTPUT', 'dot (success)'); - rx_dot P0, ADVANCE + rx_dot P0, $advance CODE <><a><> OUTPUT output_is(gentest('\n', <<'CODE'), <<'OUTPUT', 'dot (failure)'); - rx_dot P0, ADVANCE + rx_dot P0, $advance CODE no match OUTPUT output_is(gentest('aA9_', <<'CODE'), <<'OUTPUT', '\w (success)'); - rx_is_w P0, ADVANCE - rx_is_w P0, ADVANCE - rx_is_w P0, ADVANCE - rx_is_w P0, ADVANCE + rx_is_w P0, $advance + rx_is_w P0, $advance + rx_is_w P0, $advance + rx_is_w P0, $advance CODE <><aA9_><> OUTPUT output_is(gentest('?', <<'CODE'), <<'OUTPUT', '\w (failure)'); - rx_is_w P0, ADVANCE + rx_is_w P0, $advance CODE no match OUTPUT output_is(gentest('0123456789', <<'CODE'), <<'OUTPUT', '\d (success)'); - rx_is_d P0, ADVANCE - rx_is_d P0, ADVANCE - rx_is_d P0, ADVANCE - rx_is_d P0, ADVANCE - rx_is_d P0, ADVANCE - rx_is_d P0, ADVANCE - rx_is_d P0, ADVANCE - rx_is_d P0, ADVANCE - rx_is_d P0, ADVANCE - rx_is_d P0, ADVANCE + rx_is_d P0, $advance + rx_is_d P0, $advance + rx_is_d P0, $advance + rx_is_d P0, $advance + rx_is_d P0, $advance + rx_is_d P0, $advance + rx_is_d P0, $advance + rx_is_d P0, $advance + rx_is_d P0, $advance + rx_is_d P0, $advance CODE <><0123456789><> OUTPUT output_is(gentest('@?#', <<'CODE'), <<'OUTPUT', '\d (failure)'); - rx_is_d P0, ADVANCE - rx_is_d P0, ADVANCE - rx_is_d P0, ADVANCE + rx_is_d P0, $advance + rx_is_d P0, $advance + rx_is_d P0, $advance CODE no match OUTPUT output_is(gentest(' ', <<'CODE'), <<'OUTPUT', '\s (success)'); - rx_is_s P0, ADVANCE + rx_is_s P0, $advance CODE <>< ><> OUTPUT output_is(gentest('a', <<'CODE'), <<'OUTPUT', '\s (failure)'); - rx_is_s P0, ADVANCE + rx_is_s P0, $advance CODE no match OUTPUT output_is(gentest('a', <<'CODE'), <<'OUTPUT', 'stack (pushindex/popindex)'); rx_pushindex P0 - rx_literal P0, "a", ADVANCE - rx_popindex P0, ADVANCE + rx_literal P0, "a", $advance + rx_popindex P0, $advance CODE <><><a> OUTPUT @@ -161,9 +161,9 @@ output_is(gentest('a', <<'CODE'), <<'OUTPUT', 'stack (pushmark)'); rx_pushmark P0 rx_pushindex P0 - rx_literal P0, "a", ADVANCE - rx_popindex P0, ADVANCE - rx_popindex P0, ADVANCE + rx_literal P0, "a", $advance + rx_popindex P0, $advance + rx_popindex P0, $advance CODE no match OUTPUT @@ -171,7 +171,7 @@ SKIP: { skip("Arrays are still wacky", 1); output_is(gentest('a', <<'CODE'), <<'OUTPUT', 'groups'); rx_startgroup P0, 0 - rx_literal P0, "a", ADVANCE + rx_literal P0, "a", $advance rx_endgroup P0, 0 rx_info_getgroup P0, I1, I2, 0 @@ -187,65 +187,65 @@ } output_is(gentest('a', <<'CODE'), <<'OUTPUT', 'ZWA: ^ (success)'); - rx_zwa_atbeginning P0, ADVANCE - rx_literal P0, "a", ADVANCE + rx_zwa_atbeginning P0, $advance + rx_literal P0, "a", $advance CODE <><a><> OUTPUT output_is(gentest('b', <<'CODE'), <<'OUTPUT', 'ZWA: ^ (failure)'); - rx_zwa_atbeginning P0, ADVANCE - rx_literal P0, "a", ADVANCE + rx_zwa_atbeginning P0, $advance + rx_literal P0, "a", $advance CODE no match OUTPUT output_is(gentest('a', <<'CODE'), <<'OUTPUT', 'ZWA: $ (success)'); - rx_literal P0, "a", ADVANCE - rx_zwa_atend P0, ADVANCE + rx_literal P0, "a", $advance + rx_zwa_atend P0, $advance CODE <><a><> OUTPUT output_is(gentest('ab', <<'CODE'), <<'OUTPUT', 'ZWA: $ (failure)'); - rx_literal P0, "a", ADVANCE - rx_zwa_atend P0, ADVANCE + rx_literal P0, "a", $advance + rx_zwa_atend P0, $advance CODE no match OUTPUT output_is(gentest('a?', <<'CODE'), <<'OUTPUT', 'ZWA: \b (success)'); - rx_literal P0, "a", ADVANCE - rx_zwa_boundary P0, ADVANCE + rx_literal P0, "a", $advance + rx_zwa_boundary P0, $advance CODE <><a><?> OUTPUT output_is(gentest('ab', <<'CODE'), <<'OUTPUT', 'ZWA: \b (failure)'); - rx_literal P0, "a", ADVANCE - rx_zwa_boundary P0, ADVANCE + rx_literal P0, "a", $advance + rx_zwa_boundary P0, $advance CODE no match OUTPUT output_is(gentest('ba', <<'CODE', 'r'), <<'OUTPUT', 'reversed regexen (/r)'); - rx_dot P0, ADVANCE + rx_dot P0, $advance CODE <b><a><> OUTPUT output_is(gentest('\n', <<'CODE', 's'), <<'OUTPUT', 'single-line regexen (/s)'); - rx_dot P0, ADVANCE + rx_dot P0, $advance CODE <>< ><> OUTPUT output_is(gentest('\n\n', <<'CODE', 'm'), <<'OUTPUT', 'multiline regexen (/m)'); - rx_literal P0, "\n", ADVANCE - rx_zwa_atbeginning P0, ADVANCE - rx_zwa_atend P0, ADVANCE + rx_literal P0, "\n", $advance + rx_zwa_atbeginning P0, $advance + rx_zwa_atend P0, $advance CODE <>< >< @@ -255,9 +255,9 @@ SKIP: { skip("Pending some sort of lowercasing op",1); output_is(gentest('HeLlO', <<'CODE', 'i'), <<'OUTPUT', 'case-insensitive regexen (/i)'); - rx_literal P0, "hel", ADVANCE - rx_oneof P0, "lmno", ADVANCE - rx_oneof P0, "lmno", ADVANCE + rx_literal P0, "hel", $advance + rx_oneof P0, "lmno", $advance + rx_oneof P0, "lmno", $advance CODE <><HeLlO><> OUTPUT diff -ru parrot_foo/t/op/stacks.t parrot/t/op/stacks.t --- parrot_foo/t/op/stacks.t Tue May 28 22:21:34 2002 +++ parrot/t/op/stacks.t Fri May 17 23:52:34 2002 @@ -18,46 +18,46 @@ # to LABEL if abs(n,n) < epsilon my $fp_equality_macro = <<'ENDOFMACRO'; -.macro fp_eq(J,K,L) +fp_eq macro J,K,L save N0 save N1 save N2 - set N0, .J - set N1, .K + set N0, J + set N1, K sub N2, N1,N0 abs N2, N2 - gt N2, 0.000001, .$FPEQNOK + gt N2, 0.000001, $FPEQNOK restore N2 restore N1 restore N0 - branch .L -.local $FPEQNOK: + branch L +$FPEQNOK: restore N2 restore N1 restore N0 -.endm -.macro fp_ne(J,K,L) +endm +fp_ne macro J,K,L save N0 save N1 save N2 - set N0, .J - set N1, .K + set N0, J + set N1, K sub N2, N1,N0 abs N2, N2 - lt N2, 0.000001, .$FPNENOK + lt N2, 0.000001, $FPNENOK restore N2 restore N1 restore N0 - branch .L -.local $FPNENOK: + branch L +$FPNENOK: restore N2 restore N1 restore N0 -.endm +endm ENDOFMACRO ############### Tests ################## @@ -157,10 +157,10 @@ output_is(<<"CODE", <<'OUTPUT', 'pushp & popp'); - new P0, .PerlString + new P0, PerlString set P0, "BUTTER IN HELL!\\n" pushp - new P0, .PerlString + new P0, PerlString set P0, "THERE'LL BE NO " print P0 popp @@ -173,8 +173,8 @@ ($code, $output) = (); for (0..1024) { - $code .= " new P0, .PerlString\n"; - $code .= " new P31, .PerlString\n"; + $code .= " new P0, PerlString\n"; + $code .= " new P31, PerlString\n"; $code .= " set P0, \"$_\"\n"; $code .= " set P31, \"" . (1024-$_) . "\"\n"; $code .= " pushp\n"; @@ -483,11 +483,11 @@ set N0, 1.0 save N0 set N0, 2.0 - .fp_eq (N0, 2.0, EQ1) + fp_eq N0, 2.0, EQ1 print "not " EQ1: print "equal to 2.0\\n" restore N0 - .fp_eq (N0, 1.0, EQ2) + fp_eq N0, 1.0, EQ2 print "not " EQ2: print "equal to 1.0\\n" @@ -505,7 +505,7 @@ save 3.14159 restore N0 - .fp_eq (N0, 3.14159, EQ3) + fp_eq N0, 3.14159, EQ3 print "<kansas> not " EQ3: print "equal to PI\\n" @@ -513,10 +513,10 @@ restore S0 print S0 - new P0, .PerlString + new P0, PerlString set P0, "never to escape\\n" save P0 - new P0, .PerlString + new P0, PerlString set P0, "find themselves caught in a loop\\n" print P0 restore P0 @@ -541,7 +541,7 @@ set I0, 12 set N0, 0.1 set S0, "Difference Engine #2" - new P0, .PerlString + new P0, PerlString set P0, "Shalmaneser" save P0 diff -ru parrot_foo/t/op/string.t parrot/t/op/string.t --- parrot_foo/t/op/string.t Tue May 28 21:48:47 2002 +++ parrot/t/op/string.t Wed May 15 23:18:48 2002 @@ -566,7 +566,7 @@ output_is(<<CODE, <<OUTPUT, "eq_s|sc_s|sc"); - set S0, "Spartacus" + set S0, "Sparticus" bsr TEST1 print "ok 1\\n" bsr TEST2 @@ -577,11 +577,11 @@ print "ok 4\\n" end -TEST1: eq "Spartacus", S0 +TEST1: eq "Sparticus", S0 print "not " ret -TEST2: eq S0, "Spartacus" +TEST2: eq S0, "Sparticus" print "not " ret @@ -589,7 +589,7 @@ print "not " ret -TEST4: eq "Spartacus", "Spartacus" +TEST4: eq "Sparticus", "Sparticus" print "not " ret diff -ru parrot_foo/t/op/time.t parrot/t/op/time.t --- parrot_foo/t/op/time.t Tue May 28 22:23:11 2002 +++ parrot/t/op/time.t Sun Mar 10 18:40:03 2002 @@ -28,7 +28,7 @@ output_is(<<'CODE', <<'OUTPUT', "time_n"); time N0 time N1 - ge N0, 0.0, OK1 + ge N0, 0, OK1 branch FAIL OK1: print "ok, (!= 1970) Grateful Dead not\n" ge N1, N0, OK2 diff -ru parrot_foo/t/op/trans.t parrot/t/op/trans.t --- parrot_foo/t/op/trans.t Tue May 28 21:56:25 2002 +++ parrot/t/op/trans.t Fri Dec 14 12:39:11 2001 @@ -10,33 +10,33 @@ # to LABEL if abs(n,n) < epsilon my $fp_equality_macro = <<'ENDOFMACRO'; -.macro fp_eq(J,K,L) +fp_eq macro J,K,L save N0 save N1 save N2 - set N0, .J - set N1, .K + set N0, J + set N1, K sub N2, N1,N0 abs N2, N2 - gt N2, 0.000001, .$FPEQNOK + gt N2, 0.000001, $FPEQNOK restore N2 restore N1 restore N0 - branch .L -.local $FPEQNOK: + branch L +$FPEQNOK: restore N2 restore N1 restore N0 -.endm -.macro fp_ne ( J,K,L ) +endm +fp_ne macro J,K,L save N0 save N1 save N2 - set N0, .J - set N1, .K + set N0, J + set N1, K sub N2, N1,N0 abs N2, N2 lt N2, 0.000001, $FPNENOK @@ -44,25 +44,25 @@ restore N2 restore N1 restore N0 - branch .L -.local $FPNENOK: + branch L +$FPNENOK: restore N2 restore N1 restore N0 -.endm +endm ENDOFMACRO output_is( <<"CODE", <<OUTPUT, "sin" ); @{[ $fp_equality_macro ]} set N1, 1.0 sin N2, N1 - .fp_eq (N2, 0.841471, EQ1) + fp_eq N2, 0.841471, EQ1 print "not " EQ1: print "ok 1\\n" set I1, 1 sin N2, I1 - .fp_eq (N2, 0.841471, EQ2) + fp_eq N2, 0.841471, EQ2 print "not " EQ2: print "ok 2\\n" @@ -76,13 +76,13 @@ @{[ $fp_equality_macro ]} set N1, 1.0 cos N2, N1 - .fp_eq (N2, 0.540302, EQ1) + fp_eq N2, 0.540302, EQ1 print "not " EQ1: print "ok 1\\n" set I1, 1 cos N2, I1 - .fp_eq (N2, 0.540302, EQ2) + fp_eq N2, 0.540302, EQ2 print "not " EQ2: print "ok 2\\n" end @@ -95,13 +95,13 @@ @{[ $fp_equality_macro ]} set N1, 1.0 tan N2, N1 - .fp_eq (N2, 1.557408, EQ1) + fp_eq N2, 1.557408, EQ1 print "not " EQ1: print "ok 1\\n" set I1, 1 tan N2, I1 - .fp_eq (N2, 1.557408, EQ2) + fp_eq N2, 1.557408, EQ2 print "not " EQ2: print "ok 2\\n" end @@ -114,13 +114,13 @@ @{[ $fp_equality_macro ]} set N1, 1.0 sec N2, N1 - .fp_eq (N2, 1.850816, EQ1) + fp_eq N2, 1.850816, EQ1 print "not " EQ1: print "ok 1\\n" set I1, 1 sec N2, I1 - .fp_eq (N2, 1.850816, EQ2) + fp_eq N2, 1.850816, EQ2 print "not " EQ2: print "ok 2\\n" end @@ -133,13 +133,13 @@ @{[ $fp_equality_macro ]} set N1, 1.0 atan N2, N1 - .fp_eq (N2, 0.785398, EQ1) + fp_eq N2, 0.785398, EQ1 print "not " EQ1: print "ok 1\\n" set I1, 1 atan N2, I1 - .fp_eq (N2,0.785398 , EQ2) + fp_eq N2,0.785398 , EQ2 print "not " EQ2: print "ok 2\\n" end @@ -152,13 +152,13 @@ @{[ $fp_equality_macro ]} set N1, 1.0 asin N2, N1 - .fp_eq (N2, 1.570796, EQ1) + fp_eq N2, 1.570796, EQ1 print "not " EQ1: print "ok 1\\n" set I1, 1 asin N2, I1 - .fp_eq (N2, 1.570796 , EQ2) + fp_eq N2, 1.570796 , EQ2 print "not " EQ2: print "ok 2\\n" @@ -172,13 +172,13 @@ @{[ $fp_equality_macro ]} set N1, 1.0 acos N2, N1 - .fp_eq (N2, 0.000000, EQ1) + fp_eq N2, 0.000000, EQ1 print "not " EQ1: print "ok 1\\n" set I1, 1 acos N2, I1 - .fp_eq (N2, 0.000000, EQ2) + fp_eq N2, 0.000000, EQ2 print "not " EQ2: print "ok 2\\n" @@ -192,13 +192,13 @@ @{[ $fp_equality_macro ]} set N1, 1.0 asec N2, N1 - .fp_eq (N2, 0.000000, EQ1) + fp_eq N2, 0.000000, EQ1 print "not " EQ1: print "ok 1\\n" set I1, 1 asec N2, I1 - .fp_eq (N2, 0.000000, EQ2) + fp_eq N2, 0.000000, EQ2 print "not " EQ2: print "ok 2\\n" @@ -212,13 +212,13 @@ @{[ $fp_equality_macro ]} set N1, 1.0 cosh N2, N1 - .fp_eq (N2, 1.543081, EQ1) + fp_eq N2, 1.543081, EQ1 print "not " EQ1: print "ok 1\\n" set I1, 1 cosh N2, I1 - .fp_eq (N2, 1.543081, EQ2) + fp_eq N2, 1.543081, EQ2 print "not " EQ2: print "ok 2\\n" @@ -232,13 +232,13 @@ @{[ $fp_equality_macro ]} set N1, 1.0 sinh N2, N1 - .fp_eq (N2, 1.175201, EQ1) + fp_eq N2, 1.175201, EQ1 print "not " EQ1: print "ok 1\\n" set I1, 1 sinh N2, I1 - .fp_eq (N2, 1.175201, EQ2) + fp_eq N2, 1.175201, EQ2 print "not " EQ2: print "ok 2\\n" @@ -252,13 +252,13 @@ @{[ $fp_equality_macro ]} set N1, 1.0 tanh N2, N1 - .fp_eq (N2, 0.761594, EQ1) + fp_eq N2, 0.761594, EQ1 print "not " EQ1: print "ok 1\\n" set I1, 1 tanh N2, I1 - .fp_eq (N2, 0.761594, EQ2) + fp_eq N2, 0.761594, EQ2 print "not " EQ2: print "ok 2\\n" @@ -272,13 +272,13 @@ @{[ $fp_equality_macro ]} set N1, 1.0 sech N2, N1 - .fp_eq (N2, 0.648054, EQ1) + fp_eq N2, 0.648054, EQ1 print "not " EQ1: print "ok 1\\n" set I1, 1 sech N2, I1 - .fp_eq (N2, 0.648054, EQ2) + fp_eq N2, 0.648054, EQ2 print "not " EQ2: print "ok 2\\n" @@ -300,82 +300,82 @@ set N3, -1.0 atan N4, N1, N2 - .fp_eq (N4, 0.785398, EQ1) + fp_eq N4, 0.785398, EQ1 print "not " EQ1: print "ok 1\\n" atan N4, N1, I2 - .fp_eq (N4, 0.785398, EQ2) + fp_eq N4, 0.785398, EQ2 print "not " EQ2: print "ok 2\\n" atan N4, I1, N2 - .fp_eq (N4, 0.785398, EQ3) + fp_eq N4, 0.785398, EQ3 print "not " EQ3: print "ok 3\\n" atan N4, I1, I2 - .fp_eq (N4, 0.785398, EQ4) + fp_eq N4, 0.785398, EQ4 print "not " EQ4: print "ok 4\\n" atan N4, N3, 1.0 - .fp_eq (N4, -0.785398, EQ5) + fp_eq N4, -0.785398, EQ5 print "not " EQ5: print "ok 5\\n" atan N4, N1, 0 - .fp_eq (N4, 1.570796, EQ6) + fp_eq N4, 1.570796, EQ6 print "not " EQ6: print "ok 6\\n" atan N4, I3, 0.0 - .fp_eq (N4, -1.570796, EQ7) + fp_eq N4, -1.570796, EQ7 print "not " EQ7: print "ok 7\\n" atan N4, I3, -1 - .fp_eq (N4, -2.356194, EQ8) + fp_eq N4, -2.356194, EQ8 print "not " EQ8: print "ok 8\\n" atan N4, 1.0, N3 - .fp_eq (N4, 2.356194, EQ9) + fp_eq N4, 2.356194, EQ9 print "not " EQ9: print "ok 9\\n" atan N4, 1.0, I0 - .fp_eq (N4, 1.570796, EQ10) + fp_eq N4, 1.570796, EQ10 print "not " EQ10: print "ok 10\\n" atan N4, 1, N1 - .fp_eq (N4, 0.785398, EQ11) + fp_eq N4, 0.785398, EQ11 print "not " EQ11: print "ok 11\\n" atan N4, 1, I1 - .fp_eq (N4, 0.785398, EQ12) + fp_eq N4, 0.785398, EQ12 print "not " EQ12: print "ok 12\\n" atan N4, 0.0, 1.0 - .fp_eq (N4, 0.000000, EQ13) + fp_eq N4, 0.000000, EQ13 print "not " EQ13: print "ok 13\\n" atan N4, -1.0, 0 - .fp_eq (N4, -1.570796, EQ14) + fp_eq N4, -1.570796, EQ14 print "not " EQ14: print "ok 14\\n" atan N4, 1, -1.0 - .fp_eq (N4, 2.356194, EQ15) + fp_eq N4, 2.356194, EQ15 print "not " EQ15: print "ok 15\\n" atan N4, 0, 1 - .fp_eq (N4, 0.000000, EQ16) + fp_eq N4, 0.000000, EQ16 print "not " EQ16: print "ok 16\\n" end @@ -402,13 +402,13 @@ @{[ $fp_equality_macro ]} set N1, 10.0 log2 N2, N1 - .fp_eq (N2, 3.321928, EQ1) + fp_eq N2, 3.321928, EQ1 print "not " EQ1: print "ok 1\\n" set I1, 10 log2 N2, I1 - .fp_eq (N2, 3.321928, EQ2) + fp_eq N2, 3.321928, EQ2 print "not " EQ2: print "ok 2\\n" @@ -422,13 +422,13 @@ @{[ $fp_equality_macro ]} set N1, 15.0 log10 N2, N1 - .fp_eq (N2, 1.176091, EQ1) + fp_eq N2, 1.176091, EQ1 print "not " EQ1: print "ok 1\\n" set I1, 15 log10 N2, I1 - .fp_eq (N2, 1.176091, EQ2) + fp_eq N2, 1.176091, EQ2 print "not " EQ2: print "ok 2\\n" @@ -442,13 +442,13 @@ @{[ $fp_equality_macro ]} set N1, 10.0 ln N2, N1 - .fp_eq (N2, 2.302585, EQ1) + fp_eq N2, 2.302585, EQ1 print "not " EQ1: print "ok 1\\n" set I1, 10 ln N2, I1 - .fp_eq (N2, 2.302585, EQ2) + fp_eq N2, 2.302585, EQ2 print "not " EQ2: print "ok 2\\n" end @@ -461,13 +461,13 @@ @{[ $fp_equality_macro ]} set N1, 10.0 exp N2, N1 - .fp_eq (N2, 22026.465795, EQ1) + fp_eq N2, 22026.465795, EQ1 print "not " EQ1: print "ok 1\\n" set I1, 10 exp N2, I1 - .fp_eq (N2, 22026.465795, EQ2) + fp_eq N2, 22026.465795, EQ2 print "not " EQ2: print "ok 2\\n" end @@ -483,22 +483,22 @@ set N2, 5.0 set I2, 5 pow N3, N1, N2 - .fp_eq (N3, 243.0, EQ1) + fp_eq N3, 243.0, EQ1 print "not " EQ1: print "ok 1\\n" pow N3, N1, I2 - .fp_eq (N3, 243.0, EQ2) + fp_eq N3, 243.0, EQ2 print "not " EQ2: print "ok 2\\n" pow N3, I1, N2 - .fp_eq (N3, 243.0, EQ3) + fp_eq N3, 243.0, EQ3 print "not " EQ3: print "ok 3\\n" pow N3, I1, I2 - .fp_eq (N3, 243.0, EQ4) + fp_eq N3, 243.0, EQ4 print "not " EQ4: print "ok 4\\n" @@ -509,62 +509,62 @@ set N2, 4.0 set I2, 4 pow N3, N2, 2.5 - .fp_eq (N3, 32.0, EQ5) + fp_eq N3, 32.0, EQ5 print "not " EQ5: print "ok 5\\n" pow N3, N2, -2 - .fp_eq (N3, 0.0625, EQ6) + fp_eq N3, 0.0625, EQ6 print "not " EQ6: print "ok 6\\n" pow N3, I2, 0.5 - .fp_eq (N3, 2.0, EQ7) + fp_eq N3, 2.0, EQ7 print "not " EQ7: print "ok 7\\n" pow N3, I2, 0 - .fp_eq (N3, 1.0, EQ8) + fp_eq N3, 1.0, EQ8 print "not " EQ8: print "ok 8\\n" pow N3, 0.0, N2 - .fp_eq (N3, 0.0, EQ9) + fp_eq N3, 0.0, EQ9 print "not " EQ9: print "ok 9\\n" pow N3, 2.5, 0.0 - .fp_eq (N3, 1.0, EQ10) + fp_eq N3, 1.0, EQ10 print "not " EQ10: print "ok 10\\n" pow N3, 2.5, I2 - .fp_eq (N3, 39.0625, EQ11) + fp_eq N3, 39.0625, EQ11 print "not " EQ11: print "ok 11\\n" pow N3, 2.0, -4 - .fp_eq (N3, 0.0625, EQ12) + fp_eq N3, 0.0625, EQ12 print "not " EQ12: print "ok 12\\n" pow N3, 0, N2 - .fp_eq (N3, 0.0, EQ13) + fp_eq N3, 0.0, EQ13 print "not " EQ13: print "ok 13\\n" pow N3, 4, -0.5 - .fp_eq (N3, 0.5, EQ14) + fp_eq N3, 0.5, EQ14 print "not " EQ14: print "ok 14\\n" pow N3, 4, I2 - .fp_eq (N3, 256.0, EQ15) + fp_eq N3, 256.0, EQ15 print "not " EQ15: print "ok 15\\n" pow N3, 4, -1 - .fp_eq (N3, 0.25, EQ16) + fp_eq N3, 0.25, EQ16 print "not " EQ16: print "ok 16\\n" end @@ -587,4 +587,4 @@ ok 16 OUTPUT -1; +1; \ No newline at end of file diff -ru parrot_foo/t/pmc/array.t parrot/t/pmc/array.t --- parrot_foo/t/pmc/array.t Tue May 28 21:57:12 2002 +++ parrot/t/pmc/array.t Wed May 15 23:18:51 2002 @@ -4,7 +4,7 @@ use Test::More; output_is(<<'CODE', <<'OUTPUT', "Basic array tests"); - new P0,.Array + new P0,Array set I0,P0 eq I0,0,OK_1 diff -ru parrot_foo/t/pmc/perlarray.t parrot/t/pmc/perlarray.t --- parrot_foo/t/pmc/perlarray.t Tue May 28 21:57:44 2002 +++ parrot/t/pmc/perlarray.t Tue Apr 23 13:26:28 2002 @@ -4,7 +4,7 @@ use Test::More; output_is(<<'CODE', <<'OUTPUT', "size of the array"); - new P0,.PerlArray + new P0,PerlArray set P0,0 set I0,P0 print I0 @@ -28,7 +28,7 @@ OUTPUT output_is(<<'CODE', <<'OUTPUT', "set/get by index"); - new P0,.PerlArray + new P0,PerlArray set_keyed P0,0,3 # set P0[0], 3 get_keyed I1,P0,0 # set I1, P0[0] print I1 @@ -47,7 +47,7 @@ print "\n" set P0, 4 - new P1, .PerlInt + new P1, PerlInt set P1, 42 set_keyed P0,3,P1 # set P0[3], P1 get_keyed P2,P0,3 # set S1, P0[3] @@ -63,7 +63,7 @@ OUTPUT output_is(<<'CODE', <<'OUTPUT', "same, but with implicit resizing"); - new P0,.PerlArray + new P0,PerlArray set_keyed P0,0,3 # set P0[0], 3 get_keyed I1,P0,0 # set I1, P0[0] print I1 @@ -79,7 +79,7 @@ print S1 print "\n" - new P1, .PerlInt + new P1, PerlInt set P1, 42 set_keyed P0,3,P1 # set P0[3], P1 get_keyed P2,P0,3 # set S1, P0[3] @@ -95,7 +95,7 @@ OUTPUT output_is(<<'CODE', <<'OUTPUT', "keys of different types"); - new P0, .PerlArray + new P0, PerlArray set_keyed P0, 5.0, 3 set I0, P0 bsr PRINT @@ -126,7 +126,7 @@ OUTPUT output_is(<<'CODE', <<'OUTPUT', "If P"); - new P0, .PerlArray + new P0, PerlArray if P0, TR print "false\n" branch NEXT @@ -138,7 +138,7 @@ branch NEXT2 TR2: print "true\n" -NEXT2: new P1, .PerlArray +NEXT2: new P1, PerlArray set P1, 1 if P1, TR3 print "false\n" @@ -160,7 +160,7 @@ OUTPUT output_is(<<'CODE', <<'OUTPUT', "Negative and Positive array accesses"); - new P0,.PerlArray + new P0,PerlArray set I0,P0 eq I0,0,OK_1 diff -ru parrot_foo/t/pmc/perlhash.t parrot/t/pmc/perlhash.t --- parrot_foo/t/pmc/perlhash.t Tue May 28 21:58:27 2002 +++ parrot/t/pmc/perlhash.t Fri May 17 22:38:12 2002 @@ -4,7 +4,7 @@ use Test::More; output_is(<<'CODE', <<OUTPUT, "simple set / get"); - new P0, .PerlHash + new P0, PerlHash set S0, "one" set S1, "two" @@ -25,11 +25,11 @@ OUTPUT output_is(<<'CODE', <<OUTPUT, "more than one PerlHash"); - new P0, .PerlHash + new P0, PerlHash set S0, "key" set_keyed P0, S0, 1 - new P1, .PerlHash + new P1, PerlHash set S1, "another_key" set_keyed P1, S1, 2 @@ -47,7 +47,7 @@ OUTPUT output_is(<<'CODE', <<OUTPUT, "hash keys with nulls in them"); - new P0, .PerlHash + new P0, PerlHash set S0, "parp\0me" set S1, "parp\0you" @@ -68,7 +68,7 @@ OUTPUT output_is(<<'CODE', <<OUTPUT, "nearly the same hash keys"); - new P0, .PerlHash + new P0, PerlHash set S0, "a\0" set S1, "\0a" @@ -90,7 +90,7 @@ OUTPUT output_is(<<'CODE', <<OUTPUT, "The same hash keys"); - new P0, .PerlHash + new P0, PerlHash set S0, "Happy" set S1, "Happy" @@ -112,7 +112,7 @@ OUTPUT output_is(<<'CODE', <<OUTPUT, "size of the hash"); - new P0, .PerlHash + new P0, PerlHash set_keyed P0, 0, 1 set I0, P0 @@ -141,7 +141,7 @@ # the current algorithm; if the algorithm changes, change the test! output_is(<<'CODE', <<OUTPUT, "key that hashes to zero"); - new P0, .PerlHash + new P0, PerlHash set S0, "key2" set_keyed P0, S0, 1 get_keyed I0, P0, S0 @@ -153,7 +153,7 @@ OUTPUT output_is(<<CODE, <<OUTPUT, "Initial PerlHash tests"); - new P0, .PerlHash + new P0, PerlHash set_keyed P0, "foo", -7 set_keyed P0, "bar", 3.5 @@ -181,7 +181,7 @@ OUTPUT output_is(<<CODE, <<OUTPUT, "stress test: loop(set, check)"); - new P0, .PerlHash + new P0, PerlHash set I0, 200 set S0, "mikey" @@ -253,7 +253,7 @@ # Check all values after setting all of them output_is(<<CODE, <<OUTPUT, "stress test: loop(set), loop(check)"); - new P0, .PerlHash + new P0, PerlHash set I0, 200 set S0, "mikey" diff -ru parrot_foo/t/pmc/perlstring.t parrot/t/pmc/perlstring.t --- parrot_foo/t/pmc/perlstring.t Tue May 28 22:01:41 2002 +++ parrot/t/pmc/perlstring.t Sun Mar 10 18:40:32 2002 @@ -4,50 +4,50 @@ use Test::More; # Included for skip(). my $fp_equality_macro = <<'ENDOFMACRO'; -.macro fp_eq ( J, K, L ) +fp_eq macro J,K,L save N0 save N1 save N2 - set N0, .J - set N1, .K + set N0, J + set N1, K sub N2, N1,N0 abs N2, N2 - gt N2, 0.000001, .$FPEQNOK + gt N2, 0.000001, $FPEQNOK restore N2 restore N1 restore N0 - branch .L -.local $FPEQNOK: + branch L +$FPEQNOK: restore N2 restore N1 restore N0 -.endm -.macro fp_ne ( J, K, L ) +endm +fp_ne macro J,K,L save N0 save N1 save N2 - set N0, .J - set N1, .K + set N0, J + set N1, K sub N2, N1,N0 abs N2, N2 - lt N2, 0.000001, .$FPNENOK + lt N2, 0.000001, $FPNENOK restore N2 restore N1 restore N0 - branch .L -.local $FPNENOK: + branch L +$FPNENOK: restore N2 restore N1 restore N0 -.endm +endm ENDOFMACRO output_is(<<CODE, <<OUTPUT, "Set/get strings"); - new P0, .PerlString + new P0, PerlString set P0, "foo" set S0, P0 eq S0, "foo", OK1 @@ -95,31 +95,31 @@ OUTPUT output_is(<<CODE, <<OUTPUT, "Setting integers"); - new P0, .PerlString + new P0, PerlString set P0, "1" set I0, P0 print I0 print "\\n" - new P0, .PerlString + new P0, PerlString set P0, "2.0" set I0, P0 print I0 print "\\n" - new P0, .PerlString + new P0, PerlString set P0, "" set I0, P0 print I0 print "\\n" - new P0, .PerlString + new P0, PerlString set P0, "\0" set I0, P0 print I0 print "\\n" - new P0, .PerlString + new P0, PerlString set P0, "foo" set I0, P0 print I0 @@ -136,45 +136,45 @@ output_is(<<"CODE", <<OUTPUT, "Setting numbers"); @{[ $fp_equality_macro ]} - new P0, .PerlString + new P0, PerlString set P0, "1" set N0, P0 - .fp_eq(N0, 1.0, OK1) + fp_eq N0, 1.0, OK1 print "not " OK1: print "ok 1\\n" - new P0, .PerlString + new P0, PerlString set P0, "2.0" set N0, P0 - .fp_eq(N0, 2.0, OK2) + fp_eq N0, 2.0, OK2 print "not " OK2: print "ok 2\\n" - new P0, .PerlString + new P0, PerlString set P0, "" set N0, P0 - .fp_eq(N0, 0.0, OK3) + fp_eq N0, 0.0, OK3 print "not " OK3: print "ok 3\\n" - new P0, .PerlString + new P0, PerlString set P0, "\0" set N0, P0 - .fp_eq(N0, 0.0, OK4) + fp_eq N0, 0.0, OK4 print "not " OK4: print "ok 4\\n" - new P0, .PerlString + new P0, PerlString set P0, "foo" set N0, P0 - .fp_eq(N0, 0.0, OK5) + fp_eq N0, 0.0, OK5 print "not " OK5: print "ok 5\\n" - new P0, .PerlString + new P0, PerlString set P0, "1.3e5" set N0, P0 - .fp_eq(N0, 130000.0, OK6) + fp_eq N0, 130000.0, OK6 print "not " OK6: print "ok 6\\n" @@ -189,9 +189,9 @@ OUTPUT output_is(<<CODE, <<OUTPUT, "ensure that concat ppp copies strings"); - new P0, .PerlString - new P1, .PerlString - new P2, .PerlString + new P0, PerlString + new P1, PerlString + new P2, PerlString set P0, "foo" concat P1, P0, P0 @@ -223,8 +223,8 @@ SKIP: { skip("Pending new version of concat_p_p_s",1); output_is(<<CODE, <<OUTPUT, "ensure that concat pps copies strings"); - new P0, .PerlString - new P1, .PerlString + new P0, PerlString + new P1, PerlString set S0, "Grunties" set P1, "fnargh" @@ -247,7 +247,7 @@ } output_is(<<CODE, <<OUTPUT, "Setting string copies"); - new P0, .PerlString + new P0, PerlString set S0, "C2H5OH + 10H20" set P0, S0 chopn S0, 8 @@ -263,31 +263,31 @@ OUTPUT output_is(<<'CODE', <<OUTPUT, "repeat"); - new P0, .PerlString + new P0, PerlString set P0, "x" - new P1, .PerlInt + new P1, PerlInt set P1, 12 - new P2, .PerlString + new P2, PerlString repeat P2, P0, P1 print P2 print "\n" set P0, "y" - new P1, .PerlNum + new P1, PerlNum set P1, 6.5 repeat P2, P0, P1 print P2 print "\n" set P0, "z" - new P1, .PerlString + new P1, PerlString set P1, "3" repeat P2, P0, P1 print P2 print "\n" set P0, "a" - new P1, .PerlUndef + new P1, PerlUndef repeat P2, P0, P1 print P2 print "\n" @@ -303,7 +303,7 @@ output_is(<<CODE, <<OUTPUT, "if(PerlString)"); - new P0, .PerlString + new P0, PerlString set S0, "True" set P0, S0 if P0, TRUE @@ -312,7 +312,7 @@ TRUE: print "true" NEXT: print "\\n" - new P1, .PerlString + new P1, PerlString set S1, "" set P1, S1 if P1, TRUE2 @@ -321,7 +321,7 @@ TRUE2: print "true" NEXT2: print "\\n" - new P2, .PerlString + new P2, PerlString set S2, "0" set P2, S2 if P2, TRUE3 @@ -330,7 +330,7 @@ TRUE3: print "true" NEXT3: print "\\n" - new P3, .PerlString + new P3, PerlString set S3, "0123" set P3, S3 if P3, TRUE4 @@ -339,7 +339,7 @@ TRUE4: print "true" NEXT4: print "\\n" - new P4, .PerlString + new P4, PerlString if P4, TRUE5 print "false" branch NEXT5 diff -ru parrot_foo/t/pmc/pmc.t parrot/t/pmc/pmc.t --- parrot_foo/t/pmc/pmc.t Tue May 28 22:24:38 2002 +++ parrot/t/pmc/pmc.t Wed May 15 23:18:51 2002 @@ -4,51 +4,51 @@ use Test::More; my $fp_equality_macro = <<'ENDOFMACRO'; -.macro fp_eq ( J, K, L ) +fp_eq macro J,K,L save N0 save N1 save N2 - set N0, .J - set N1, .K + set N0, J + set N1, K sub N2, N1,N0 abs N2, N2 - gt N2, 0.000001, .$FPEQNOK + gt N2, 0.000001, $FPEQNOK restore N2 restore N1 restore N0 - branch .L -.local $FPEQNOK: + branch L +$FPEQNOK: restore N2 restore N1 restore N0 -.endm -.macro fp_ne( J,K,L) +endm +fp_ne macro J,K,L save N0 save N1 save N2 - set N0, .J - set N1, .K + set N0, J + set N1, K sub N2, N1,N0 abs N2, N2 - lt N2, 0.000001, .$FPNENOK + lt N2, 0.000001, $FPNENOK restore N2 restore N1 restore N0 - branch .L -.local $FPNENOK: + branch L +$FPNENOK: restore N2 restore N1 restore N0 -.endm +endm ENDOFMACRO output_is(<<'CODE', <<'OUTPUT', "newpmc"); print "starting\n" - new P0, .PerlInt + new P0, PerlInt print "ending\n" end CODE @@ -57,7 +57,7 @@ OUTPUT output_is(<<'CODE', <<'OUTPUT', "set/print integer"); - new P0, .PerlInt + new P0, PerlInt set P0, 123 print P0 print "\n" @@ -70,7 +70,7 @@ # Let perl do the computation. # output_is(<<'CODE', <<OUTPUT, "add integer to self"); - new P0, .PerlInt + new P0, PerlInt set P0, 123 add P0, P0, P0 print P0 @@ -81,7 +81,7 @@ OUTPUT output_is(<<'CODE', <<OUTPUT, "sub integer from self"); - new P0, .PerlInt + new P0, PerlInt set P0, 456 sub P0, P0, P0 print P0 @@ -92,7 +92,7 @@ OUTPUT output_is(<<'CODE', <<OUTPUT, "multiply integer by self"); - new P0, .PerlInt + new P0, PerlInt set P0, 124 mul P0, P0, P0 print P0 @@ -103,7 +103,7 @@ OUTPUT output_is(<<'CODE', <<OUTPUT, "divide integer by self"); - new P0, .PerlInt + new P0, PerlInt set P0, 23 div P0, P0, P0 print P0 @@ -114,8 +114,8 @@ OUTPUT output_is(<<'CODE', <<OUTPUT, "add integer to other"); - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, 123 set P1, 321 add P1, P1, P0 @@ -127,8 +127,8 @@ OUTPUT output_is(<<'CODE', <<OUTPUT, "subtract integer from other"); - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, 123 set P1, 321 sub P1, P1, P0 @@ -140,8 +140,8 @@ OUTPUT output_is(<<'CODE', <<OUTPUT, "multiply integer by other"); - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, 123 set P1, 321 mul P1, P1, P0 @@ -154,13 +154,13 @@ output_is(<<"CODE", <<OUTPUT, "divide integer by other"); @{[ $fp_equality_macro ]} - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, 123 set P1, 246 div P1, P1, P0 - .fp_eq( P1, 2.0, EQ1) + fp_eq P1, 2.0, EQ1 print P1 print "not " EQ1: print "ok 1" @@ -175,10 +175,10 @@ # output_is(<<"CODE", <<OUTPUT, "add number to self"); @{[ $fp_equality_macro ]} - new P0, .PerlInt + new P0, PerlInt set P0, 123.123 add P0, P0, P0 - .fp_eq( P0, 246.246, EQ1) + fp_eq P0, 246.246, EQ1 print P0 print "not " EQ1: print "ok 1\\n" @@ -189,10 +189,10 @@ output_is(<<"CODE", <<OUTPUT, "sub number from self"); @{[ $fp_equality_macro ]} - new P0, .PerlInt + new P0, PerlInt set P0, 456.456 sub P0, P0, P0 - .fp_eq( P0, 0, EQ1) + fp_eq P0, 0, EQ1 print P0 print "not " EQ1: print "ok 1\\n" @@ -203,10 +203,10 @@ output_is(<<"CODE", <<OUTPUT, "multiply number by self"); @{[ $fp_equality_macro ]} - new P0, .PerlInt + new P0, PerlInt set P0, 124.124 mul P0, P0, P0 - .fp_eq( P0, 15406.767376, EQ1) + fp_eq P0, 15406.767376, EQ1 print P0 print "not " EQ1: print "ok 1\\n" @@ -217,10 +217,10 @@ output_is(<<"CODE", <<OUTPUT, "divide number by self"); @{[ $fp_equality_macro ]} - new P0, .PerlInt + new P0, PerlInt set P0, 23.23 div P0, P0, P0 - .fp_eq( P0, 1, EQ1) + fp_eq P0, 1, EQ1 print P0 print "not " EQ1: print "ok 1\\n" @@ -234,12 +234,12 @@ # output_is(<<"CODE", <<OUTPUT, "add number to other"); @{[ $fp_equality_macro ]} - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, 123.123 set P1, 321.321 add P1, P1, P0 - .fp_eq( P1, 444.444, EQ1) + fp_eq P1, 444.444, EQ1 print P1 print "not " EQ1: print "ok 1\\n" @@ -250,12 +250,12 @@ output_is(<<"CODE", <<OUTPUT, "subtract number from other"); @{[ $fp_equality_macro ]} - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, 123.123 set P1, 321.321 sub P1, P1, P0 - .fp_eq( P1, 198.198, EQ1) + fp_eq P1, 198.198, EQ1 print P1 print "not " EQ1: print "ok 1\\n" @@ -266,12 +266,12 @@ output_is(<<"CODE", <<OUTPUT, "multiply number by other"); @{[ $fp_equality_macro ]} - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, 123.123 set P1, 321.321 mul P1, P1, P0 - .fp_eq( P1, 39562.005483, EQ1) + fp_eq P1, 39562.005483, EQ1 print P1 print "not " EQ1: print "ok 1\\n" @@ -282,12 +282,12 @@ output_is(<<"CODE", <<OUTPUT, "divide number by other"); @{[ $fp_equality_macro ]} - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, 123.123 set P1, 246.246 div P1, P1, P0 - .fp_eq( P1, 2, EQ1) + fp_eq P1, 2, EQ1 print P1 print "not " EQ1: print "ok 1\\n" @@ -301,12 +301,12 @@ # output_is(<<"CODE", <<OUTPUT, "add integer to number"); @{[ $fp_equality_macro ]} - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, 123 set P1, 321.321 add P1, P1, P0 - .fp_eq( P1, 444.321, EQ1) + fp_eq P1, 444.321, EQ1 print P1 print "not " EQ1: print "ok 1\\n" @@ -317,12 +317,12 @@ output_is(<<"CODE", <<OUTPUT, "subtract integer from number"); @{[ $fp_equality_macro ]} - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, 123 set P1, 321.321 sub P1, P1, P0 - .fp_eq( P1, 198.321, EQ1) + fp_eq P1, 198.321, EQ1 print P1 print "not " EQ1: print "ok 1\\n" @@ -333,12 +333,12 @@ output_is(<<"CODE", <<OUTPUT, "multiply integer by number"); @{[ $fp_equality_macro ]} - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, 123 set P1, 321.321 mul P1, P1, P0 - .fp_eq( P1,39522.483 , EQ1) + fp_eq P1,39522.483 , EQ1 print P1 print "not " EQ1: print "ok 1\\n" @@ -349,12 +349,12 @@ output_is(<<"CODE", <<OUTPUT, "divide integer by number"); @{[ $fp_equality_macro ]} - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, 123 set P1, 246.246 div P1, P1, P0 - .fp_eq( P1, 2.002 , EQ1) + fp_eq P1, 2.002 , EQ1 print P1 print "not " EQ1: print "ok 1\\n" @@ -368,12 +368,12 @@ # output_is(<<"CODE", <<OUTPUT, "add integer to number"); @{[ $fp_equality_macro ]} - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, 123 set P1, 321.321 add P1, P0, P1 - .fp_eq( P1, 444.321 , EQ1) + fp_eq P1, 444.321 , EQ1 print P1 print "not " EQ1: print "ok 1\\n" @@ -384,12 +384,12 @@ output_is(<<"CODE", <<OUTPUT, "subtract integer from number"); @{[ $fp_equality_macro ]} - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, 123 set P1, 321.321 sub P1, P0, P1 - .fp_eq( P1, -198.321000, EQ1) + fp_eq P1, -198.321000, EQ1 print P1 print "not " EQ1: print "ok 1\\n" @@ -400,12 +400,12 @@ output_is(<<"CODE", <<OUTPUT, "multiply integer by number"); @{[ $fp_equality_macro ]} - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, 123 set P1, 321.321 mul P1, P0, P1 - .fp_eq( P1, 39522.483, EQ1) + fp_eq P1, 39522.483, EQ1 print P1 print "not " EQ1: print "ok 1\\n" @@ -416,12 +416,12 @@ output_is(<<"CODE", <<OUTPUT, "divide integer by number"); @{[ $fp_equality_macro ]} - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, 123 set P1, 246.246 div P1, P0, P1 - .fp_eq( P1, 0.499500, EQ1) + fp_eq P1, 0.499500, EQ1 print P1 print "not " EQ1: print "ok 1\\n" @@ -434,8 +434,8 @@ # Concat tests # output_is(<<'CODE', <<OUTPUT, "concatenate integer to string"); - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, -5 set P1, "foo" concat P0,P0,P1 @@ -447,8 +447,8 @@ OUTPUT output_is(<<'CODE', <<OUTPUT, "concatenate string to integer"); - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, "foo" set P1, -7 concat P0,P0,P1 @@ -460,8 +460,8 @@ OUTPUT output_is(<<'CODE', <<OUTPUT, "concatenate number to string"); - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, 5.43 set P1, "bar" concat P0,P0,P1 @@ -473,8 +473,8 @@ OUTPUT output_is(<<'CODE', <<OUTPUT, "concatenate string to number"); - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, "bar" set P1, 2.7 concat P0,P0,P1 @@ -486,8 +486,8 @@ OUTPUT output_is(<<'CODE', <<OUTPUT, "concatenate string to string"); - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, "foo" set P1, "bar" concat P0,P0,P1 @@ -502,7 +502,7 @@ # Basic string number conversion # output_is(<<CODE, <<OUTPUT, "string to int"); - new P0, .PerlInt + new P0, PerlInt set P0, "1" set I0, P0 @@ -542,7 +542,7 @@ SKIP: { skip("string->int not finished yet", 1); output_is(<<CODE, <<OUTPUT, "nasty string -> int"); - new P0, .PerlInt + new P0, PerlInt set P0, "Z1" set I0, P0 print I0 @@ -568,88 +568,88 @@ output_is(<<CODE, <<OUTPUT, "string to number conversion"); @{[ $fp_equality_macro ]} - new P0, .PerlInt + new P0, PerlInt set P0, "1" set N0, P0 - .fp_eq( N0, 1, EQ1) + fp_eq N0, 1, EQ1 print N0 print "not " EQ1: print "ok 1\\n" set P0, "1.2" set N0, P0 - .fp_eq( N0, 1.2, EQ2) + fp_eq N0, 1.2, EQ2 print N0 print "not " EQ2: print "ok 2\\n" set P0, "1.2e1" set N0, P0 - .fp_eq( N0, 12, EQ3) + fp_eq N0, 12, EQ3 print N0 print "not " EQ3: print "ok 3\\n" set P0, "1.2e-1" set N0, P0 - .fp_eq( N0, 0.12, EQ4) + fp_eq N0, 0.12, EQ4 print N0 print "not " EQ4: print "ok 4\\n" set P0, "1.2e2.1" set N0, P0 - .fp_eq( N0, 120, EQ5) + fp_eq N0, 120, EQ5 print N0 print "not " EQ5: print "ok 5\\n" set P0, "X1.2X" set N0, P0 - .fp_eq( N0, 1.2, EQ6) + fp_eq N0, 1.2, EQ6 print N0 print "not " EQ6: print "ok 6\\n" set P0, "E1-1.2e+2" set N0, P0 - .fp_eq( N0, 1, EQ7) + fp_eq N0, 1, EQ7 print N0 print "not " EQ7: print "ok 7\\n" set P0, "++-1" set N0, P0 - .fp_eq( N0, -1, EQ8) + fp_eq N0, -1, EQ8 print N0 print "not " EQ8: print "ok 8\\n" set P0, "1234.1234.5" set N0, P0 - .fp_eq( N0, 1234.1234, EQ9) + fp_eq N0, 1234.1234, EQ9 print N0 print "not " EQ9: print "ok 9\\n" set P0, "this is empty!" set N0, P0 - .fp_eq( N0, 0.0, EQ10) + fp_eq N0, 0.0, EQ10 print N0 print " not " EQ10: print "ok 10\\n" set P0, "0e123" set N0, P0 - .fp_eq( N0, 0, EQ11) + fp_eq N0, 0, EQ11 print N0 print " not " EQ11: print "ok 11\\n" set P0, "000000000000000000000000000000000000000001e-0" set N0, P0 - .fp_eq( N0, 1, EQ12) + fp_eq N0, 1, EQ12 print N0 print " not " EQ12: print "ok 12\\n" @@ -674,8 +674,8 @@ # Arithmetic operators # output_is(<<'CODE', <<OUTPUT, "add integer to string integer"); - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, 6 set P1, "7" add P0,P0,P1 @@ -687,8 +687,8 @@ OUTPUT output_is(<<'CODE', <<OUTPUT, "add integer to string"); - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, 6 set P1, "ab" add P0,P0,P1 @@ -701,12 +701,12 @@ output_is(<<"CODE", <<OUTPUT, "add integer to string number"); @{[ $fp_equality_macro ]} - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, 6 set P1, "7.5" add P0,P0,P1 - .fp_eq( P0, 13.5, EQ1) + fp_eq P0, 13.5, EQ1 print P0 print "not " EQ1: print "ok 1\\n" @@ -717,12 +717,12 @@ output_is(<<"CODE", <<OUTPUT, "add number to string integer"); @{[ $fp_equality_macro ]} - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, 6.1 set P1, "7" add P0,P0,P1 - .fp_eq( P0, 13.1, EQ1) + fp_eq P0, 13.1, EQ1 print P0 print "not " EQ1: print "ok 1\\n" @@ -733,12 +733,12 @@ output_is(<<"CODE", <<OUTPUT, "add number to string"); @{[ $fp_equality_macro ]} - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, 6.1 set P1, "ab" add P0,P0,P1 - .fp_eq( P0, 6.1, EQ1) + fp_eq P0, 6.1, EQ1 print P0 print "not " EQ1: print "ok 1\\n" @@ -749,12 +749,12 @@ output_is(<<"CODE", <<OUTPUT, "add number to string number"); @{[ $fp_equality_macro ]} - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, 6.1 set P1, "7.5" add P0,P0,P1 - .fp_eq( P0, 13.6, EQ1) + fp_eq P0, 13.6, EQ1 print P0 print "not " EQ1: print "ok 1\\n" @@ -764,9 +764,9 @@ OUTPUT output_is(<<CODE, <<OUTPUT, "p = p % p (int % int)"); - new P0, .PerlInt - new P1, .PerlInt - new P2, .PerlInt + new P0, PerlInt + new P1, PerlInt + new P2, PerlInt set P0, 11 set P1, 10 mod P2, P0, P1 @@ -779,13 +779,13 @@ output_is(<<CODE, <<OUTPUT, "(int / int) -> float"); @{[ $fp_equality_macro ]} - new P0, .PerlInt - new P1, .PerlInt - new P2, .PerlInt + new P0, PerlInt + new P1, PerlInt + new P2, PerlInt set P0, 1 set P1, 2 div P2, P0, P1 - .fp_eq( P2, 0.5, EQ1) + fp_eq P2, 0.5, EQ1 print P2 print " not " EQ1: print "ok 1\\n" @@ -795,8 +795,8 @@ OUTPUT output_is(<<'CODE', <<'OUTPUT', "copy"); - new P0, .PerlInt - new P1, .PerlInt + new P0, PerlInt + new P1, PerlInt set P0, -3 clone P1, P0 print P1 @@ -817,7 +817,7 @@ OUTPUT output_is(<<'CODE', <<'OUTPUT', "set/get string value"); - new P0, .PerlInt + new P0, PerlInt set P0, "foo" set S0, P0 eq S0, "foo", OK1 @@ -867,7 +867,7 @@ # The same for PerlNums... output_is(<<'CODE', <<'OUTPUT', "set/get string value"); - new P0, .PerlNum + new P0, PerlNum set P0, "bar" set S0, P0 eq S0, "bar", OK1 @@ -915,7 +915,7 @@ OUTPUT output_is(<<CODE, <<OUTPUT, "if (P) - Int"); - new P0, .PerlInt + new P0, PerlInt set P0, 1 if P0, OK1 @@ -935,7 +935,7 @@ OUTPUT output_is(<<CODE, <<OUTPUT, "if (P) - Num"); - new P0, .PerlInt + new P0, PerlInt set P0, 1.1 if P0, OK1 @@ -955,7 +955,7 @@ OUTPUT output_is(<<CODE, <<OUTPUT, "if (P) - String"); - new P0, .PerlString + new P0, PerlString set P0, "I've told you once, I've told you twice..." if P0, OK1 @@ -1018,9 +1018,9 @@ OUTPUT output_is(<<"CODE", <<'OUTPUT', "undef-logical"); - new P0, .PerlUndef - new P1, .PerlUndef - new P2, .PerlInt + new P0, PerlUndef + new P1, PerlUndef + new P2, PerlInt # undef or undef = 0 or P0, P1, P1 @@ -1054,18 +1054,18 @@ output_is(<<"CODE", <<'OUTPUT', "undef-add"); @{[ $fp_equality_macro ]} - new P1, .PerlUndef + new P1, PerlUndef # undef + perlundef - new P0, .PerlUndef + new P0, PerlUndef add P0, P1, P1 print P0 print "\\n" # undef + perlint - new P0, .PerlUndef - new P2, .PerlInt + new P0, PerlUndef + new P2, PerlInt set P2, 947 add P0, P1, P2 print P0 @@ -1073,11 +1073,11 @@ # undef + perlnum - new P0, .PerlUndef - new P2, .PerlNum + new P0, PerlUndef + new P2, PerlNum set P2, 385.623 add P0, P1, P2 - .fp_eq( P0, 385.623, OK) + fp_eq P0, 385.623, OK print "not" OK: print "ok" @@ -1092,8 +1092,8 @@ output_is(<<"CODE", <<'OUTPUT', "undef-subtract"); @{[ $fp_equality_macro ]} - new P0, .PerlUndef - new P1, .PerlUndef + new P0, PerlUndef + new P1, PerlUndef # undef - undef sub P0, P1, P1 @@ -1101,7 +1101,7 @@ print "\\n" # undef - perlint - new P2, .PerlInt + new P2, PerlInt set P2, 947 sub P0, P1, P2 print P0 @@ -1109,10 +1109,10 @@ # undef - perlnum - new P2, .PerlNum + new P2, PerlNum set P2, 385.623 sub P0, P1, P2 - .fp_eq( P0, -385.623, OK2) + fp_eq P0, -385.623, OK2 print "not" OK2: print "ok" @@ -1128,9 +1128,9 @@ output_is(<<"CODE", <<'OUTPUT', "undef-multiply"); @{[ $fp_equality_macro ]} - new P0, .PerlUndef - new P1, .PerlUndef - new P2, .PerlInt + new P0, PerlUndef + new P1, PerlUndef + new P2, PerlInt # Undef * Undef mul P0, P1, P1 @@ -1144,7 +1144,7 @@ print "\\n" # Undef * PerlNum - new P2, .PerlNum + new P2, PerlNum set P2, 983.3 mul P0, P1, P2 print P0 @@ -1158,9 +1158,11 @@ OUTPUT output_is(<<"CODE", <<'OUTPUT', "undef-divide"); - new P0, .PerlUndef - new P1, .PerlUndef - new P2, .PerlInt +@{[ $fp_equality_macro ]} + + new P0, PerlUndef + new P1, PerlUndef + new P2, PerlInt # Undef / PerlInt set P2, 19 @@ -1169,7 +1171,7 @@ print "\\n" # Undef / PerlNum - new P2, .PerlNum + new P2, PerlNum set P2, 343.8 div P0, P1, P2 print P0 @@ -1182,7 +1184,7 @@ OUTPUT output_is(<<"CODE", <<'OUTPUT', "undef-string"); - new P0, .PerlUndef + new P0, PerlUndef set S0, P0 eq S0, "", OK print "not " @@ -1194,7 +1196,7 @@ output_is(<<CODE, <<OUTPUT, "IntQueue test"); - new P0,.IntQueue + new P0,IntQueue set P0,32 set P0,-7 @@ -1227,7 +1229,7 @@ OUTPUT output_is(<<CODE, <<OUTPUT, "IntQueue test"); - new P0,.IntQueue + new P0,IntQueue set P0,32 set P0,-7