-
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
Add Arm64 encodings for IF_SVE_CY_3A and IF_SVE_CY_3B group #96992
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1072,8 +1072,28 @@ void emitter::emitInsSanityCheck(instrDesc* id) | |
assert(insOptsScalableWide(id->idInsOpt())); // xx | ||
assert(isPredicateRegister(id->idReg1())); // DDDD | ||
assert(isLowPredicateRegister(id->idReg2())); // ggg | ||
assert(isVectorRegister(id->idReg3())); // mmmmm | ||
assert(isVectorRegister(id->idReg4())); // nnnnn | ||
assert(isVectorRegister(id->idReg3())); // nnnnn | ||
assert(isVectorRegister(id->idReg4())); // mmmmm | ||
break; | ||
|
||
case IF_SVE_CY_3A: // ........xx.iiiii ...gggnnnnn.DDDD -- SVE integer compare with signed immediate | ||
elemsize = id->idOpSize(); | ||
assert(isScalableVectorSize(elemsize)); | ||
assert(insOptsScalableStandard(id->idInsOpt())); | ||
assert(isPredicateRegister(id->idReg1())); // DDDD | ||
assert(isLowPredicateRegister(id->idReg2())); // ggg | ||
assert(isVectorRegister(id->idReg3())); // nnnnn | ||
assert(isValidSimm5(emitGetInsSC(id))); // iiiii | ||
break; | ||
|
||
case IF_SVE_CY_3B: // ........xx.iiiii ii.gggnnnnn.DDDD -- SVE integer compare with unsigned immediate | ||
elemsize = id->idOpSize(); | ||
assert(isScalableVectorSize(elemsize)); | ||
assert(insOptsScalableStandard(id->idInsOpt())); | ||
assert(isPredicateRegister(id->idReg1())); // DDDD | ||
assert(isLowPredicateRegister(id->idReg2())); // ggg | ||
assert(isVectorRegister(id->idReg3())); // nnnnn | ||
assert(isValidUimm7(emitGetInsSC(id))); // iiiii | ||
break; | ||
|
||
case IF_SVE_GE_4A: // ........xx.mmmmm ...gggnnnnn.DDDD -- SVE2 character match | ||
|
@@ -9498,6 +9518,32 @@ void emitter::emitIns_R_R_R_I(instruction ins, | |
} | ||
break; | ||
|
||
case INS_sve_cmpeq: | ||
case INS_sve_cmpgt: | ||
case INS_sve_cmpge: | ||
case INS_sve_cmpne: | ||
case INS_sve_cmple: | ||
case INS_sve_cmplt: | ||
assert(insOptsScalableStandard(opt)); | ||
assert(isPredicateRegister(reg1)); // DDDD | ||
assert(isLowPredicateRegister(reg2)); // ggg | ||
assert(isVectorRegister(reg3)); // nnnnn | ||
assert(isValidSimm5(imm)); // iiiii | ||
fmt = IF_SVE_CY_3A; | ||
break; | ||
|
||
case INS_sve_cmphi: | ||
case INS_sve_cmphs: | ||
case INS_sve_cmplo: | ||
case INS_sve_cmpls: | ||
assert(insOptsScalableStandard(opt)); | ||
assert(isPredicateRegister(reg1)); // DDDD | ||
assert(isLowPredicateRegister(reg2)); // ggg | ||
assert(isVectorRegister(reg3)); // nnnnn | ||
assert(isValidUimm7(imm)); // iiiii | ||
fmt = IF_SVE_CY_3B; | ||
break; | ||
|
||
case INS_fmul: // by element, imm[0..3] selects the element of reg3 | ||
case INS_fmla: | ||
case INS_fmls: | ||
|
@@ -14180,6 +14226,32 @@ void emitter::emitIns_Call(EmitCallType callType, | |
return insEncodeSimm4_19_to_16(imm / 32); | ||
} | ||
|
||
/***************************************************************************** | ||
* | ||
* Returns the encoding for the immediate value as 5-bits at bit locations '20-16'. | ||
*/ | ||
|
||
/*static*/ emitter::code_t emitter::insEncodeSimm5_20_to_16(ssize_t imm) | ||
{ | ||
assert(isValidSimm5(imm)); | ||
if (imm < 0) | ||
{ | ||
imm = (imm & 0x1F); | ||
} | ||
return (code_t)imm << 16; | ||
} | ||
|
||
/***************************************************************************** | ||
* | ||
* Returns the encoding for the immediate value as 7-bits at bit locations '20-14'. | ||
*/ | ||
|
||
/*static*/ emitter::code_t emitter::insEncodeUimm7_20_to_14(ssize_t imm) | ||
{ | ||
assert(isValidUimm7(imm)); | ||
return (code_t)imm << 14; | ||
} | ||
|
||
/***************************************************************************** | ||
* | ||
* Returns the encoding to select the <R> 4/8-byte width specifier <R> | ||
|
@@ -16271,6 +16343,28 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) | |
dst += emitOutput_Instr(dst, code); | ||
break; | ||
|
||
case IF_SVE_CY_3A: // ........xx.iiiii ...gggnnnnn.DDDD -- SVE integer compare with signed immediate | ||
imm = emitGetInsSC(id); | ||
code = emitInsCodeSve(ins, fmt); | ||
code |= insEncodeReg_P_3_to_0(id->idReg1()); // DDDD | ||
code |= insEncodeReg_P_12_to_10(id->idReg2()); // ggg | ||
code |= insEncodeReg_V_9_to_5(id->idReg3()); // nnnnn | ||
code |= insEncodeSimm5_20_to_16(imm); // iiiii | ||
code |= insEncodeElemsize(optGetSveElemsize(id->idInsOpt())); // xx | ||
dst += emitOutput_Instr(dst, code); | ||
break; | ||
|
||
case IF_SVE_CY_3B: // ........xx.iiiii ii.gggnnnnn.DDDD -- SVE integer compare with unsigned immediate | ||
imm = emitGetInsSC(id); | ||
code = emitInsCodeSve(ins, fmt); | ||
code |= insEncodeReg_P_3_to_0(id->idReg1()); // DDDD | ||
code |= insEncodeReg_P_12_to_10(id->idReg2()); // ggg | ||
code |= insEncodeReg_V_9_to_5(id->idReg3()); // nnnnn | ||
code |= insEncodeUimm7_20_to_14(imm); // iiiii | ||
code |= insEncodeElemsize(optGetSveElemsize(id->idInsOpt())); // xx | ||
dst += emitOutput_Instr(dst, code); | ||
break; | ||
|
||
case IF_SVE_GA_2A: // ............iiii ......nnnn.ddddd -- SME2 multi-vec shift narrow | ||
imm = emitGetInsSC(id); | ||
assert(id->idInsOpt() == INS_OPTS_SCALABLE_H); | ||
|
@@ -18844,8 +18938,17 @@ void emitter::emitDispInsHelp( | |
case IF_SVE_CX_4A_A: // ........xx.mmmmm ...gggnnnnn.DDDD -- SVE integer compare vectors | ||
emitDispPredicateReg(id->idReg1(), PREDICATE_SIZED, id->idInsOpt(), true); // DDDD | ||
emitDispPredicateReg(id->idReg2(), PREDICATE_ZERO, id->idInsOpt(), true); // ggg | ||
emitDispSveReg(id->idReg3(), id->idInsOpt(), true); // mmmmm | ||
emitDispSveReg(id->idReg4(), INS_OPTS_SCALABLE_D, false); // nnnnn | ||
emitDispSveReg(id->idReg3(), id->idInsOpt(), true); // nnnnn | ||
emitDispSveReg(id->idReg4(), INS_OPTS_SCALABLE_D, false); // mmmmm | ||
break; | ||
|
||
// <Pd>.<T>, <Pg>/Z, <Zn>.<T>, #<imm> | ||
case IF_SVE_CY_3A: // ........xx.iiiii ...gggnnnnn.DDDD -- SVE integer compare with signed immediate | ||
case IF_SVE_CY_3B: // ........xx.iiiii ii.gggnnnnn.DDDD -- SVE integer compare with unsigned immediate | ||
emitDispPredicateReg(id->idReg1(), PREDICATE_SIZED, id->idInsOpt(), true); // DDDD | ||
emitDispPredicateReg(id->idReg2(), PREDICATE_ZERO, id->idInsOpt(), true); // ggg | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here we should be using But... on the previous line we would still need to do Alternatively, we keep this PR as it is. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I agree. But we should have a follow up PR that calls There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Done: #97142 |
||
emitDispSveReg(id->idReg3(), id->idInsOpt(), true); // nnnnn | ||
emitDispImm(emitGetInsSC(id), false, (fmt == IF_SVE_CY_3B)); // iiiii | ||
break; | ||
|
||
// <Zda>.<T>, <Pg>/M, <Zn>.<Tb> | ||
|
@@ -21382,6 +21485,12 @@ emitter::insExecutionCharacteristics emitter::getInsExecutionCharacteristics(ins | |
result.insThroughput = PERFSCORE_THROUGHPUT_1C; | ||
break; | ||
|
||
case IF_SVE_CY_3A: // ........xx.iiiii ...gggnnnnn.DDDD -- SVE integer compare with signed immediate | ||
case IF_SVE_CY_3B: // ........xx.iiiii ii.gggnnnnn.DDDD -- SVE integer compare with unsigned immediate | ||
result.insLatency = PERFSCORE_LATENCY_4C; | ||
result.insThroughput = PERFSCORE_THROUGHPUT_1C; | ||
break; | ||
|
||
case IF_SVE_GE_4A: // ........xx.mmmmm ...gggnnnnn.DDDD -- SVE2 character match | ||
case IF_SVE_HT_4A: // ........xx.mmmmm ...gggnnnnn.DDDD -- SVE floating-point compare vectors | ||
result.insLatency = PERFSCORE_LATENCY_2C; | ||
|
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.
good catch