Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intrinsic for AArch64 Arrays.fill(array, constant) #10207

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2462,6 +2462,12 @@ public void bfm(int size, Register dst, Register src, int r, int s) {
bitfieldInstruction(BFM, dst, src, r, s, generalFromSize(size));
}

public void bfi(int size, Register dst, Register src, int lsb, int width) {
JohnTortugo marked this conversation as resolved.
Show resolved Hide resolved
assert verifySizeAndRegistersRR(size, dst, src);

bfm(size, dst, src, ((size - lsb) & (size - 1)), (width - 1));
}

/**
* C6.2.337 Unsigned bitfield move.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
JohnTortugo marked this conversation as resolved.
Show resolved Hide resolved
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -55,6 +55,7 @@
import jdk.graal.compiler.lir.aarch64.AArch64ArithmeticOp;
import jdk.graal.compiler.lir.aarch64.AArch64ArrayCompareToOp;
import jdk.graal.compiler.lir.aarch64.AArch64ArrayCopyWithConversionsOp;
import jdk.graal.compiler.lir.aarch64.AArch64ArrayFillOp;
import jdk.graal.compiler.lir.aarch64.AArch64ArrayEqualsOp;
import jdk.graal.compiler.lir.aarch64.AArch64ArrayIndexOfOp;
import jdk.graal.compiler.lir.aarch64.AArch64ArrayRegionCompareToOp;
Expand Down Expand Up @@ -623,6 +624,12 @@ public void emitArrayCopyWithConversion(EnumSet<?> runtimeCheckedCPUFeatures, Va
emitConvertNullToZero(arrayDst), asAllocatable(offsetDst), emitConvertNullToZero(arraySrc), asAllocatable(offsetSrc), asAllocatable(length), asAllocatable(dynamicStrides)));
}

@Override
public void emitArrayFill(JavaKind kind, EnumSet<?> runtimeCheckedCPUFeatures, Value array, Value arrayBaseOffset, Value length, Value value) {
GraalError.guarantee(kind.isPrimitive(), "Only Byte and Int are supported for now.");
JohnTortugo marked this conversation as resolved.
Show resolved Hide resolved
append(new AArch64ArrayFillOp(kind, emitConvertNullToZero(array), asAllocatable(arrayBaseOffset), asAllocatable(length), asAllocatable(value)));
}

@Override
public Variable emitArrayEquals(JavaKind kind, EnumSet<?> runtimeCheckedCPUFeatures,
Value arrayA, Value offsetA, Value arrayB, Value offsetB, Value length) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
import jdk.graal.compiler.nodes.java.StoreIndexedNode;
import jdk.graal.compiler.nodes.memory.ReadNode;
import jdk.graal.compiler.nodes.spi.ValueProxy;
import jdk.graal.compiler.replacements.nodes.ArrayFillNode;
import jdk.graal.compiler.replacements.nodes.ArrayEqualsNode;
import jdk.graal.compiler.replacements.nodes.BasicArrayCopyNode;
import jdk.graal.compiler.replacements.nodes.BinaryMathIntrinsicNode;
Expand Down Expand Up @@ -255,6 +256,8 @@ protected void dispatch(Node node) {
lower((InstanceOfNode) node);
} else if (node instanceof InstanceOfDynamicNode) {
lower((InstanceOfDynamicNode) node);
} else if (node instanceof ArrayFillNode) {
lower((ArrayFillNode) node);
} else if (node instanceof ArrayEqualsNode) {
lower((ArrayEqualsNode) node);
} else if (node instanceof NewMultiArrayNode) {
Expand Down Expand Up @@ -407,6 +410,8 @@ protected void handleUnknownNodeType(Node node) {

protected abstract void lower(ArrayEqualsNode node);

protected abstract void lower(ArrayFillNode node);

protected abstract void lower(InstanceOfDynamicNode node);

protected abstract void lower(InstanceOfNode node);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
import jdk.graal.compiler.replacements.nodes.AESNode;
import jdk.graal.compiler.replacements.nodes.ArrayCompareToForeignCalls;
import jdk.graal.compiler.replacements.nodes.ArrayCopyWithConversionsForeignCalls;
import jdk.graal.compiler.replacements.nodes.ArrayFillNode;
import jdk.graal.compiler.replacements.nodes.ArrayEqualsForeignCalls;
import jdk.graal.compiler.replacements.nodes.ArrayEqualsWithMaskForeignCalls;
import jdk.graal.compiler.replacements.nodes.ArrayIndexOfForeignCalls;
Expand Down Expand Up @@ -684,6 +685,7 @@ protected void registerMathStubs(GraalHotSpotVMConfig hotSpotVMConfig, HotSpotPr

private void registerSnippetStubs(HotSpotProviders providers, OptionValues options) {
linkSnippetStubs(providers, options, IntrinsicStubsGen::new, ArrayIndexOfForeignCalls.STUBS);
linkSnippetStubs(providers, options, IntrinsicStubsGen::new, ArrayFillNode.STUBS);
linkSnippetStubs(providers, options, IntrinsicStubsGen::new, ArrayEqualsForeignCalls.STUBS);
linkSnippetStubs(providers, options, IntrinsicStubsGen::new, ArrayEqualsWithMaskForeignCalls.STUBS);
linkSnippetStubs(providers, options, IntrinsicStubsGen::new, ArrayCompareToForeignCalls.STUBS);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
JohnTortugo marked this conversation as resolved.
Show resolved Hide resolved
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -31,6 +31,7 @@
import jdk.graal.compiler.replacements.nodes.ArrayCompareToNode;
import jdk.graal.compiler.replacements.nodes.ArrayCopyWithConversionsNode;
import jdk.graal.compiler.replacements.nodes.ArrayEqualsNode;
import jdk.graal.compiler.replacements.nodes.ArrayFillNode;
import jdk.graal.compiler.replacements.nodes.ArrayIndexOfNode;
import jdk.graal.compiler.replacements.nodes.ArrayRegionCompareToNode;
import jdk.graal.compiler.replacements.nodes.ArrayRegionEqualsNode;
Expand All @@ -55,6 +56,7 @@
@GeneratedStubsHolder(targetVM = "hotspot", sources = {
ArrayIndexOfNode.class,
ArrayEqualsNode.class,
ArrayFillNode.class,
ArrayRegionEqualsNode.class,
ArrayRegionEqualsWithMaskNode.class,
ArrayCompareToNode.class,
Expand Down
Loading
Loading