Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d01053f

Browse filesBrowse files
author
hborders
committed
Added all other non-native (mostly bit twiddling) methods.
1 parent 7ab35a3 commit d01053f
Copy full SHA for d01053f

1 file changed

+41-1Lines changed: 41 additions & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎JavaInJava/src/com/sun/max/vm/compiler/builtin/SpecialBuiltin.java‎

Copy file name to clipboardExpand all lines: JavaInJava/src/com/sun/max/vm/compiler/builtin/SpecialBuiltin.java
+41-1Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
package com.sun.max.vm.compiler.builtin;
2222

23-
import com.sun.max.unsafe.Word;
23+
import com.sun.max.unsafe.*;
2424

2525
/**
2626
* @author Bernd Mathiske
@@ -54,4 +54,44 @@ public static int mostSignificantBit(Word value) {
5454
}
5555
return Long.numberOfTrailingZeros(l);
5656
}
57+
58+
public static boolean aboveEqual(int value1, int value2) {
59+
final long unsignedInt1 = value1 & 0xFFFFFFFFL;
60+
final long unsignedInt2 = value2 & 0xFFFFFFFFL;
61+
return unsignedInt1 >= unsignedInt2;
62+
}
63+
64+
public static boolean aboveThan(int value1, int value2) {
65+
final long unsignedInt1 = value1 & 0xFFFFFFFFL;
66+
final long unsignedInt2 = value2 & 0xFFFFFFFFL;
67+
return unsignedInt1 > unsignedInt2;
68+
}
69+
70+
public static boolean belowEqual(int value1, int value2) {
71+
final long unsignedInt1 = value1 & 0xFFFFFFFFL;
72+
final long unsignedInt2 = value2 & 0xFFFFFFFFL;
73+
return unsignedInt1 <= unsignedInt2;
74+
}
75+
76+
public static boolean belowThan(int value1, int value2) {
77+
final long unsignedInt1 = value1 & 0xFFFFFFFFL;
78+
final long unsignedInt2 = value2 & 0xFFFFFFFFL;
79+
return unsignedInt1 < unsignedInt2;
80+
}
81+
82+
public static float intToFloat(int value) {
83+
return Float.intBitsToFloat(value);
84+
}
85+
86+
public static int floatToInt(float value) {
87+
return Float.floatToRawIntBits(value);
88+
}
89+
90+
public static double longToDouble(long value) {
91+
return Double.longBitsToDouble(value);
92+
}
93+
94+
public static long doubleToLong(double value) {
95+
return Double.doubleToRawLongBits(value);
96+
}
5797
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.