# New Ticket Created by "Sean O'Rourke"
# Please include the string: [netlabs #793]
# in the subject line of all future correspondence about this issue.
# <URL: http://bugs6.perl.org/rt2/Ticket/Display.html?id=793 >
This patch adds shl and shr for PMC's.
/s
-- attachment 1 ------------------------------------------------------
url: http://bugs6.perl.org/rt2/attach/3736/3478/13650c/shift.patch
--- core.ops.orig Wed Jul 10 19:03:39 2002
+++ core.ops Wed Jul 10 23:07:14 2002
@@ -2967,6 +2967,8 @@ inline op bor(out PMC, in PMC, in PMC) {
=item B<shl>(out INT, in INT, in INT)
+=item B<shl>(out PMC, in PMC, in PMC)
+
Set $1 to the value of $2 shifted left by $3 bits.
=cut
@@ -2976,11 +2978,17 @@ inline op shl(out INT, in INT, in INT) {
goto NEXT();
}
+inline op shl(out PMC, in PMC, in PMC) {
+ $2->vtable->bitwise_shl(interpreter, $2, $3, $1);
+ goto NEXT();
+}
########################################
=item B<shr>(out INT, in INT, in INT)
+=item B<shr>(out PMC, in PMC, in PMC)
+
Set $1 to the value of $2 shifted right by $3 bits.
=cut
@@ -2990,6 +2998,10 @@ inline op shr(out INT, in INT, in INT) {
goto NEXT();
}
+inline op shr(out PMC, in PMC, in PMC) {
+ $2->vtable->bitwise_shr(interpreter, $2, $3, $1);
+ goto NEXT();
+}
########################################