Skip to content

Commit

Permalink
Merge pull request #17034 from gita-omr/new_convert_intrinsic
Browse files Browse the repository at this point in the history
New convert intrinsic
  • Loading branch information
knn-k authored Mar 31, 2023
2 parents 511fd75 + bbe4e85 commit 2f292f3
Show file tree
Hide file tree
Showing 6 changed files with 532 additions and 164 deletions.
1 change: 1 addition & 0 deletions runtime/compiler/codegen/J9RecognizedMethodsEnum.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@
jdk_internal_vm_vector_VectorSupport_binaryOp,
jdk_internal_vm_vector_VectorSupport_blend,
jdk_internal_vm_vector_VectorSupport_compare,
jdk_internal_vm_vector_VectorSupport_convert,
jdk_internal_vm_vector_VectorSupport_fromBitsCoerced,
jdk_internal_vm_vector_VectorSupport_maskReductionCoerced,
jdk_internal_vm_vector_VectorSupport_reductionCoerced,
Expand Down
1 change: 1 addition & 0 deletions runtime/compiler/env/j9method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3013,6 +3013,7 @@ void TR_ResolvedJ9Method::construct()
{x(TR::jdk_internal_vm_vector_VectorSupport_binaryOp, "binaryOp", "(ILjava/lang/Class;Ljava/lang/Class;Ljava/lang/Class;ILjdk/internal/vm/vector/VectorSupport$VectorPayload;Ljdk/internal/vm/vector/VectorSupport$VectorPayload;Ljdk/internal/vm/vector/VectorSupport$VectorMask;Ljdk/internal/vm/vector/VectorSupport$BinaryOperation;)Ljdk/internal/vm/vector/VectorSupport$VectorPayload;" )},
{x(TR::jdk_internal_vm_vector_VectorSupport_blend, "blend", "(Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/Class;ILjdk/internal/vm/vector/VectorSupport$Vector;Ljdk/internal/vm/vector/VectorSupport$Vector;Ljdk/internal/vm/vector/VectorSupport$VectorMask;Ljdk/internal/vm/vector/VectorSupport$VectorBlendOp;)Ljdk/internal/vm/vector/VectorSupport$Vector;")},
{x(TR::jdk_internal_vm_vector_VectorSupport_compare, "compare", "(ILjava/lang/Class;Ljava/lang/Class;Ljava/lang/Class;ILjdk/internal/vm/vector/VectorSupport$Vector;Ljdk/internal/vm/vector/VectorSupport$Vector;Ljdk/internal/vm/vector/VectorSupport$VectorMask;Ljdk/internal/vm/vector/VectorSupport$VectorCompareOp;)Ljdk/internal/vm/vector/VectorSupport$VectorMask;")},
{x(TR::jdk_internal_vm_vector_VectorSupport_convert, "convert", "(ILjava/lang/Class;Ljava/lang/Class;ILjava/lang/Class;Ljava/lang/Class;ILjdk/internal/vm/vector/VectorSupport$VectorPayload;Ljdk/internal/vm/vector/VectorSupport$VectorSpecies;Ljdk/internal/vm/vector/VectorSupport$VectorConvertOp;)Ljdk/internal/vm/vector/VectorSupport$VectorPayload;")},
{x(TR::jdk_internal_vm_vector_VectorSupport_fromBitsCoerced, "fromBitsCoerced", "(Ljava/lang/Class;Ljava/lang/Class;IJILjdk/internal/vm/vector/VectorSupport$VectorSpecies;Ljdk/internal/vm/vector/VectorSupport$FromBitsCoercedOperation;)Ljdk/internal/vm/vector/VectorSupport$VectorPayload;")},
{x(TR::jdk_internal_vm_vector_VectorSupport_maskReductionCoerced, "maskReductionCoerced", "(ILjava/lang/Class;Ljava/lang/Class;ILjdk/internal/vm/vector/VectorSupport$VectorMask;Ljdk/internal/vm/vector/VectorSupport$VectorMaskOp;)J")},
{x(TR::jdk_internal_vm_vector_VectorSupport_reductionCoerced, "reductionCoerced", "(ILjava/lang/Class;Ljava/lang/Class;Ljava/lang/Class;ILjdk/internal/vm/vector/VectorSupport$Vector;Ljdk/internal/vm/vector/VectorSupport$VectorMask;Ljdk/internal/vm/vector/VectorSupport$ReductionOperation;)J")},
Expand Down
2 changes: 1 addition & 1 deletion runtime/compiler/il/J9DataTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ J9::ILOpCode::getDataTypeConversion(TR::DataType t1, TR::DataType t2)

if (t1.isMask() || t2.isMask()) return TR::BadILOp;

if (t1.isVector() && t2.isVector()) return TR::ILOpCode::createVectorOpCode(TR::vcast, t1, t2);
if (t1.isVector() && t2.isVector()) return TR::ILOpCode::createVectorOpCode(TR::vconv, t1, t2);

if (t1.isVector() || t2.isVector()) return TR::BadILOp;

Expand Down
5 changes: 5 additions & 0 deletions runtime/compiler/optimizer/J9ValuePropagation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3553,6 +3553,8 @@ J9::ValuePropagation::innerConstrainAcall(TR::Node *node)
method->getRecognizedMethod() == TR::jdk_internal_vm_vector_VectorSupport_ternaryOp;
bool isVectorSupportCompare =
method->getRecognizedMethod() == TR::jdk_internal_vm_vector_VectorSupport_compare;
bool isVectorSupportConvert =
method->getRecognizedMethod() == TR::jdk_internal_vm_vector_VectorSupport_convert;
bool isVectorSupportBlend =
method->getRecognizedMethod() == TR::jdk_internal_vm_vector_VectorSupport_blend;

Expand All @@ -3562,6 +3564,7 @@ J9::ValuePropagation::innerConstrainAcall(TR::Node *node)
isVectorSupportUnaryOp ||
isVectorSupportTernaryOp ||
isVectorSupportCompare ||
isVectorSupportConvert ||
isVectorSupportBlend)
{
bool isGlobal; // dummy
Expand All @@ -3573,6 +3576,8 @@ J9::ValuePropagation::innerConstrainAcall(TR::Node *node)
typeChildIndex = 0;
else if (isVectorSupportCompare)
typeChildIndex = 2;
else if (isVectorSupportConvert)
typeChildIndex = 4;
else
typeChildIndex = 1;

Expand Down
Loading

0 comments on commit 2f292f3

Please sign in to comment.