Skip to content

Commit

Permalink
Merge pull request #6833 from Akira1Saitoh/aarch64EnableBitselect
Browse files Browse the repository at this point in the history
AArch64: Enable vbitselect opcode for all element types
  • Loading branch information
knn-k committed Dec 2, 2022
2 parents 625ada6 + d087c31 commit 90eea45
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion compiler/aarch64/codegen/OMRCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ bool OMR::ARM64::CodeGenerator::getSupportsOpCodeForAutoSIMD(TR::CPU *cpu, TR::I
case TR::vmcmple:
case TR::vmcmplt:
case TR::vmcmpne:
case TR::vbitselect:
return true;
case TR::vand:
case TR::vor:
Expand All @@ -689,7 +690,6 @@ bool OMR::ARM64::CodeGenerator::getSupportsOpCodeForAutoSIMD(TR::CPU *cpu, TR::I
case TR::vmreductionOr:
case TR::vreductionXor:
case TR::vmreductionXor:
case TR::vbitselect:
case TR::vmand:
case TR::vmor:
case TR::vmxor:
Expand Down
6 changes: 2 additions & 4 deletions compiler/aarch64/codegen/OMRTreeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3061,11 +3061,9 @@ OMR::ARM64::TreeEvaluator::vbitselectEvaluator(TR::Node *node, TR::CodeGenerator
case TR::Int16:
case TR::Int32:
case TR::Int64:
break;
case TR::Float:
case TR::Double:
TR_ASSERT_FATAL_WITH_NODE(node, false, "Unexpected element type %s", node->getFirstChild()->getDataType().toString());
return NULL;
break;
default:
TR_ASSERT_FATAL_WITH_NODE(node, false, "unrecognized vector type %s", node->getFirstChild()->getDataType().toString());
return NULL;
Expand All @@ -3091,7 +3089,7 @@ OMR::ARM64::TreeEvaluator::vbitselectEvaluator(TR::Node *node, TR::CodeGenerator
}

/*
* vbitselect extracts bits from the first operand if the corresponding bit of the third operand is 1,
* vbitselect extracts bits from the first operand if the corresponding bit of the third operand is 0,
* otherwise from the second operand.
*/
generateTrg1Src2Instruction(cg, TR::InstOpCode::vbsl16b, node, targetReg, secondReg, firstReg);
Expand Down

0 comments on commit 90eea45

Please sign in to comment.