-
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 AW_2A to AZ_2A, BM_1A, BN_1A #99211
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsPart of #94549. Adds the following encodings:
cstool output:
JitDisasm output:
cc @dotnet/arm64-contrib
|
@@ -9300,6 +9378,7 @@ void emitter::emitIns_R_I_I(instruction ins, | |||
|
|||
id->idIns(ins); | |||
id->idInsFmt(fmt); | |||
id->idInsOpt(opt); |
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.
Interesting that we weren't setting the opt
before. Makes sense that we need to. I assume it doesn't cause any problems for the existing instructions.
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, the existing instructions don't seem to check opt
anywhere else -- not even to assert that it's INS_OPTS_NONE
. That's the default value in emitIns_R_I_I
, so I imagine always initializing idInsOpt
is fine; I didn't notice any issues.
@@ -24094,8 +24345,9 @@ BYTE* emitter::emitOutput_InstrSve(BYTE* dst, instrDesc* id) | |||
dst += emitOutput_Instr(dst, code); | |||
break; | |||
|
|||
// Immediate and patterm to general purpose. |
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.
"patterm" xD
@@ -24628,7 +24935,7 @@ BYTE* emitter::emitOutput_InstrSve(BYTE* dst, instrDesc* id) | |||
code = emitInsCodeSve(ins, fmt); | |||
code |= insEncodeReg_V_4_to_0(id->idReg1()); // ddddd | |||
code |= insEncodeReg_V_9_to_5(id->idReg2()); // nnnnn | |||
code |= insEncodeSveElemsize_tszh_22_tszl_20_to_19(optGetSveElemsize(id->idInsOpt())); // xx | |||
code |= insEncodeSveElemsize_tszh_23_tszl_20_to_19(optGetSveElemsize(id->idInsOpt())); // xx |
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.
The existing uses for insEncodeSveElemsize_tszh_22_tszl_20_to_19
only assumed 1/2/4 byte sizes and not 8, so we should probably put an assert, before it assert(optGetSveElemsize(id->idInsOpt()) == EA_8BYTE)
, or we could just have two functions for tszh:tszl
with one that allows 1/2/4 byte and the other 1/2/4/8 byte.
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 prefer the assert approach; I'll add those in.
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.
+1 for asserts. The size restriction is (usually) a property of the instruction operation, whereas the helper function only cares about bit encodings.
@@ -24638,7 +24945,7 @@ BYTE* emitter::emitOutput_InstrSve(BYTE* dst, instrDesc* id) | |||
code |= insEncodeReg_V_4_to_0(id->idReg1()); // ddddd | |||
code |= insEncodeReg_V_9_to_5(id->idReg2()); // nnnnn | |||
code |= insEncodeUimm5_20_to_16(emitGetInsSC(id)); // iii | |||
code |= insEncodeSveElemsize_tszh_22_tszl_20_to_19(optGetSveElemsize(id->idInsOpt())); // xx | |||
code |= insEncodeSveElemsize_tszh_23_tszl_20_to_19(optGetSveElemsize(id->idInsOpt())); // xx |
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.
Same as comment above regarding tszh:tszl
.
@@ -24648,7 +24955,7 @@ BYTE* emitter::emitOutput_InstrSve(BYTE* dst, instrDesc* id) | |||
code |= insEncodeReg_V_4_to_0(id->idReg1()); // ddddd | |||
code |= insEncodeReg_V_9_to_5(id->idReg2()); // nnnnn | |||
code |= insEncodeUimm5_20_to_16(insGetImmDiff(emitGetInsSC(id), id->idInsOpt())); // iii | |||
code |= insEncodeSveElemsize_tszh_22_tszl_20_to_19(optGetSveElemsize(id->idInsOpt())); // xx | |||
code |= insEncodeSveElemsize_tszh_23_tszl_20_to_19(optGetSveElemsize(id->idInsOpt())); // xx |
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.
Same as comment above regarding tszh:tszl
.
@@ -21738,6 +21922,10 @@ void emitter::emitIns_Call(EmitCallType callType, | |||
assert(isValidUimm5From1(imm)); | |||
return (32 - imm); | |||
|
|||
case INS_OPTS_SCALABLE_D: |
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.
Do the existing uses of insGetImmDiff
assume only B, H, S? If so, we should either put asserts before calling insGetImmDiff
ensuring that we don't accidently pass D, or just have two different functions. This is a similar suggestion to insEncodeSveElemsize_tszh_22_tszl_20_to_19
that I had.
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, just some suggestions for insGetImmDiff
and insEncodeSveElemsize_tszh_23_tszl_20_to_19
if they are applicable.
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.
Assuming all the other review comments are fixed up, LGTM.
Thanks for the reviews! |
Part of #94549. Adds the following encodings:
cstool output:
JitDisasm output:
cc @dotnet/arm64-contrib