Skip to content

Commit 06c9f07

Browse files
committed
[GR-70333] Don't use NumUtil in MinMaxCanonicalizationTest
PullRequest: graal/22307
2 parents 22b157b + 3f683a5 commit 06c9f07

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/MinMaxCanonicalizationTest.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
import org.junit.Test;
2929

30-
import jdk.graal.compiler.core.common.NumUtil;
3130
import jdk.graal.compiler.nodes.StructuredGraph;
3231
import jdk.vm.ci.meta.ResolvedJavaMethod;
3332

@@ -102,7 +101,9 @@ public void testByteMaxEqualsToLessThanSymbolic() {
102101
}
103102

104103
public static boolean byteUMaxEqualsToLessThanSnippet(ByteHolder holder) {
105-
return NumUtil.maxUnsigned(holder.b & 0xff, 7) == 7;
104+
byte b = holder.b;
105+
int result = Integer.compareUnsigned(b & 0xff, 7) < 0 ? 7 : b & 0xff;
106+
return result == 7;
106107
}
107108

108109
public static boolean byteUMaxEqualsToLessThanReference(ByteHolder holder) {
@@ -128,7 +129,9 @@ public void testByteMinEqualsToLessThan() {
128129
}
129130

130131
public static boolean byteUMinEqualsToLessThanSnippet(ByteHolder holder) {
131-
return NumUtil.minUnsigned(holder.b & 0xff, 7) == 7;
132+
byte b = holder.b;
133+
int result = Integer.compareUnsigned(b & 0xff, 7) > 0 ? 7 : b & 0xff;
134+
return result == 7;
132135
}
133136

134137
public static boolean byteUMinEqualsToLessThanReference(ByteHolder holder) {

0 commit comments

Comments
 (0)