cvsuser 03/12/11 03:29:20
Modified: classes perlnum.pmc perlstring.pmc
Log:
fix bitwise Perlscalar methods
* PerlString bitwise_* did morph SELF to PerlInt
* PerlNum did bitwise with binary float image
* removed all - scalar.pmc has a sound default implementation
* still missing are the string bitwise methods
Revision Changes Path
1.48 +1 -50 parrot/classes/perlnum.pmc
Index: perlnum.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/perlnum.pmc,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -w -r1.47 -r1.48
--- perlnum.pmc 4 Dec 2003 11:50:36 -0000 1.47
+++ perlnum.pmc 11 Dec 2003 11:29:20 -0000 1.48
@@ -1,7 +1,7 @@
/* perlnum.pmc
* Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
* CVS Info
- * $Id: perlnum.pmc,v 1.47 2003/12/04 11:50:36 leo Exp $
+ * $Id: perlnum.pmc,v 1.48 2003/12/11 11:29:20 leo Exp $
* Overview:
* These are the vtable functions for the PerlNum base class
* Data Structure and Algorithms:
@@ -190,55 +190,6 @@
SELF->cache.num_val = -SELF->cache.num_val;
else
VTABLE_set_number_native(INTERP, dest, -SELF->cache.num_val);
- }
-
- void bitwise_or (PMC* value, PMC* dest) {
- VTABLE_set_integer_native(INTERP, dest,
- /* XXX ? */
- (INTVAL)SELF->cache.num_val |
- VTABLE_get_integer(INTERP, value)
- );
- }
-
- void bitwise_or_int (INTVAL value, PMC* dest) {
- VTABLE_set_integer_native(INTERP, dest,
- (INTVAL)SELF->cache.num_val |
- value
- );
- }
-
- void bitwise_and (PMC* value, PMC* dest) {
- VTABLE_set_integer_native(INTERP, dest,
- (INTVAL)SELF->cache.num_val &
- VTABLE_get_integer(INTERP, value)
- );
- }
-
- void bitwise_and_int (INTVAL value, PMC* dest) {
- VTABLE_set_integer_native(INTERP, dest,
- (INTVAL)SELF->cache.num_val &
- value
- );
- }
-
- void bitwise_xor (PMC* value, PMC* dest) {
- VTABLE_set_integer_native(INTERP, dest,
- (INTVAL)SELF->cache.num_val ^
- VTABLE_get_integer(INTERP, value)
- );
- }
-
- void bitwise_xor_int (INTVAL value, PMC* dest) {
- VTABLE_set_integer_native(INTERP, dest,
- (INTVAL)SELF->cache.num_val ^
- value
- );
- }
-
- void bitwise_not (PMC* dest) {
- VTABLE_set_integer_native(INTERP, dest,
- ~(INTVAL)SELF->cache.num_val
- );
}
/* == operation */
1.57 +1 -57 parrot/classes/perlstring.pmc
Index: perlstring.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/perlstring.pmc,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -w -r1.56 -r1.57
--- perlstring.pmc 4 Dec 2003 11:50:36 -0000 1.56
+++ perlstring.pmc 11 Dec 2003 11:29:20 -0000 1.57
@@ -1,7 +1,7 @@
/* perlstring.pmc
* Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
* CVS Info
- * $Id: perlstring.pmc,v 1.56 2003/12/04 11:50:36 leo Exp $
+ * $Id: perlstring.pmc,v 1.57 2003/12/11 11:29:20 leo Exp $
* Overview:
* These are the vtable functions for the PerlString base class
* Data Structure and Algorithms:
@@ -175,62 +175,6 @@
}
}
- void bitwise_or (PMC* value, PMC* dest) {
- /* XXX or bitwise string? */
- DYNSELF.morph(enum_class_PerlInt);
- VTABLE_set_integer_native(INTERP, dest,
- VTABLE_get_integer(INTERP, SELF) |
- VTABLE_get_integer(INTERP, value)
- );
- }
-
- void bitwise_or_int (INTVAL value, PMC* dest) {
- DYNSELF.morph(enum_class_PerlInt);
- VTABLE_set_integer_native(INTERP, dest,
- VTABLE_get_integer(INTERP, SELF) |
- value
- );
- }
-
-
- void bitwise_and (PMC* value, PMC* dest) {
- DYNSELF.morph(enum_class_PerlInt);
- VTABLE_set_integer_native(INTERP, dest,
- VTABLE_get_integer(INTERP, SELF) &
- VTABLE_get_integer(INTERP, value)
- );
- }
-
- void bitwise_and_int (INTVAL value, PMC* dest) {
- DYNSELF.morph(enum_class_PerlInt);
- VTABLE_set_integer_native(INTERP, dest,
- VTABLE_get_integer(INTERP, SELF) &
- value
- );
- }
-
- void bitwise_xor (PMC* value, PMC* dest) {
- DYNSELF.morph(enum_class_PerlInt);
- VTABLE_set_integer_native(INTERP, dest,
- VTABLE_get_integer(INTERP, SELF) ^
- VTABLE_get_integer(INTERP, value)
- );
- }
-
- void bitwise_xor_int (INTVAL value, PMC* dest) {
- DYNSELF.morph(enum_class_PerlInt);
- VTABLE_set_integer_native(INTERP, dest,
- VTABLE_get_integer(INTERP, SELF) ^
- value
- );
- }
-
- void bitwise_not (PMC* dest) {
- DYNSELF.morph(enum_class_PerlInt);
- VTABLE_set_integer_native(INTERP, dest,
- ~VTABLE_get_integer(INTERP, SELF)
- );
- }
void concatenate (PMC* value, PMC* dest) {
STRING* s = SELF->cache.string_val;