-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Updating genCodeForBinary to be VEX aware #1344
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 |
---|---|---|
|
@@ -909,6 +909,18 @@ void CodeGen::genCodeForBinary(GenTreeOp* treeNode) | |
regNumber op1reg = op1->isUsedFromReg() ? op1->GetRegNum() : REG_NA; | ||
regNumber op2reg = op2->isUsedFromReg() ? op2->GetRegNum() : REG_NA; | ||
|
||
if (varTypeIsFloating(treeNode->TypeGet())) | ||
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. This just hijacks all the floating-point types and forwards to 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. Great - I think that's the right approach. |
||
{ | ||
// floating-point addition, subtraction, multiplication, and division | ||
// all have RMW semantics if VEX support is not available | ||
|
||
bool isRMW = !compiler->canUseVexEncoding(); | ||
inst_RV_RV_TT(ins, emitTypeSize(treeNode), targetReg, op1reg, op2, isRMW); | ||
|
||
genProduceReg(treeNode); | ||
return; | ||
} | ||
|
||
GenTree* dst; | ||
GenTree* src; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -214,7 +214,6 @@ bool emitter::AreUpper32BitsZero(regNumber reg) | |
return false; | ||
} | ||
|
||
#ifdef FEATURE_HW_INTRINSICS | ||
//------------------------------------------------------------------------ | ||
// IsDstSrcImmAvxInstruction: Checks if the instruction has a "reg, reg/mem, imm" or | ||
// "reg/mem, reg, imm" form for the legacy, VEX, and EVEX | ||
|
@@ -250,7 +249,6 @@ static bool IsDstSrcImmAvxInstruction(instruction ins) | |
return false; | ||
} | ||
} | ||
#endif // FEATURE_HW_INTRINSICS | ||
|
||
// ------------------------------------------------------------------- | ||
// Is4ByteSSEInstruction: Returns true if the SSE instruction is a 4-byte opcode. | ||
|
@@ -5629,7 +5627,6 @@ void emitter::emitIns_AX_R(instruction ins, emitAttr attr, regNumber ireg, regNu | |
emitAdjustStackDepthPushPop(ins); | ||
} | ||
|
||
#ifdef FEATURE_HW_INTRINSICS | ||
//------------------------------------------------------------------------ | ||
// emitIns_SIMD_R_R_I: emits the code for an instruction that takes a register operand, an immediate operand | ||
// and that returns a value in register | ||
|
@@ -5810,6 +5807,7 @@ void emitter::emitIns_SIMD_R_R_S( | |
} | ||
} | ||
|
||
#ifdef FEATURE_HW_INTRINSICS | ||
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 only made the minimum number of |
||
//------------------------------------------------------------------------ | ||
// emitIns_SIMD_R_R_A_I: emits the code for a SIMD instruction that takes a register operand, a GenTreeIndir address, | ||
// an immediate operand, and that returns a value in register | ||
|
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 was conditioned under
FEATURE_HW_INTRINSICS
for the implementation, but not the declaration here. So, I did the minimal fixup to allow it to be available without `FEATURE_HW_INTRINSICS.