mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-22 03:17:54 +00:00
8380988: C2: Unexpected node in SuperWord truncation: UModI/UDivI
Reviewed-by: epeter, jkarthikeyan
This commit is contained in:
parent
ca3fe721ba
commit
61df7cc8b9
@ -2500,7 +2500,9 @@ static bool can_subword_truncate(Node* in, const Type* type) {
|
||||
switch (opc) {
|
||||
case Op_AbsI:
|
||||
case Op_DivI:
|
||||
case Op_UDivI:
|
||||
case Op_ModI:
|
||||
case Op_UModI:
|
||||
case Op_MinI:
|
||||
case Op_MaxI:
|
||||
case Op_CMoveI:
|
||||
|
||||
@ -29,7 +29,7 @@ import compiler.lib.generators.*;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8350177 8362171 8369881 8342095
|
||||
* @bug 8350177 8362171 8369881 8342095 8380988
|
||||
* @summary Ensure that truncation of subword vectors produces correct results
|
||||
* @library /test/lib /
|
||||
* @run driver compiler.vectorization.TestSubwordTruncation
|
||||
@ -448,6 +448,50 @@ public class TestSubwordTruncation {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@IR(counts = { IRNode.UMOD_I, ">0" })
|
||||
@Arguments(setup = "setupByteArray")
|
||||
public Object[] testUMod(final byte[] in) {
|
||||
int n = G.next().intValue();
|
||||
for (int i = 1; i < SIZE; i++) {
|
||||
in[i] = (byte) Integer.remainderUnsigned(n, i);
|
||||
}
|
||||
|
||||
return new Object[] { Integer.valueOf(n), in };
|
||||
}
|
||||
|
||||
@Check(test = "testUMod")
|
||||
public void checkTestUMod(Object[] vals) {
|
||||
int n = (Integer) vals[0];
|
||||
byte[] res = (byte[]) vals[1];
|
||||
for (int i = 1; i < SIZE; i++) {
|
||||
byte val = (byte) Integer.remainderUnsigned(n, i);
|
||||
Asserts.assertEQ(res[i], val);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@IR(counts = { IRNode.UDIV_I, ">0" })
|
||||
@Arguments(setup = "setupByteArray")
|
||||
public Object[] testUDiv(final byte[] in) {
|
||||
int n = G.next().intValue();
|
||||
for (int i = 1; i < SIZE; i++) {
|
||||
in[i] = (byte) Integer.divideUnsigned(n, i);
|
||||
}
|
||||
|
||||
return new Object[] { Integer.valueOf(n), in };
|
||||
}
|
||||
|
||||
@Check(test = "testUDiv")
|
||||
public void checkTestUDiv(Object[] vals) {
|
||||
int n = (Integer) vals[0];
|
||||
byte[] res = (byte[]) vals[1];
|
||||
for (int i = 1; i < SIZE; i++) {
|
||||
byte val = (byte) Integer.divideUnsigned(n, i);
|
||||
Asserts.assertEQ(res[i], val);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@IR(counts = { IRNode.CMP_LT_MASK, ">0" })
|
||||
@Arguments(setup = "setupByteArray")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user