-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
JIT ARM64-SVE: Add FR_2A, GB_2A, FV_2A, FY_3A #98248
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsPart of #94549. Adds the following encodings:
cstool output:
JitDisasm output:
cc @dotnet/arm64-contrib
|
Diff results for #98248Throughput diffsThroughput diffs for linux/arm64 ran on linux/x64Overall (+0.00% to +0.01%)
MinOpts (+0.00% to +0.01%)
FullOpts (+0.00% to +0.01%)
Throughput diffs for osx/arm64 ran on linux/x64Overall (+0.00% to +0.01%)
MinOpts (+0.00% to +0.01%)
FullOpts (+0.00% to +0.01%)
Throughput diffs for windows/arm64 ran on linux/x64Overall (+0.00% to +0.01%)
MinOpts (+0.00% to +0.01%)
FullOpts (+0.00% to +0.01%)
Details here |
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
Diff results for #98248Throughput diffsThroughput diffs for osx/arm64 ran on windows/x64MinOpts (-0.00% to +0.01%)
Throughput diffs for windows/arm64 ran on windows/x64MinOpts (-0.00% to +0.01%)
Details here Throughput diffs for linux/arm64 ran on linux/x64MinOpts (-0.01% to -0.00%)
Details here |
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
assert(insOptsScalableStandard(opt)); | ||
assert(isVectorRegister(reg1)); // ddddd | ||
assert(isVectorRegister(reg2)); // nnnnn | ||
assert((imm == 90) || (imm == 270)); // r |
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.
assert((imm == 90) || (imm == 270)); // r | |
assert(emitIsValidEncodedRotationImm90_or_270(imm)); // r |
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.
emitIsValidEncodedRotationImm90_or_270
checks if imm
is 0 or 1. Maybe I can add isValidRot90_or_270
?
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.
I think you should add emitIsValidEncodedRotationImm90_or_270()
checks around line 1617 i.e. inside emitInsSanityCheck()
the way @TIHan added. Can you make it consistent to the way we have e.g. IF_SVE_GP_3A
?
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.
Sure thing
// Returns true if 'value' is a legal unsigned immediate 3 bit encoding, starting from 1 (such as for SHRNB). | ||
static bool isValidUimm3From1(ssize_t value) | ||
{ | ||
return (1 <= value) && (value <= 8); |
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.
some of the numbers in isValid*
are hex while others are decimal, do you mind changing to hex wherever it makes sense?
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.
Sure thing. By "wherever it makes sense," do you mean we should only convert decimal numbers to hex if they're >=10? Because in the above example, there wouldn't be anything to change.
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.
yeah it was a nit comment, not for this particular example, but there are examples of <= 15
that can be converted to <= 0xF
but other places like (value <= 224)
can stay decimals.
@kunalspathak thanks for the review, I've addressed your feedback. Is it ok if I merge this? |
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.
few things to take care of.
@@ -1679,7 +1753,7 @@ void emitter::emitInsSanityCheck(instrDesc* id) | |||
assert(insOptsScalableStandard(id->idInsOpt())); | |||
assert(isVectorRegister(id->idReg1())); // ddddd | |||
assert(isVectorRegister(id->idReg2())); // nnnnn | |||
assert(isValidUimm2(emitGetInsSC(id))); // rr | |||
assert(emitIsValidEncodedRotationImm0_to_270(emitGetInsSC(id))); // rr |
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.
thanks for fixing this.
code |= insEncodeReg_V_9_to_5(id->idReg2()); // mmmmm | ||
code |= insEncodeImm1_10(emitGetInsSC(id)); // r | ||
code |= insEncodeElemsize(optGetSveElemsize(id->idInsOpt())); // xx | ||
dst += emitOutput_Instr(dst, code); |
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.
missing check for 90 or 270?
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.
We check for this in emitIns_R_R_I
and in emitInsSanityCheck
. Do you want me to check for this in emitOutputInstr
too? I suppose I can add a dedicated insEncodeRot*
method for encoding the bit at location 10 to make the meaning of r
more clear.
case IF_SVE_FV_2A: // ........xx...... .....rmmmmmddddd -- SVE2 complex integer add | ||
{ | ||
// Rotation bit implies rotation is 270 if set, else rotation is 90 | ||
const ssize_t rot = (emitGetInsSC(id) == 0) ? 90 : 270; |
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.
can you use decode function for this and at other places if they are missing?
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.
Sure thing, thanks for catching that.
Diff results for #98248Throughput diffsThroughput diffs for osx/arm64 ran on windows/x64MinOpts (+0.00% to +0.01%)
Details here Throughput diffs for linux/arm64 ran on linux/x64MinOpts (-0.01% to -0.00%)
Details here |
Diff results for #98248Throughput diffsThroughput diffs for linux/arm64 ran on windows/x64MinOpts (+0.00% to +0.01%)
Details here Throughput diffs for linux/arm64 ran on linux/x64MinOpts (-0.01% to -0.00%)
Details here |
Part of #94549. Adds the following encodings:
cstool output:
JitDisasm output:
cc @dotnet/arm64-contrib