-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Delete mov_i2xmm and mov_xmm2i. #47843
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
Changes from all 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 |
|---|---|---|
|
|
@@ -506,6 +506,7 @@ bool TakesRexWPrefix(instruction ins, emitAttr attr) | |
| { | ||
| switch (ins) | ||
| { | ||
| case INS_movd: // TODO-Cleanup: replace with movq, https://github.com/dotnet/runtime/issues/47943. | ||
| case INS_andn: | ||
| case INS_bextr: | ||
| case INS_blsi: | ||
|
|
@@ -518,8 +519,6 @@ bool TakesRexWPrefix(instruction ins, emitAttr attr) | |
| case INS_cvtss2si: | ||
| case INS_cvtsi2sd: | ||
| case INS_cvtsi2ss: | ||
| case INS_mov_xmm2i: | ||
| case INS_mov_i2xmm: | ||
| case INS_movnti: | ||
| case INS_mulx: | ||
| case INS_pdep: | ||
|
|
@@ -1239,7 +1238,7 @@ bool emitter::emitInsCanOnlyWriteSSE2OrAVXReg(instrDesc* id) | |
| case INS_cvtsd2si: | ||
| case INS_cvtss2si: | ||
| case INS_extractps: | ||
| case INS_mov_xmm2i: | ||
| case INS_movd: | ||
| case INS_movmskpd: | ||
| case INS_movmskps: | ||
| case INS_mulx: | ||
|
|
@@ -8837,15 +8836,7 @@ void emitter::emitDispIns( | |
| case IF_RRD_RRD: | ||
| case IF_RWR_RRD: | ||
| case IF_RRW_RRD: | ||
| if (ins == INS_mov_i2xmm) | ||
| { | ||
| printf("%s, %s", emitRegName(id->idReg1(), EA_16BYTE), emitRegName(id->idReg2(), attr)); | ||
| } | ||
| else if (ins == INS_mov_xmm2i) | ||
| { | ||
| printf("%s, %s", emitRegName(id->idReg1(), attr), emitRegName(id->idReg2(), EA_16BYTE)); | ||
| } | ||
| else if (ins == INS_pmovmskb) | ||
| if (ins == INS_pmovmskb) | ||
| { | ||
| printf("%s, %s", emitRegName(id->idReg1(), EA_4BYTE), emitRegName(id->idReg2(), attr)); | ||
| } | ||
|
|
@@ -11447,11 +11438,19 @@ BYTE* emitter::emitOutputRR(BYTE* dst, instrDesc* id) | |
| regNumber reg2 = id->idReg2(); | ||
| emitAttr size = id->idOpSize(); | ||
|
|
||
| // Get the 'base' opcode | ||
| code = insCodeRM(ins); | ||
| code = AddVexPrefixIfNeeded(ins, code, size); | ||
| if (IsSSEOrAVXInstruction(ins)) | ||
| { | ||
| assert((ins != INS_movd) || (isFloatReg(reg1) != isFloatReg(reg2))); | ||
|
|
||
| if ((ins != INS_movd) || isFloatReg(reg1)) | ||
| { | ||
| code = insCodeRM(ins); | ||
| } | ||
| else | ||
| { | ||
| code = insCodeMR(ins); | ||
| } | ||
| code = AddVexPrefixIfNeeded(ins, code, size); | ||
| code = insEncodeRMreg(ins, code); | ||
|
|
||
| if (TakesRexWPrefix(ins, size)) | ||
|
|
@@ -11461,6 +11460,9 @@ BYTE* emitter::emitOutputRR(BYTE* dst, instrDesc* id) | |
| } | ||
| else if ((ins == INS_movsx) || (ins == INS_movzx) || (insIsCMOV(ins))) | ||
| { | ||
| assert(hasCodeRM(ins) && !hasCodeMI(ins) && !hasCodeMR(ins)); | ||
| code = insCodeRM(ins); | ||
|
Contributor
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. Can you confirm why we added
Contributor
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. Was it missing currently?
Contributor
Author
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. we had logic like: so it was hard to follow, so I moved this under conditions where the result code is used. see 11451 in the base. |
||
| code = AddVexPrefixIfNeeded(ins, code, size); | ||
| code = insEncodeRMreg(ins, code) | (int)(size == EA_2BYTE); | ||
| #ifdef TARGET_AMD64 | ||
|
|
||
|
|
@@ -11472,6 +11474,9 @@ BYTE* emitter::emitOutputRR(BYTE* dst, instrDesc* id) | |
| } | ||
| else if (ins == INS_movsxd) | ||
| { | ||
| assert(hasCodeRM(ins) && !hasCodeMI(ins) && !hasCodeMR(ins)); | ||
| code = insCodeRM(ins); | ||
| code = AddVexPrefixIfNeeded(ins, code, size); | ||
| code = insEncodeRMreg(ins, code); | ||
|
|
||
| #endif // TARGET_AMD64 | ||
|
|
@@ -11480,6 +11485,9 @@ BYTE* emitter::emitOutputRR(BYTE* dst, instrDesc* id) | |
| else if ((ins == INS_bsf) || (ins == INS_bsr) || (ins == INS_crc32) || (ins == INS_lzcnt) || (ins == INS_popcnt) || | ||
| (ins == INS_tzcnt)) | ||
| { | ||
| assert(hasCodeRM(ins) && !hasCodeMI(ins) && !hasCodeMR(ins)); | ||
| code = insCodeRM(ins); | ||
| code = AddVexPrefixIfNeeded(ins, code, size); | ||
| code = insEncodeRMreg(ins, code); | ||
| if ((ins == INS_crc32) && (size > EA_1BYTE)) | ||
| { | ||
|
|
@@ -11499,7 +11507,9 @@ BYTE* emitter::emitOutputRR(BYTE* dst, instrDesc* id) | |
| #endif // FEATURE_HW_INTRINSICS | ||
| else | ||
| { | ||
| code = insEncodeMRreg(ins, insCodeMR(ins)); | ||
| assert(!TakesVexPrefix(ins)); | ||
| code = insCodeMR(ins); | ||
| code = insEncodeMRreg(ins, code); | ||
|
|
||
| if (ins != INS_test) | ||
| { | ||
|
|
@@ -11543,17 +11553,27 @@ BYTE* emitter::emitOutputRR(BYTE* dst, instrDesc* id) | |
| } | ||
| } | ||
|
|
||
| regNumber reg345 = REG_NA; | ||
| regNumber regFor012Bits = reg2; | ||
| regNumber regFor345Bits = REG_NA; | ||
| if (IsBMIInstruction(ins)) | ||
| { | ||
| reg345 = getBmiRegNumber(ins); | ||
| regFor345Bits = getBmiRegNumber(ins); | ||
| } | ||
| if (regFor345Bits == REG_NA) | ||
| { | ||
| regFor345Bits = reg1; | ||
| } | ||
| if (reg345 == REG_NA) | ||
| if (ins == INS_movd) | ||
| { | ||
| reg345 = id->idReg1(); | ||
| assert(isFloatReg(reg1) != isFloatReg(reg2)); | ||
| if (isFloatReg(reg2)) | ||
| { | ||
| std::swap(regFor012Bits, regFor345Bits); | ||
| } | ||
| } | ||
| unsigned regCode = insEncodeReg345(ins, reg345, size, &code); | ||
| regCode |= insEncodeReg012(ins, reg2, size, &code); | ||
|
|
||
| unsigned regCode = insEncodeReg345(ins, regFor345Bits, size, &code); | ||
| regCode |= insEncodeReg012(ins, regFor012Bits, size, &code); | ||
|
|
||
| if (TakesVexPrefix(ins)) | ||
| { | ||
|
|
@@ -11648,7 +11668,7 @@ BYTE* emitter::emitOutputRR(BYTE* dst, instrDesc* id) | |
| } | ||
| } | ||
|
|
||
| emitGCregLiveUpd(id->idGCref(), id->idReg1(), dst); | ||
| emitGCregLiveUpd(id->idGCref(), reg1, dst); | ||
| break; | ||
|
|
||
| case IF_RRW_RRD: | ||
|
|
@@ -11668,13 +11688,13 @@ BYTE* emitter::emitOutputRR(BYTE* dst, instrDesc* id) | |
|
|
||
| */ | ||
| case INS_xor: | ||
| assert(id->idReg1() == id->idReg2()); | ||
| emitGCregLiveUpd(id->idGCref(), id->idReg1(), dst); | ||
| assert(reg1 == reg2); | ||
| emitGCregLiveUpd(id->idGCref(), reg1, dst); | ||
| break; | ||
|
|
||
| case INS_or: | ||
| case INS_and: | ||
| emitGCregDeadUpd(id->idReg1(), dst); | ||
| emitGCregDeadUpd(reg1, dst); | ||
| break; | ||
|
|
||
| case INS_add: | ||
|
|
@@ -11691,7 +11711,7 @@ BYTE* emitter::emitOutputRR(BYTE* dst, instrDesc* id) | |
| ((regMask & emitThisByrefRegs) && (ins == INS_add || ins == INS_sub))); | ||
| #endif | ||
| // Mark r1 as holding a byref | ||
| emitGCregLiveUpd(GCT_BYREF, id->idReg1(), dst); | ||
| emitGCregLiveUpd(GCT_BYREF, reg1, dst); | ||
| break; | ||
|
|
||
| default: | ||
|
|
@@ -11773,15 +11793,7 @@ BYTE* emitter::emitOutputRR(BYTE* dst, instrDesc* id) | |
| case IF_RWR_RRD: | ||
| case IF_RRW_RRD: | ||
| case IF_RWR_RRD_RRD: | ||
| // INS_movxmm2i writes to reg2. | ||
| if (ins == INS_mov_xmm2i) | ||
| { | ||
| emitGCregDeadUpd(id->idReg2(), dst); | ||
| } | ||
| else | ||
| { | ||
| emitGCregDeadUpd(id->idReg1(), dst); | ||
| } | ||
| emitGCregDeadUpd(reg1, dst); | ||
| break; | ||
|
|
||
| default: | ||
|
|
@@ -14681,18 +14693,6 @@ emitter::insExecutionCharacteristics emitter::getInsExecutionCharacteristics(ins | |
| result.insThroughput = PERFSCORE_THROUGHPUT_25C; | ||
| break; | ||
|
|
||
| case INS_mov_xmm2i: | ||
|
Member
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. It looks like these perfscores and the ones used for |
||
| // movd reg, xmm | ||
| result.insThroughput = PERFSCORE_THROUGHPUT_1C; | ||
| result.insLatency = PERFSCORE_LATENCY_2C; | ||
| break; | ||
|
|
||
| case INS_mov_i2xmm: | ||
| // movd xmm, reg | ||
| result.insThroughput = PERFSCORE_THROUGHPUT_1C; | ||
| result.insLatency = PERFSCORE_LATENCY_1C; | ||
| break; | ||
|
|
||
| case INS_movd: | ||
| if (memAccessKind == PERFSCORE_MEMORY_NONE) | ||
| { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.