Browse Source

disable Int32 + change Int64 to use native ops when -D haxe3

Nicolas Cannasse 13 years ago
parent
commit
1aa638f799
6 changed files with 342 additions and 89 deletions
  1. 26 23
      std/cs/_std/haxe/Int32.hx
  2. 43 22
      std/cs/_std/haxe/Int64.hx
  3. 4 0
      std/haxe/Int32.hx
  4. 201 0
      std/haxe/Int64.hx
  5. 25 22
      std/java/_std/haxe/Int32.hx
  6. 43 22
      std/java/_std/haxe/Int64.hx

+ 26 - 23
std/cs/_std/haxe/Int32.hx

@@ -25,116 +25,119 @@
  */
 package haxe;
 
-@:nativegen class Int32 
+#if !haxe3
+
+@:nativegen class Int32
 {
 	public static inline function make( a : Int, b : Int ) : Int32
 	{
 		return cast ((a << 16) | b);
 	}
-	
+
 	public static inline function ofInt( x : Int ) : Int32
 	{
 		return cast x;
 	}
-	
+
 	public static function toInt( x : Int32 ) : Int
 	{
 		if ( (((cast x) >> 30) & 1) != ((cast x) >>> 31) ) throw "Overflow " + x;
-		
+
 		return cast x;
 	}
-	
+
 	public static inline function add( a : Int32, b : Int32 ) : Int32
 	{
 		return cast ((cast a) + cast b);
 	}
-	
+
 	public static inline function sub( a : Int32, b : Int32 ) : Int32
 	{
 		return cast ((cast a) - cast b);
 	}
-	
+
 	public static inline function mul( a : Int32, b : Int32 ) : Int32
 	{
 		return cast ((cast a) * cast b);
 	}
-	
+
 	public static inline function div( a : Int32, b : Int32 ) : Int32
 	{
 		return cast ((cast a) / cast b);
 	}
-	
+
 	public static inline function mod( a : Int32, b : Int32 ) : Int32
 	{
 		return cast ((cast a) % cast b);
 	}
-	
+
 	public static inline function shl( a : Int32, b : Int ) : Int32
 	{
 		return cast ((cast a) << b);
 	}
-	
+
 	public static inline function shr( a : Int32, b : Int ) : Int32
 	{
 		return cast ((cast a) >> b);
 	}
-	
+
 	public static inline function ushr( a : Int32, b : Int ) : Int32
 	{
 		return cast ((cast a) >>> b);
 	}
-	
+
 	public static inline function and( a : Int32, b : Int32 ) : Int32
 	{
 		return cast ((cast a) & cast b);
 	}
-	
+
 	public static inline function or( a : Int32, b : Int32 ) : Int32
 	{
 		return cast ((cast a) | cast b);
 	}
-	
+
 	public static inline function xor( a : Int32, b : Int32 ) : Int32
 	{
 		return cast ((cast a) ^ cast b);
 	}
-	
+
 	public static inline function neg( a : Int32 ) : Int32
 	{
 		return cast -(cast a);
 	}
-	
+
 	public static inline function complement( a : Int32 ) : Int32
 	{
 		return cast ~(cast a);
 	}
-	
+
 	public static inline function compare( a : Int32, b : Int32 ) : Int
 	{
 		return (cast a) - cast b;
 	}
-	
+
 	public static inline function isNeg( a : Int32 ) : Bool
 	{
 		return (cast a) < 0;
 	}
-	
+
 	public static inline function isZero( a : Int32 ) : Bool
 	{
 		return (cast a) == 0;
 	}
-	
+
 	public static inline function ucompare( a : Int32, b : Int32 ) : Int
 	{
 		var ua:UInt = cast a;
 		var ub:UInt = cast b;
-		
+
 		return (ua < ub) ? -1 : ( (ua > ub) ? 1 : 0 );
 	}
-	
+
 	public static inline function toNativeInt(a:Int32) : Int
 	{
 		return cast a;
 	}
 }
 
+#end

+ 43 - 22
std/cs/_std/haxe/Int64.hx

@@ -27,46 +27,67 @@ using haxe.Int64;
 private typedef NativeInt64 = Int;
 private typedef NativeUInt64 = Int;
 
-@:nativegen class Int64 
+@:nativegen class Int64
 {
 	@:extern private static inline function asNative(i:haxe.Int64):NativeInt64 return untyped i
 	@:extern private static inline function ofNative(i:NativeInt64):haxe.Int64 return untyped i
 	@:extern private static inline function mkNative(i:Dynamic):NativeInt64 return i
-	
-	public static inline function make( high : Int32, low : Int32 ) : haxe.Int64 
+
+	#if haxe3
+
+	public static inline function make( high : Int, low : Int ) : haxe.Int64
 	{
 		return ((cast(high, NativeInt64) << 32 ) | (cast(low, NativeInt64))).ofNative();
 	}
 
-	public static inline function ofInt( x : Int ) : haxe.Int64 {
-		return cast x;
+	public static inline function getLow( x : haxe.Int64 ) : Int
+	{
+		return cast (x.asNative() & 0xFFFFFFFF.mkNative());
 	}
 
-	public static inline function ofInt32( x : Int32 ) : haxe.Int64 {
-		return cast x;
+	public static inline function getHigh( x : haxe.Int64 ) : Int32 {
+		return cast(x,NativeUInt64) >> 32;
 	}
 
-	public static inline function toInt( x : haxe.Int64 ) : Int 
+	#else
+
+	public static inline function make( high : Int32, low : Int32 ) : haxe.Int64
 	{
+		return ((cast(high, NativeInt64) << 32 ) | (cast(low, NativeInt64))).ofNative();
+	}
+
+	public static inline function ofInt32( x : Int32 ) : haxe.Int64 {
 		return cast x;
 	}
 
-	public static inline function getLow( x : haxe.Int64 ) : Int32 
+	public static inline function getLow( x : haxe.Int64 ) : Int32
 	{
 		return cast (x.asNative() & 0xFFFFFFFF.mkNative());
 	}
 
-	public static inline function getHigh( x : haxe.Int64 ) : Int32 
+	public static inline function getHigh( x : haxe.Int64 ) : Int32
 	{
-		return cast(cast(x,NativeUInt64) >> 32, Int32);
+		return cast(cast(x,NativeUInt64) >> 32,Int32);
+	}
+
+
+	#end
+
+	public static inline function ofInt( x : Int ) : haxe.Int64 {
+		return cast x;
+	}
+
+	public static inline function toInt( x : haxe.Int64 ) : Int
+	{
+		return cast x;
 	}
 
-	public static inline function add( a : haxe.Int64, b : haxe.Int64 ) : haxe.Int64 
+	public static inline function add( a : haxe.Int64, b : haxe.Int64 ) : haxe.Int64
 	{
 		return (a.asNative() + b.asNative()).ofNative();
 	}
 
-	public static inline function sub( a : haxe.Int64, b : haxe.Int64 ) : haxe.Int64 
+	public static inline function sub( a : haxe.Int64, b : haxe.Int64 ) : haxe.Int64
 	{
 		return (a.asNative() - b.asNative()).ofNative();
 	}
@@ -75,7 +96,7 @@ private typedef NativeUInt64 = Int;
 		return (a.asNative() * b.asNative()).ofNative();
 	}
 
-	static function divMod( modulus : haxe.Int64, divisor : haxe.Int64 ) 
+	static function divMod( modulus : haxe.Int64, divisor : haxe.Int64 )
 	{
 		var q:Int64 = (modulus.asNative() / divisor.asNative()).mkNative().ofNative();
 		var m:Int64 = (modulus.asNative() % divisor.asNative()).mkNative().ofNative();
@@ -102,37 +123,37 @@ private typedef NativeUInt64 = Int;
 		return ( cast(a, NativeUInt64) >> b).ofNative();
 	}
 
-	public static inline function and( a : haxe.Int64, b : haxe.Int64 ) : haxe.Int64 
+	public static inline function and( a : haxe.Int64, b : haxe.Int64 ) : haxe.Int64
 	{
 		return (a.asNative() & b.asNative()).ofNative();
 	}
 
-	public static inline function or( a : haxe.Int64, b : haxe.Int64 ) : haxe.Int64 
+	public static inline function or( a : haxe.Int64, b : haxe.Int64 ) : haxe.Int64
 	{
 		return (a.asNative() | b.asNative()).ofNative();
 	}
 
-	public static inline function xor( a : haxe.Int64, b : haxe.Int64 ) : haxe.Int64 
+	public static inline function xor( a : haxe.Int64, b : haxe.Int64 ) : haxe.Int64
 	{
 		return (a.asNative() ^ b.asNative()).ofNative();
 	}
 
-	public static inline function neg( a : haxe.Int64 ) : haxe.Int64 
+	public static inline function neg( a : haxe.Int64 ) : haxe.Int64
 	{
 		return (~a.asNative()).ofNative();
 	}
 
-	public static inline function isNeg( a : haxe.Int64 ) : Bool 
+	public static inline function isNeg( a : haxe.Int64 ) : Bool
 	{
 		return (a.asNative() < 0.mkNative());
 	}
 
-	public static inline function isZero( a : haxe.Int64 ) : Bool 
+	public static inline function isZero( a : haxe.Int64 ) : Bool
 	{
 		return (a.asNative() == 0.mkNative());
 	}
 
-	public static inline function compare( a : haxe.Int64, b : haxe.Int64 ) : Int 
+	public static inline function compare( a : haxe.Int64, b : haxe.Int64 ) : Int
 	{
 		return cast (a.asNative() - b.asNative());
 	}
@@ -140,7 +161,7 @@ private typedef NativeUInt64 = Int;
 	/**
 		Compare two Int64 in unsigned mode.
 	**/
-	public static function ucompare( a : haxe.Int64, b : haxe.Int64 ) : Int 
+	public static function ucompare( a : haxe.Int64, b : haxe.Int64 ) : Int
 	{
 		if (a.asNative() < 0.mkNative())
 			return (b.asNative() < 0.mkNative()) ? compare( (~a.asNative()).ofNative(), (~b.asNative()).ofNative()) : 1;

+ 4 - 0
std/haxe/Int32.hx

@@ -24,6 +24,8 @@
  */
 package haxe;
 
+#if !haxe3
+
 class Int32 {
 
 	public static inline function make( a : Int, b : Int ) : Int32 {
@@ -137,3 +139,5 @@ class Int32 {
 	}
 
 }
+
+#end

+ 201 - 0
std/haxe/Int64.hx

@@ -23,6 +23,206 @@
  * DAMAGE.
  */
 package haxe;
+
+#if haxe3
+
+class Int64 {
+
+	var high : Int;
+	var low : Int;
+
+	function new(high, low) {
+		this.high = high;
+		this.low = low;
+	}
+
+	#if as3 public #end function toString() {
+		if ((high|low) == 0 )
+			return "0";
+		var str = "";
+		var neg = false;
+		var i = this;
+		if( isNeg(i) ) {
+			neg = true;
+			i = Int64.neg(i);
+		}
+		var ten = ofInt(10);
+		while( !isZero(i) ) {
+			var r = divMod(i, ten);
+			str = r.modulus.low + str;
+			i = r.quotient;
+		}
+		if( neg ) str = "-" + str;
+		return str;
+	}
+
+	public static inline function make( high : Int, low : Int ) : Int64 {
+		return new Int64(high, low);
+	}
+
+	public static inline function ofInt( x : Int ) : Int64 {
+		return new Int64(x >> 31,x);
+	}
+
+	public static function toInt( x : Int64 ) : Int {
+		if( x.high != 0 ) {
+			if( x.high < 0 )
+				return -toInt(neg(x));
+			throw "Overflow";
+		}
+		return x.low;
+	}
+
+	public static function getLow( x : Int64 ) : Int {
+		return x.low;
+	}
+
+	public static function getHigh( x : Int64 ) : Int {
+		return x.high;
+	}
+
+	public static function add( a : Int64, b : Int64 ) : Int64 {
+		var high = a.high + b.high;
+		var low = a.low + b.low;
+		if( uicompare(low,a.low) < 0 )
+			high++;
+		return new Int64(high, low);
+	}
+
+	public static function sub( a : Int64, b : Int64 ) : Int64 {
+		var high = a.high - b.high;
+		var low = a.low - b.low;
+		if( uicompare(a.low,b.low) < 0 )
+			high--;
+		return new Int64(high, low);
+	}
+
+	public static function mul( a : Int64, b : Int64 ) : Int64 {
+		var mask = 0xFFFF;
+		var al = a.low & mask, ah = a.low >>> 16;
+		var bl = b.low & mask, bh = b.low >>> 16;
+		var p00 = al * bl;
+		var p10 = ah * bl;
+		var p01 = al * bh;
+		var p11 = ah * bh;
+		var low = p00;
+		var high = p11 + (p01 >>> 16) + (p10 >>> 16);
+		p01 = (p01 << 16); low += p01; if( uicompare(low,p01) < 0 ) high++;
+		p10 = (p10 << 16); low += p10; if( uicompare(low,p10) < 0 ) high++;
+		high += a.low * b.high;
+		high += a.high * b.low;
+		return new Int64(high, low);
+	}
+
+	static function divMod( modulus : Int64, divisor : Int64 ) {
+		var quotient = new Int64(0, 0);
+		var mask = new Int64(0, 1);
+		divisor = new Int64(divisor.high, divisor.low);
+		while( divisor.high >= 0 ) {
+			var cmp = ucompare(divisor, modulus);
+			divisor.high = (divisor.high << 1) | (divisor.low >>> 31);
+			divisor.low <<= 1;
+			mask.high = (mask.high << 1) | (mask.low >>> 31);
+			mask.low <<= 1;
+			if( cmp >= 0 ) break;
+		}
+		while( (mask.low | mask.high) != 0 ) {
+			if( ucompare(modulus, divisor) >= 0 ) {
+				quotient.high |= mask.high;
+				quotient.low |= mask.low;
+				modulus = sub(modulus,divisor);
+			}
+			mask.low = (mask.low >>> 1) | (mask.high << 31);
+			mask.high >>>= 1;
+
+			divisor.low = (divisor.low >>> 1) | (divisor.high << 31);
+			divisor.high >>>= 1;
+		}
+		return { quotient : quotient, modulus : modulus };
+	}
+
+	public static inline function div( a : Int64, b : Int64 ) : Int64 {
+		var sign = (a.high | b.high) < 0;
+		if( a.high < 0 ) a = neg(a);
+		if( b.high < 0 ) b = neg(b);
+		var q = divMod(a, b).quotient;
+		return sign ? neg(q) : q;
+	}
+
+	public static inline function mod( a : Int64, b : Int64 ) : Int64 {
+		var sign = (a.high | b.high) < 0;
+		if( a.high < 0 ) a = neg(a);
+		if( b.high < 0 ) b = neg(b);
+		var m = divMod(a, b).modulus;
+		return sign ? neg(m) : m;
+	}
+
+	public static inline function shl( a : Int64, b : Int ) : Int64 {
+		return if( b & 63 == 0 ) a else if( b & 63 < 32 ) new Int64( (a.high << b) | (a.low >>> (32-(b&63))), a.low << b ) else new Int64( a.low << (b - 32), 0 );
+	}
+
+	public static inline function shr( a : Int64, b : Int ) : Int64 {
+		return if( b & 63 == 0 ) a else if( b & 63 < 32 ) new Int64( a.high >> b, (a.low >>> b) | (a.high << (32 - (b&63))) ) else new Int64( a.high >> 31, a.high >> (b - 32) );
+	}
+
+	public static inline function ushr( a : Int64, b : Int ) : Int64 {
+		return if( b & 63 == 0 ) a else if( b & 63 < 32 ) new Int64( a.high >>> b, (a.low >>> b) | (a.high << (32 - (b&63))) ) else new Int64( 0, a.high >>> b - 32 );
+	}
+
+	public static inline function and( a : Int64, b : Int64 ) : Int64 {
+		return new Int64( a.high & b.high, a.low & b.low );
+	}
+
+	public static inline function or( a : Int64, b : Int64 ) : Int64 {
+		return new Int64( a.high | b.high, a.low | b.low );
+	}
+
+	public static inline function xor( a : Int64, b : Int64 ) : Int64 {
+		return new Int64( a.high ^ b.high, a.low ^ b.low );
+	}
+
+	public static inline function neg( a : Int64 ) : Int64 {
+		var high = ~a.high;
+		var low = -a.low;
+		if( low == 0 )
+			high++;
+		return new Int64(high,low);
+	}
+
+	public static inline function isNeg( a : Int64 ) : Bool {
+		return a.high < 0;
+	}
+
+	public static inline function isZero( a : Int64 ) : Bool {
+		return (a.high | a.low) == 0;
+	}
+
+	static function uicompare( a : Int, b : Int ) {
+		return a < 0 ? (b < 0 ? ~b - ~a : 1) : (b < 0 ? -1 : a - b);
+	}
+
+	public static inline function compare( a : Int64, b : Int64 ) : Int {
+		var v = a.high - b.high;
+		return if( v != 0 ) v else uicompare(a.low,b.low);
+	}
+
+	/**
+		Compare two Int64 in unsigned mode.
+	**/
+	public static inline function ucompare( a : Int64, b : Int64 ) : Int {
+		var v = uicompare(a.high,b.high);
+		return if( v != 0 ) v else uicompare(a.low, b.low);
+	}
+
+	public static inline function toStr( a : Int64 ) : String {
+		return a.toString();
+	}
+
+}
+
+
+#else
+
 using haxe.Int32;
 
 class Int64 {
@@ -220,3 +420,4 @@ class Int64 {
 }
 
 
+#end

+ 25 - 22
std/java/_std/haxe/Int32.hx

@@ -25,116 +25,119 @@
  */
 package haxe;
 
+#if !haxe3
+
 @:nativegen
-class Int32 
+class Int32
 {
 	public static inline function make( a : Int, b : Int ) : Int32
 	{
 		return cast ((a << 16) | b);
 	}
-	
+
 	public static inline function ofInt( x : Int ) : Int32
 	{
 		return cast x;
 	}
-	
+
 	public static function toInt( x : Int32 ) : Int
 	{
 		if ( (((cast x) >> 30) & 1) != ((cast x) >>> 31) ) throw "Overflow " + x;
-		
+
 		return cast x;
 	}
-	
+
 	public static inline function add( a : Int32, b : Int32 ) : Int32
 	{
 		return cast ((cast a) + cast b);
 	}
-	
+
 	public static inline function sub( a : Int32, b : Int32 ) : Int32
 	{
 		return cast ((cast a) - cast b);
 	}
-	
+
 	public static inline function mul( a : Int32, b : Int32 ) : Int32
 	{
 		return cast ((cast a) * cast b);
 	}
-	
+
 	public static inline function div( a : Int32, b : Int32 ) : Int32
 	{
 		return cast ((cast a) / cast b);
 	}
-	
+
 	public static inline function mod( a : Int32, b : Int32 ) : Int32
 	{
 		return cast ((cast a) % cast b);
 	}
-	
+
 	public static inline function shl( a : Int32, b : Int ) : Int32
 	{
 		return cast ((cast a) << b);
 	}
-	
+
 	public static inline function shr( a : Int32, b : Int ) : Int32
 	{
 		return cast ((cast a) >> b);
 	}
-	
+
 	public static inline function ushr( a : Int32, b : Int ) : Int32
 	{
 		return cast ((cast a) >>> b);
 	}
-	
+
 	public static inline function and( a : Int32, b : Int32 ) : Int32
 	{
 		return cast ((cast a) & cast b);
 	}
-	
+
 	public static inline function or( a : Int32, b : Int32 ) : Int32
 	{
 		return cast ((cast a) | cast b);
 	}
-	
+
 	public static inline function xor( a : Int32, b : Int32 ) : Int32
 	{
 		return cast ((cast a) ^ cast b);
 	}
-	
+
 	public static inline function neg( a : Int32 ) : Int32
 	{
 		return cast -(cast a);
 	}
-	
+
 	public static inline function complement( a : Int32 ) : Int32
 	{
 		return cast ~(cast a);
 	}
-	
+
 	public static inline function compare( a : Int32, b : Int32 ) : Int
 	{
 		return (cast a) - cast b;
 	}
-	
+
 	public static inline function isNeg( a : Int32 ) : Bool
 	{
 		return (cast a) < 0;
 	}
-	
+
 	public static inline function isZero( a : Int32 ) : Bool
 	{
 		return (cast a) == 0;
 	}
-	
+
 	public static function ucompare( a : Int32, b : Int32 ) : Int
 	{
 		if( isNeg(a) )
 			return isNeg(b) ? compare(complement(b),complement(a)) : 1;
 		return isNeg(b) ? -1 : compare(a,b);
 	}
-	
+
 	public static inline function toNativeInt(a:Int32) : Int
 	{
 		return cast a;
 	}
 }
 
+#end

+ 43 - 22
std/java/_std/haxe/Int64.hx

@@ -26,46 +26,67 @@ package haxe;
 using haxe.Int64;
 private typedef NativeInt64 = Int;
 
-@:nativegen class Int64 
+@:nativegen class Int64
 {
 	@:extern private static inline function asNative(i:haxe.Int64):NativeInt64 return untyped i
 	@:extern private static inline function ofNative(i:NativeInt64):haxe.Int64 return untyped i
 	@:extern private static inline function mkNative(i:Dynamic):NativeInt64 return i
 	
-	public static inline function make( high : Int32, low : Int32 ) : haxe.Int64 
+	#if haxe3
+	
+	public static inline function make( high : Int, low : Int ) : haxe.Int64
 	{
 		return ((cast(high, NativeInt64) << 32 ) | (cast(low, NativeInt64))).ofNative();
 	}
 
-	public static inline function ofInt( x : Int ) : haxe.Int64 {
-		return cast x;
+	public static inline function getLow( x : haxe.Int64 ) : Int
+	{
+		return cast (x.asNative() & 0xFFFFFFFF.mkNative());
 	}
 
-	public static inline function ofInt32( x : Int32 ) : haxe.Int64 {
-		return cast x;
+	public static inline function getHigh( x : haxe.Int64 ) : Int
+	{
+		return cast(x,NativeInt64) >>> 32;
 	}
-
-	public static inline function toInt( x : haxe.Int64 ) : Int 
+	
+	#else
+	
+	public static inline function make( high : Int32, low : Int32 ) : haxe.Int64
 	{
-		return cast x;
+		return ((cast(high, NativeInt64) << 32 ) | (cast(low, NativeInt64))).ofNative();
 	}
 
-	public static inline function getLow( x : haxe.Int64 ) : Int32 
+	public static inline function ofInt32( x : Int32 ) : haxe.Int64 {
+		return cast x;
+	}
+	
+	public static inline function getLow( x : haxe.Int64 ) : Int32
 	{
 		return cast (x.asNative() & 0xFFFFFFFF.mkNative());
 	}
 
-	public static inline function getHigh( x : haxe.Int64 ) : Int32 
+	public static inline function getHigh( x : haxe.Int64 ) : Int32
 	{
 		return cast(cast(x,NativeInt64) >>> 32, Int32);
 	}
 
-	public static inline function add( a : haxe.Int64, b : haxe.Int64 ) : haxe.Int64 
+	#end
+
+	public static inline function ofInt( x : Int ) : haxe.Int64 {
+		return cast x;
+	}
+
+	public static inline function toInt( x : haxe.Int64 ) : Int
+	{
+		return cast x;
+	}
+
+	public static inline function add( a : haxe.Int64, b : haxe.Int64 ) : haxe.Int64
 	{
 		return (a.asNative() + b.asNative()).ofNative();
 	}
 
-	public static inline function sub( a : haxe.Int64, b : haxe.Int64 ) : haxe.Int64 
+	public static inline function sub( a : haxe.Int64, b : haxe.Int64 ) : haxe.Int64
 	{
 		return (a.asNative() - b.asNative()).ofNative();
 	}
@@ -74,7 +95,7 @@ private typedef NativeInt64 = Int;
 		return (a.asNative() * b.asNative()).ofNative();
 	}
 
-	static function divMod( modulus : haxe.Int64, divisor : haxe.Int64 ) 
+	static function divMod( modulus : haxe.Int64, divisor : haxe.Int64 )
 	{
 		var q:Int64 = (modulus.asNative() / divisor.asNative()).mkNative().ofNative();
 		var m:Int64 = (modulus.asNative() % divisor.asNative()).mkNative().ofNative();
@@ -101,37 +122,37 @@ private typedef NativeInt64 = Int;
 		return (a.asNative() >>> b).ofNative();
 	}
 
-	public static inline function and( a : haxe.Int64, b : haxe.Int64 ) : haxe.Int64 
+	public static inline function and( a : haxe.Int64, b : haxe.Int64 ) : haxe.Int64
 	{
 		return (a.asNative() & b.asNative()).ofNative();
 	}
 
-	public static inline function or( a : haxe.Int64, b : haxe.Int64 ) : haxe.Int64 
+	public static inline function or( a : haxe.Int64, b : haxe.Int64 ) : haxe.Int64
 	{
 		return (a.asNative() | b.asNative()).ofNative();
 	}
 
-	public static inline function xor( a : haxe.Int64, b : haxe.Int64 ) : haxe.Int64 
+	public static inline function xor( a : haxe.Int64, b : haxe.Int64 ) : haxe.Int64
 	{
 		return (a.asNative() ^ b.asNative()).ofNative();
 	}
 
-	public static inline function neg( a : haxe.Int64 ) : haxe.Int64 
+	public static inline function neg( a : haxe.Int64 ) : haxe.Int64
 	{
 		return (~a.asNative()).ofNative();
 	}
 
-	public static inline function isNeg( a : haxe.Int64 ) : Bool 
+	public static inline function isNeg( a : haxe.Int64 ) : Bool
 	{
 		return (a.asNative() < 0.mkNative());
 	}
 
-	public static inline function isZero( a : haxe.Int64 ) : Bool 
+	public static inline function isZero( a : haxe.Int64 ) : Bool
 	{
 		return (a.asNative() == 0.mkNative());
 	}
 
-	public static inline function compare( a : haxe.Int64, b : haxe.Int64 ) : Int 
+	public static inline function compare( a : haxe.Int64, b : haxe.Int64 ) : Int
 	{
 		return cast (a.asNative() - b.asNative());
 	}
@@ -139,7 +160,7 @@ private typedef NativeInt64 = Int;
 	/**
 		Compare two Int64 in unsigned mode.
 	**/
-	public static function ucompare( a : haxe.Int64, b : haxe.Int64 ) : Int 
+	public static function ucompare( a : haxe.Int64, b : haxe.Int64 ) : Int
 	{
 		if (a.asNative() < 0.mkNative())
 			return (b.asNative() < 0.mkNative()) ? compare( (~a.asNative()).ofNative(), (~b.asNative()).ofNative()) : 1;