-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[Arm64] Support table-driven code generation for scalar intrinsics #208
Conversation
@CarolEidt @tannergooding PTAL cc @dotnet/jit-contrib |
… between table-driven and special intrinsics in jit/hwintrinsiccodegenarm64.cpp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, a few nits.
{ | ||
assert(op2 == nullptr); | ||
|
||
GenTreeArgList* list = op1->AsArgList(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible that somebody uses GenTreeArgList
to encode 2 args form?
GT_LIST
+--* arg1
\--* GT_LIST
+--* arg2
\--* nullptr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not happen. The list form is supposed to be used only for more than 2 args. And hopefully not for long...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome to the new repo @mikedn 😃
Kind of late to the party... The removal of node->GetNumUses();
node->GetOp(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I have to delete/re-create my fork of the runtime repo - I will re-open this PR after that. |
Motivation 1: To support table-driven approach during code generation of "simple" scalar intrinsics (the ones that don't require non-trivial instruction lookup or moving the values between operand registers and destination register).
Motivation 2: To support special (non table-driven) codegen of intrinsics with 3 operands (e.g.
BitwiseSelect
).When I implemented these logics for scalar intrinsics and 3 operands intrinsics I found that functions
CodeGen::genHWIntrinsic
andCodeGen::genSpecialIntrinsic
have at least 50% of the identical code so I moved the shared preparatory logic (that looks up intrinsic ID and category, the corresponding operand nodes, and base type) to a separate classHWIntrinsic
.This way I could remove special codegen for
NI_ArmBase_LeadingZeroCount
NI_ArmBase_Arm64_LeadingSignCount
NI_ArmBase_Arm64_LeadingZeroCount
.