Skip to content

Commit c7bc70c

Browse files
committed
port BigInteger.implMulAdd stub.
1 parent 8cc2315 commit c7bc70c

File tree

21 files changed

+689
-110
lines changed

21 files changed

+689
-110
lines changed

compiler/src/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Assembler.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2377,6 +2377,10 @@ public final void addl(Register dst, Register src) {
23772377
ADD.rmOp.emit(this, DWORD, dst, src);
23782378
}
23792379

2380+
public final void adcl(Register dst, int imm32) {
2381+
ADC.getMIOpcode(DWORD, isByte(imm32)).emit(this, DWORD, dst, imm32);
2382+
}
2383+
23802384
public final void addpd(Register dst, Register src) {
23812385
SSEOp.ADD.emit(this, PD, dst, src);
23822386
}
@@ -2435,6 +2439,10 @@ public final void andl(Register dst, Register src) {
24352439
AND.rmOp.emit(this, DWORD, dst, src);
24362440
}
24372441

2442+
public final void mull(Register src) {
2443+
MUL.emit(this, DWORD, src);
2444+
}
2445+
24382446
public final void andpd(Register dst, Register src) {
24392447
SSEOp.AND.emit(this, PD, dst, src);
24402448
}

compiler/src/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LIRGenerator.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
import org.graalvm.compiler.lir.aarch64.AArch64AtomicMove;
6060
import org.graalvm.compiler.lir.aarch64.AArch64AtomicMove.AtomicReadAndWriteOp;
6161
import org.graalvm.compiler.lir.aarch64.AArch64AtomicMove.CompareAndSwapOp;
62+
import org.graalvm.compiler.lir.aarch64.AArch64BigIntegerMulAddOp;
6263
import org.graalvm.compiler.lir.aarch64.AArch64BigIntegerMultiplyToLenOp;
6364
import org.graalvm.compiler.lir.aarch64.AArch64ByteSwap;
6465
import org.graalvm.compiler.lir.aarch64.AArch64CacheWritebackOp;
@@ -702,6 +703,13 @@ public void emitBigIntegerMultiplyToLen(Value x, Value xlen, Value y, Value ylen
702703
append(new AArch64BigIntegerMultiplyToLenOp(asAllocatable(x), asAllocatable(xlen), asAllocatable(y), asAllocatable(ylen), asAllocatable(z), asAllocatable(zlen)));
703704
}
704705

706+
@Override
707+
public Variable emitBigIntegerMulAdd(Value out, Value in, Value offset, Value len, Value k) {
708+
Variable result = newVariable(len.getValueKind());
709+
append(new AArch64BigIntegerMulAddOp(this, asAllocatable(out), asAllocatable(in), asAllocatable(offset), asAllocatable(len), asAllocatable(k), asAllocatable(result)));
710+
return result;
711+
}
712+
705713
@Override
706714
public Variable emitCalcStringAttributes(CalcStringAttributesEncoding encoding, EnumSet<?> runtimeCheckedCPUFeatures, Value array, Value offset, Value length, boolean assumeValid) {
707715
Variable result = newVariable(LIRKind.value(encoding == CalcStringAttributesEncoding.UTF_8 || encoding == CalcStringAttributesEncoding.UTF_16 ? AArch64Kind.QWORD : AArch64Kind.DWORD));

compiler/src/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRGenerator.java

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
import org.graalvm.compiler.lir.amd64.AMD64ArrayEqualsOp;
7878
import org.graalvm.compiler.lir.amd64.AMD64ArrayIndexOfOp;
7979
import org.graalvm.compiler.lir.amd64.AMD64ArrayRegionCompareToOp;
80+
import org.graalvm.compiler.lir.amd64.AMD64BigIntegerMulAddOp;
8081
import org.graalvm.compiler.lir.amd64.AMD64BigIntegerMultiplyToLenOp;
8182
import org.graalvm.compiler.lir.amd64.AMD64Binary;
8283
import org.graalvm.compiler.lir.amd64.AMD64BinaryConsumer;
@@ -820,7 +821,7 @@ public void emitBigIntegerMultiplyToLen(Value x, Value xlen, Value y, Value ylen
820821
RegisterValue rY = AMD64.rsi.asValue(y.getValueKind());
821822
RegisterValue rYlen = AMD64.rcx.asValue(ylen.getValueKind());
822823
RegisterValue rZ = AMD64.r8.asValue(z.getValueKind());
823-
RegisterValue rZlen = AMD64.r11.asValue(zlen.getValueKind());
824+
RegisterValue rZlen = AMD64.r9.asValue(zlen.getValueKind());
824825

825826
emitMove(rX, x);
826827
emitMove(rXlen, xlen);
@@ -832,6 +833,27 @@ public void emitBigIntegerMultiplyToLen(Value x, Value xlen, Value y, Value ylen
832833
append(new AMD64BigIntegerMultiplyToLenOp(rX, rXlen, rY, rYlen, rZ, rZlen, getHeapBaseRegister()));
833834
}
834835

836+
@Override
837+
public Variable emitBigIntegerMulAdd(Value out, Value in, Value offset, Value len, Value k) {
838+
RegisterValue rOut = AMD64.rdi.asValue(out.getValueKind());
839+
RegisterValue rIn = AMD64.rsi.asValue(in.getValueKind());
840+
RegisterValue rOffset = AMD64.r11.asValue(offset.getValueKind());
841+
RegisterValue rLen = AMD64.rcx.asValue(len.getValueKind());
842+
RegisterValue rK = AMD64.r8.asValue(k.getValueKind());
843+
844+
emitMove(rOut, out);
845+
emitMove(rIn, in);
846+
emitMove(rOffset, offset);
847+
emitMove(rLen, len);
848+
emitMove(rK, k);
849+
850+
append(new AMD64BigIntegerMulAddOp(rOut, rIn, rOffset, rLen, rK, getHeapBaseRegister()));
851+
// result of AMD64BigIntegerMulAddOp is stored at rax
852+
Variable result = newVariable(len.getValueKind());
853+
emitMove(result, AMD64.rax.asValue(len.getValueKind()));
854+
return result;
855+
}
856+
835857
@SuppressWarnings("unchecked")
836858
protected boolean supports(EnumSet<?> runtimeCheckedCPUFeatures, CPUFeature feature) {
837859
assert runtimeCheckedCPUFeatures == null || runtimeCheckedCPUFeatures.isEmpty() || runtimeCheckedCPUFeatures.iterator().next() instanceof CPUFeature;

compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/BigIntegerIntrinsicsTest.java

Lines changed: 29 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@
2929
import java.math.BigInteger;
3030
import java.util.Random;
3131

32+
import org.graalvm.collections.EconomicMap;
33+
import org.graalvm.collections.Pair;
3234
import org.graalvm.compiler.api.test.Graal;
33-
import org.graalvm.compiler.core.test.GraalCompilerTest;
3435
import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig;
3536
import org.graalvm.compiler.hotspot.HotSpotGraalRuntimeProvider;
3637
import org.graalvm.compiler.runtime.RuntimeProvider;
@@ -54,67 +55,57 @@
5455
* is not tested per se (only execution based on admissible intrinsics).
5556
*
5657
*/
57-
public final class BigIntegerIntrinsicsTest extends GraalCompilerTest {
58+
public final class BigIntegerIntrinsicsTest extends HotSpotGraalCompilerTest {
5859

5960
static final int N = 100;
6061

6162
@Test
62-
public void testMultiplyToLen() throws ClassNotFoundException {
63-
// Intrinsic must be available.
64-
Assume.assumeTrue(config.useMultiplyToLenIntrinsic());
65-
66-
Class<?> javaclass = Class.forName("java.math.BigInteger");
67-
68-
TestIntrinsic tin = new TestIntrinsic("testMultiplyAux", javaclass,
69-
"multiply", BigInteger.class);
63+
public void testMultiplyToLen() {
64+
EconomicMap<Pair<BigInteger, BigInteger>, BigInteger> expectedResults = EconomicMap.create();
7065

66+
// interpreter
7167
for (int i = 0; i < N; i++) {
72-
7368
BigInteger big1 = randomBig(i);
7469
BigInteger big2 = randomBig(i);
7570

76-
// Invoke BigInteger BigInteger.multiply(BigInteger)
77-
BigInteger res1 = (BigInteger) tin.invokeJava(big1, big2);
78-
79-
// Invoke BigInteger testMultiplyAux(BigInteger)
80-
BigInteger res2 = (BigInteger) tin.invokeTest(big1, big2);
71+
expectedResults.put(Pair.create(big1, big2), big1.multiply(big2));
72+
}
8173

82-
assertDeepEquals(res1, res2);
74+
InstalledCode intrinsic = getCode(getResolvedJavaMethod(BigInteger.class, "multiplyToLen"), null, true, true, getInitialOptions());
8375

84-
// Invoke BigInteger testMultiplyAux(BigInteger) through code handle.
85-
BigInteger res3 = (BigInteger) tin.invokeCode(big1, big2);
76+
for (Pair<BigInteger, BigInteger> key : expectedResults.getKeys()) {
77+
BigInteger big1 = key.getLeft();
78+
BigInteger big2 = key.getRight();
8679

87-
assertDeepEquals(res1, res3);
80+
assertDeepEquals(big1.multiply(big2), expectedResults.get(key));
8881
}
82+
83+
intrinsic.invalidate();
8984
}
9085

9186
@Test
92-
public void testMulAdd() throws ClassNotFoundException {
93-
// Intrinsic must be available.
94-
Assume.assumeTrue(config.useMulAddIntrinsic() || config.useSquareToLenIntrinsic());
95-
96-
Class<?> javaclass = Class.forName("java.math.BigInteger");
97-
98-
TestIntrinsic tin = new TestIntrinsic("testMultiplyAux", javaclass,
99-
"multiply", BigInteger.class);
87+
public void testMulAdd() {
88+
EconomicMap<Pair<BigInteger, BigInteger>, BigInteger> expectedResults = EconomicMap.create();
10089

90+
// interpreter
10191
for (int i = 0; i < N; i++) {
102-
10392
BigInteger big1 = randomBig(i);
93+
BigInteger big2 = randomBig(i);
10494

105-
// Invoke BigInteger BigInteger.multiply(BigInteger)
106-
BigInteger res1 = (BigInteger) tin.invokeJava(big1, big1);
107-
108-
// Invoke BigInteger testMultiplyAux(BigInteger)
109-
BigInteger res2 = (BigInteger) tin.invokeTest(big1, big1);
95+
// mulAdd is exercised via the call path modPow -> oddModPow -> montReduce
96+
expectedResults.put(Pair.create(big1, big2), big1.modPow(bigTwo, big2));
97+
}
11098

111-
assertDeepEquals(res1, res2);
99+
InstalledCode intrinsic = getCode(getResolvedJavaMethod(BigInteger.class, "mulAdd"), null, true, true, getInitialOptions());
112100

113-
// Invoke BigInteger testMultiplyAux(BigInteger) through code handle.
114-
BigInteger res3 = (BigInteger) tin.invokeCode(big1, big1);
101+
for (Pair<BigInteger, BigInteger> key : expectedResults.getKeys()) {
102+
BigInteger big1 = key.getLeft();
103+
BigInteger big2 = key.getRight();
115104

116-
assertDeepEquals(res1, res3);
105+
assertDeepEquals(big1.modPow(bigTwo, big2), expectedResults.get(key));
117106
}
107+
108+
intrinsic.invalidate();
118109
}
119110

120111
@Test

compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,13 @@ public CompressEncoding getKlassEncoding() {
101101
public final boolean useBiasedLocking = getFlag("UseBiasedLocking", Boolean.class, false, JDK < 18);
102102
public final boolean usePopCountInstruction = getFlag("UsePopCountInstruction", Boolean.class);
103103
public final boolean useUnalignedAccesses = getFlag("UseUnalignedAccesses", Boolean.class);
104-
public final boolean useAESIntrinsics = getFlag("UseAESIntrinsics", Boolean.class);
105-
public final boolean useAESCTRIntrinsics = getFlag("UseAESCTRIntrinsics", Boolean.class);
106104
public final boolean useCRC32Intrinsics = getFlag("UseCRC32Intrinsics", Boolean.class);
107105
public final boolean useCRC32CIntrinsics = getFlag("UseCRC32CIntrinsics", Boolean.class); // JDK-8073583
108-
private final boolean useMultiplyToLenIntrinsic = getFlag("UseMultiplyToLenIntrinsic", Boolean.class);
109106
private final boolean useSHA1Intrinsics = getFlag("UseSHA1Intrinsics", Boolean.class);
110107
private final boolean useSHA256Intrinsics = getFlag("UseSHA256Intrinsics", Boolean.class);
111108
private final boolean useSHA512Intrinsics = getFlag("UseSHA512Intrinsics", Boolean.class);
112-
private final boolean useGHASHIntrinsics = getFlag("UseGHASHIntrinsics", Boolean.class);
113109
private final boolean useMontgomeryMultiplyIntrinsic = getFlag("UseMontgomeryMultiplyIntrinsic", Boolean.class);
114110
private final boolean useMontgomerySquareIntrinsic = getFlag("UseMontgomerySquareIntrinsic", Boolean.class);
115-
private final boolean useMulAddIntrinsic = getFlag("UseMulAddIntrinsic", Boolean.class);
116111
private final boolean useSquareToLenIntrinsic = getFlag("UseSquareToLenIntrinsic", Boolean.class);
117112
public final boolean useVectorizedMismatchIntrinsic = getFlag("UseVectorizedMismatchIntrinsic", Boolean.class);
118113
public final boolean useFMAIntrinsics = getFlag("UseFMA", Boolean.class);
@@ -126,10 +121,6 @@ public CompressEncoding getKlassEncoding() {
126121
* These are methods because in some JDKs the flags are visible but the stubs themselves haven't
127122
* been exported, so we have to check both if the flag is on and if we have the stub.
128123
*/
129-
public boolean useMultiplyToLenIntrinsic() {
130-
return useMultiplyToLenIntrinsic && multiplyToLen != 0;
131-
}
132-
133124
public boolean useSHA1Intrinsics() {
134125
return useSHA1Intrinsics && sha1ImplCompress != 0 && sha1ImplCompressMultiBlock != 0;
135126
}
@@ -142,10 +133,6 @@ public boolean useSHA512Intrinsics() {
142133
return useSHA512Intrinsics && sha512ImplCompress != 0 && sha512ImplCompressMultiBlock != 0;
143134
}
144135

145-
public boolean useGHASHIntrinsics() {
146-
return useGHASHIntrinsics && ghashProcessBlocks != 0;
147-
}
148-
149136
public boolean useMontgomeryMultiplyIntrinsic() {
150137
return useMontgomeryMultiplyIntrinsic && montgomeryMultiply != 0;
151138
}
@@ -154,10 +141,6 @@ public boolean useMontgomerySquareIntrinsic() {
154141
return useMontgomerySquareIntrinsic && montgomerySquare != 0;
155142
}
156143

157-
public boolean useMulAddIntrinsic() {
158-
return useMulAddIntrinsic && mulAdd != 0;
159-
}
160-
161144
public boolean useSquareToLenIntrinsic() {
162145
return useSquareToLenIntrinsic && squareToLen != 0;
163146
}
@@ -178,14 +161,6 @@ public boolean useCRC32CIntrinsics() {
178161
return useCRC32CIntrinsics && updateBytesCRC32C != 0;
179162
}
180163

181-
public boolean useAESCTRIntrinsics() {
182-
return useAESCTRIntrinsics && counterModeAESCrypt != 0;
183-
}
184-
185-
public boolean useVectorizedMismatchIntrinsic() {
186-
return useVectorizedMismatchIntrinsic && vectorizedMismatch != 0;
187-
}
188-
189164
public final boolean useG1GC = getFlag("UseG1GC", Boolean.class);
190165

191166
public final int allocatePrefetchStyle = getFlag("AllocatePrefetchStyle", Integer.class);
@@ -527,10 +502,6 @@ public int threadTlabTopOffset() {
527502
public final long codeCacheLowBound = getFieldValue("CodeCache::_low_bound", Long.class, "address");
528503
public final long codeCacheHighBound = getFieldValue("CodeCache::_high_bound", Long.class, "address");
529504

530-
public final long aescryptEncryptBlockStub = getFieldValue("StubRoutines::_aescrypt_encryptBlock", Long.class, "address");
531-
public final long aescryptDecryptBlockStub = getFieldValue("StubRoutines::_aescrypt_decryptBlock", Long.class, "address");
532-
public final long cipherBlockChainingEncryptAESCryptStub = getFieldValue("StubRoutines::_cipherBlockChaining_encryptAESCrypt", Long.class, "address");
533-
public final long cipherBlockChainingDecryptAESCryptStub = getFieldValue("StubRoutines::_cipherBlockChaining_decryptAESCrypt", Long.class, "address");
534505
public final long updateBytesCRC32Stub = getFieldValue("StubRoutines::_updateBytesCRC32", Long.class, "address");
535506
public final long crcTableAddress = getFieldValue("StubRoutines::_crc_table_adr", Long.class, "address");
536507

@@ -545,10 +516,6 @@ public int threadTlabTopOffset() {
545516
public final long sha3ImplCompress = getFieldValue("StubRoutines::_sha3_implCompress", Long.class, "address", 0L, JVMCI ? JDK >= 17 : JDK >= 19);
546517
public final long sha3ImplCompressMultiBlock = getFieldValue("StubRoutines::_sha3_implCompressMB", Long.class, "address", 0L, JVMCI ? JDK >= 17 : JDK >= 19);
547518

548-
public final long multiplyToLen = getFieldValue("StubRoutines::_multiplyToLen", Long.class, "address");
549-
550-
public final long counterModeAESCrypt = getFieldValue("StubRoutines::_counterMode_AESCrypt", Long.class, "address");
551-
public final long ghashProcessBlocks = getFieldValue("StubRoutines::_ghash_processBlocks", Long.class, "address");
552519
public final long base64EncodeBlock = getFieldValue("StubRoutines::_base64_encodeBlock", Long.class, "address");
553520
public final long base64DecodeBlock = getFieldValue("StubRoutines::_base64_decodeBlock", Long.class, "address");
554521

@@ -565,10 +532,8 @@ public static final boolean base64DecodeBlockHasIsMIMEParameter() {
565532
public final long updateBytesCRC32C = getFieldValue("StubRoutines::_updateBytesCRC32C", Long.class, "address");
566533
public final long updateBytesAdler32 = getFieldValue("StubRoutines::_updateBytesAdler32", Long.class, "address");
567534
public final long squareToLen = getFieldValue("StubRoutines::_squareToLen", Long.class, "address");
568-
public final long mulAdd = getFieldValue("StubRoutines::_mulAdd", Long.class, "address");
569535
public final long montgomeryMultiply = getFieldValue("StubRoutines::_montgomeryMultiply", Long.class, "address");
570536
public final long montgomerySquare = getFieldValue("StubRoutines::_montgomerySquare", Long.class, "address");
571-
public final long vectorizedMismatch = getFieldValue("StubRoutines::_vectorizedMismatch", Long.class, "address");
572537

573538
public final long bigIntegerLeftShiftWorker = getFieldValue("StubRoutines::_bigIntegerLeftShiftWorker", Long.class, "address");
574539
public final long bigIntegerRightShiftWorker = getFieldValue("StubRoutines::_bigIntegerRightShiftWorker", Long.class, "address");

compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackend.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,6 @@ public static class Options {
140140

141141
private final HotSpotGraalRuntimeProvider runtime;
142142

143-
public static final HotSpotForeignCallDescriptor MUL_ADD = new HotSpotForeignCallDescriptor(LEAF_NO_VZERO, NOT_REEXECUTABLE, NamedLocationIdentity.getArrayLocation(JavaKind.Int), "mulAdd",
144-
int.class, Word.class, Word.class, int.class, int.class, int.class);
145-
146143
public static final HotSpotForeignCallDescriptor MONTGOMERY_MULTIPLY = new HotSpotForeignCallDescriptor(LEAF_NO_VZERO, NOT_REEXECUTABLE, NamedLocationIdentity.getArrayLocation(JavaKind.Int),
147144
"implMontgomeryMultiply", void.class, Word.class, Word.class, Word.class, int.class, long.class, Word.class);
148145

compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -692,19 +692,6 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec
692692

693693
private static void registerBigIntegerPlugins(InvocationPlugins plugins, GraalHotSpotVMConfig config, Replacements replacements) {
694694
Registration r = new Registration(plugins, BigInteger.class, replacements);
695-
r.registerConditional(config.useMulAddIntrinsic(), new InvocationPlugin("implMulAdd", int[].class, int[].class, int.class, int.class, int.class) {
696-
@Override
697-
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode out, ValueNode in, ValueNode offset, ValueNode len, ValueNode k) {
698-
try (InvocationPluginHelper helper = new InvocationPluginHelper(b, targetMethod)) {
699-
ValueNode outNonNull = b.nullCheckedValue(out);
700-
ValueNode outNonNullLength = b.add(new ArrayLengthNode(outNonNull));
701-
ValueNode newOffset = new SubNode(outNonNullLength, offset);
702-
ForeignCallNode call = new ForeignCallNode(HotSpotBackend.MUL_ADD, helper.arrayStart(outNonNull, JavaKind.Int), helper.arrayStart(in, JavaKind.Int), newOffset, len, k);
703-
b.addPush(JavaKind.Int, call);
704-
}
705-
return true;
706-
}
707-
});
708695
r.registerConditional(config.useMontgomeryMultiplyIntrinsic(), new InvocationPlugin("implMontgomeryMultiply", int[].class, int[].class, int[].class, int.class, long.class, int[].class) {
709696

710697
@Override

compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotHostForeignCallsProvider.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
import static org.graalvm.compiler.hotspot.HotSpotBackend.MD5_IMPL_COMPRESS_MB;
4242
import static org.graalvm.compiler.hotspot.HotSpotBackend.MONTGOMERY_MULTIPLY;
4343
import static org.graalvm.compiler.hotspot.HotSpotBackend.MONTGOMERY_SQUARE;
44-
import static org.graalvm.compiler.hotspot.HotSpotBackend.MUL_ADD;
4544
import static org.graalvm.compiler.hotspot.HotSpotBackend.NEW_ARRAY;
4645
import static org.graalvm.compiler.hotspot.HotSpotBackend.NEW_ARRAY_OR_NULL;
4746
import static org.graalvm.compiler.hotspot.HotSpotBackend.NEW_INSTANCE;
@@ -138,6 +137,7 @@
138137
import org.graalvm.compiler.replacements.nodes.ArrayEqualsWithMaskForeignCalls;
139138
import org.graalvm.compiler.replacements.nodes.ArrayIndexOfForeignCalls;
140139
import org.graalvm.compiler.replacements.nodes.ArrayRegionCompareToForeignCalls;
140+
import org.graalvm.compiler.replacements.nodes.BigIntegerMulAddNode;
141141
import org.graalvm.compiler.replacements.nodes.BigIntegerMultiplyToLenNode;
142142
import org.graalvm.compiler.replacements.nodes.CalcStringAttributesForeignCalls;
143143
import org.graalvm.compiler.replacements.nodes.CipherBlockChainingAESNode;
@@ -542,9 +542,6 @@ public void initialize(HotSpotProviders providers, OptionValues options) {
542542
if (c.base64DecodeBlock != 0L) {
543543
registerForeignCall(BASE64_DECODE_BLOCK, c.base64DecodeBlock, NativeCall);
544544
}
545-
if (c.useMulAddIntrinsic()) {
546-
registerForeignCall(MUL_ADD, c.mulAdd, NativeCall);
547-
}
548545
if (c.useMontgomeryMultiplyIntrinsic()) {
549546
registerForeignCall(MONTGOMERY_MULTIPLY, c.montgomeryMultiply, NativeCall);
550547
}
@@ -624,6 +621,7 @@ private void registerSnippetStubs(HotSpotProviders providers, OptionValues optio
624621
linkSnippetStubs(providers, options, IntrinsicStubsGen::new, HasNegativesNode.STUB);
625622
linkSnippetStubs(providers, options, IntrinsicStubsGen::new, VectorizedMismatchForeignCalls.STUB);
626623
linkSnippetStubs(providers, options, IntrinsicStubsGen::new, BigIntegerMultiplyToLenNode.STUB);
624+
linkSnippetStubs(providers, options, IntrinsicStubsGen::new, BigIntegerMulAddNode.STUB);
627625
}
628626

629627
@FunctionalInterface

0 commit comments

Comments
 (0)