cvsuser 01/09/24 09:27:48
Modified: t/op number.t
. basic_opcodes.ops opcode_table
Log:
* Op set_n was missing. Added it and a test for it. We now have the
same int and num ops, except mod is int-only.
Revision Changes Path
1.5 +11 -1 parrot/t/op/number.t
Index: number.t
===================================================================
RCS file: /home/perlcvs/parrot/t/op/number.t,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -r1.4 -r1.5
--- number.t 2001/09/22 16:47:22 1.4
+++ number.t 2001/09/24 16:27:48 1.5
@@ -1,6 +1,6 @@
#! perl -w
-use Parrot::Test tests => 23;
+use Parrot::Test tests => 24;
output_is(<<CODE, <<OUTPUT, "set_n_nc");
set N0, 1.0
@@ -110,6 +110,16 @@
70368744177664.000000
281474976710656.000000
1125899906842620.000000
+OUTPUT
+
+output_is(<<CODE, <<OUTPUT, "set_n");
+ set N0, 42.0
+ set N1, N0
+ print N1
+ print "\\n"
+ end
+CODE
+42.000000
OUTPUT
output_is(<<CODE, <<OUTPUT, "add_n");
1.24 +5 -0 parrot/basic_opcodes.ops
Index: basic_opcodes.ops
===================================================================
RCS file: /home/perlcvs/parrot/basic_opcodes.ops,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -w -r1.23 -r1.24
--- basic_opcodes.ops 2001/09/24 15:02:48 1.23
+++ basic_opcodes.ops 2001/09/24 16:27:48 1.24
@@ -192,6 +192,11 @@
/* SET Nx, CONSTANT */
AUTO_OP set_n_nc {
NUM_REG(P1) = P2;
+}
+
+/* SET Nx, Nx */
+AUTO_OP set_n {
+ NUM_REG(P1) = NUM_REG(P2);
}
/* ADD Nx, Ny, Nz */
1.22 +2 -1 parrot/opcode_table
Index: opcode_table
===================================================================
RCS file: /home/perlcvs/parrot/opcode_table,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -w -r1.21 -r1.22
--- opcode_table 2001/09/19 22:57:15 1.21
+++ opcode_table 2001/09/24 16:27:48 1.22
@@ -19,7 +19,7 @@
# S String register
# D Destination
#
-# $Id: opcode_table,v 1.21 2001/09/19 22:57:15 thgibbs Exp $
+# $Id: opcode_table,v 1.22 2001/09/24 16:27:48 gregor Exp $
#
@@ -44,6 +44,7 @@
# NUM ops
set_n_nc 2 N n
+set_n 2 N N
add_n 3 N N N
sub_n 3 N N N
mul_n 3 N N N