This patch (temporarily) fixes the missing _ic on comparison opcodes.
Index: assemble.pl
===================================================================
RCS file: /home/perlcvs/parrot/assemble.pl,v
retrieving revision 1.6
diff -u -r1.6 assemble.pl
--- assemble.pl 2001/09/10 21:26:08 1.6
+++ assemble.pl 2001/09/11 01:27:58
@@ -68,12 +68,12 @@
$args[0] = fixup($args[0])
if $opcode eq "branch_ic" and $args[0] =~ /[a-zA-Z]/;
-# if ($opcode eq "eq_i_ic" or $opcode eq "lt_i_ic") {
- if ($opcode =~ /^(eq|ne|lt|le|gt|ge)_i_ic$/) {
+# if ($opcode eq "eq_i_ic_ic" or $opcode eq "lt_i_ic_ic") {
+ if ($opcode =~ /^(eq|ne|lt|le|gt|ge)_i_ic_ic$/) {
$args[2] = fixup($args[2]) if $args[2] =~ /[a-zA-Z]/;
$args[3] = fixup($args[3]) if $args[3] =~ /[a-zA-Z]/;
}
- if ($opcode eq "if_i_ic") {
+ if ($opcode eq "if_i_ic_ic") {
$args[1] = fixup($args[1]) if $args[1] =~ /[a-zA-Z]/;
$args[2] = fixup($args[2]) if $args[2] =~ /[a-zA-Z]/;
}
Index: basic_opcodes.ops
===================================================================
RCS file: /home/perlcvs/parrot/basic_opcodes.ops,v
retrieving revision 1.6
diff -u -r1.6 basic_opcodes.ops
--- basic_opcodes.ops 2001/09/10 21:47:25 1.6
+++ basic_opcodes.ops 2001/09/11 01:27:58
@@ -41,7 +41,7 @@
}
// EQ Ix, Iy, EQ_BRANCH, NE_BRANCH
-MANUAL_OP eq_i_ic {
+MANUAL_OP eq_i_ic_ic {
if (INT_REG(P1) == INT_REG(P2)) {
RETURN(P3);
} else {
@@ -50,7 +50,7 @@
}
// NE Ix, Iy, NE_BRANCH, EQ_BRANCH
-MANUAL_OP ne_i_ic {
+MANUAL_OP ne_i_ic_ic {
if (INT_REG(P1) != INT_REG(P2)) {
RETURN(P3);
} else {
@@ -59,7 +59,7 @@
}
// LT Ix, Iy, LT_BRANCH, GE_BRANCH
-MANUAL_OP lt_i_ic {
+MANUAL_OP lt_i_ic_ic {
if (INT_REG(P1) < INT_REG(P2)) {
RETURN(P3);
} else {
@@ -68,7 +68,7 @@
}
// LE Ix, Iy, LE_BRANCH, GT_BRANCH
-MANUAL_OP le_i_ic {
+MANUAL_OP le_i_ic_ic {
if (INT_REG(P1) <= INT_REG(P2)) {
RETURN(P3);
} else {
@@ -77,7 +77,7 @@
}
// GT Ix, Iy, GT_BRANCH, LE_BRANCH
-MANUAL_OP gt_i_ic {
+MANUAL_OP gt_i_ic_ic {
if (INT_REG(P1) > INT_REG(P2)) {
RETURN(P3);
} else {
@@ -86,7 +86,7 @@
}
// GE Ix, Iy, GE_BRANCH, LT_BRANCH
-MANUAL_OP ge_i_ic {
+MANUAL_OP ge_i_ic_ic {
if (INT_REG(P1) >= INT_REG(P2)) {
RETURN(P3);
} else {
@@ -95,7 +95,7 @@
}
// IF IXx, TRUE_BRANCH, FALSE_BRANCH
-MANUAL_OP if_i_ic {
+MANUAL_OP if_i_ic_ic {
if (INT_REG(P1)) {
RETURN(P2);
} else {
@@ -178,7 +178,7 @@
}
// EQ Nx, Ny, EQ_BRANCH, NE_BRANCH
-MANUAL_OP eq_n_ic {
+MANUAL_OP eq_n_ic_ic {
if (NUM_REG(P1) == NUM_REG(P2)) {
RETURN(P3);
} else {
@@ -187,7 +187,7 @@
}
// IF Nx, TRUE_BRANCH, FALSE_BRANCH
-MANUAL_OP if_n_ic {
+MANUAL_OP if_n_ic_ic {
if (NUM_REG(P1)) {
RETURN(P2);
} else {
@@ -311,7 +311,7 @@
}
// LEN Ix, Sx
-AUTO_OP length_s_i {
+AUTO_OP length_i_s {
INT_REG(P1) = string_length(STR_REG(P2));
}
Index: opcode_table
===================================================================
RCS file: /home/perlcvs/parrot/opcode_table,v
retrieving revision 1.6
diff -u -r1.6 opcode_table
--- opcode_table 2001/09/10 21:26:09 1.6
+++ opcode_table 2001/09/11 01:27:58
@@ -44,25 +44,25 @@
set_s_sc 2 i i
print_s 1 i
-length_s_i 2 i i
+length_i_s 2 i i
chopn_s_ic 2 i i
# Comparators
-eq_i_ic 4 i i i i
-eq_n_ic 4 i i i i
-ne_i_ic 4 i i i i
-lt_i_ic 4 i i i i
-le_i_ic 4 i i i i
-gt_i_ic 4 i i i i
-ge_i_ic 4 i i i i
+eq_i_ic_ic 4 i i i i
+eq_n_ic_ic 4 i i i i
+ne_i_ic_ic 4 i i i i
+lt_i_ic_ic 4 i i i i
+le_i_ic_ic 4 i i i i
+gt_i_ic_ic 4 i i i i
+ge_i_ic_ic 4 i i i i
# Flow control
jump_i 1 i
branch_ic 1 i
-if_i_ic 3 i i i
-if_n_ic 3 i i i
+if_i_ic_ic 3 i i i
+if_n_ic_ic 3 i i i
# Convertors
Index: t/test.pasm
===================================================================
RCS file: /home/perlcvs/parrot/t/test.pasm,v
retrieving revision 1.1
diff -u -r1.1 test.pasm
--- t/test.pasm 2001/09/10 22:18:43 1.1
+++ t/test.pasm 2001/09/11 01:27:58
@@ -2,7 +2,7 @@
set_i_ic I2, 0
set_i_ic I3, 1
set_i_ic I4, 10000000
-REDO: eq_i_ic I2, I4, DONE, NEXT
+REDO: eq_i_ic_ic I2, I4, DONE, NEXT
NEXT: add_i I2, I2, I3
branch_ic REDO
DONE: time_i I5
Index: t/test2.pasm
===================================================================
RCS file: /home/perlcvs/parrot/t/test2.pasm,v
retrieving revision 1.1
diff -u -r1.1 test2.pasm
--- t/test2.pasm 2001/09/10 22:18:43 1.1
+++ t/test2.pasm 2001/09/11 01:27:58
@@ -1,8 +1,8 @@
set_i_ic I2, 1
set_i_ic I1, 0
set_s_sc S1, "Hello World"
-REDO: eq_i_ic I1, I2, DONE, NEXT
-NEXT: length_s_i I1, S1
+REDO: eq_i_ic_ic I1, I2, DONE, NEXT
+NEXT: length_i_s I1, S1
print_s S1
chopn_s_ic S1, 1
branch_ic REDO
A1
--
Bryan C. Warnock
[EMAIL PROTECTED]