SmallInteger.st
branchjv
changeset 18374 122c2dc2d0a5
parent 18292 8d4fe353a2d2
parent 18370 0ffb12e5f1b4
child 18383 3a40da3624b7
--- a/SmallInteger.st	Mon May 18 07:10:20 2015 +0100
+++ b/SmallInteger.st	Tue May 19 06:55:39 2015 +0200
@@ -1466,6 +1466,30 @@
 
 %{  /* NOCONTEXT */
 #ifdef __SCHTEAM__
+    long bits = self.longValue();
+    int index = 0;
+
+    if (bits != 0) {
+	if ((bits & 0xFFFFFFFFL)==0) {
+	    index += 32; bits >>= 32;
+	}
+	if ((bits & 0xFFFFL)==0) {
+	    index += 16; bits >>= 16;
+	}
+	if ((bits & 0xFFL)==0) {
+	    index += 8; bits >>= 8;
+	}
+	if ((bits & 0xFL)==0) {
+	    index += 4; bits >>= 4;
+	}
+	if ((bits & 0x3L)==0) {
+	    index += 2; bits >>= 2;
+	}
+	if ((bits & 0x1L)==0) {
+	    index += 1;
+	}
+    }
+    return __c__._RETURN( STInteger._qnew( index ) );
 #else
     unsigned INT bits;
     int index;
@@ -1514,7 +1538,7 @@
     RETURN ( __mkSmallInteger(index) );
 #endif /* not __SCHTEAM__ */
 %}.
-    ^ super lowBit
+    self primitiveFailed "/ must be implemented (or else: recursion)
 
     "
      0 lowBit
@@ -4834,11 +4858,11 @@
 !SmallInteger class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.234 2015-04-26 11:30:22 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.235 2015-05-18 15:23:41 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.234 2015-04-26 11:30:22 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.235 2015-05-18 15:23:41 cg Exp $'
 ! !