Skip to content
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

Fix tizen arm32 issue. #55987

Merged
merged 2 commits into from
Jul 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12641,7 +12641,23 @@ void CodeGen::genCodeForBitCast(GenTreeOp* treeNode)
}
else
{
genBitCast(targetType, targetReg, op1->TypeGet(), op1->GetRegNum());
#ifdef TARGET_ARM
if (compiler->opts.compUseSoftFP && (targetType == TYP_LONG))
{
// This is a special arm-softFP case when a TYP_LONG node was introduced during lowering
// for a call argument, so it was not handled by decomposelongs phase as all other TYP_LONG nodes.
// Example foo(double LclVar V01), LclVar V01 has to be passed in general registers r0, r1,
// so lowering will add `BITCAST long(LclVar double V01)` and codegen has to support it here.
const regNumber srcReg = op1->GetRegNum();
const regNumber otherReg = treeNode->AsMultiRegOp()->gtOtherReg;
assert(otherReg != REG_NA);
inst_RV_RV_RV(INS_vmov_d2i, targetReg, otherReg, srcReg, EA_8BYTE);
}
else
#endif // TARGET_ARM
{
genBitCast(targetType, targetReg, op1->TypeGet(), op1->GetRegNum());
}
}
genProduceReg(treeNode);
}
10 changes: 7 additions & 3 deletions src/coreclr/jit/instr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1911,15 +1911,19 @@ instruction CodeGen::ins_Copy(regNumber srcReg, var_types dstType)
return INS_mov;
}
#elif defined(TARGET_ARM)
// No SIMD support yet
// No SIMD support yet.
assert(!varTypeIsSIMD(dstType));
if (dstIsFloatReg)
{
return (dstType == TYP_DOUBLE) ? INS_vmov_i2d : INS_vmov_i2f;
// Can't have LONG in a register.
assert(dstType == TYP_FLOAT);
return INS_vmov_i2f;
}
else
{
return (dstType == TYP_LONG) ? INS_vmov_d2i : INS_vmov_f2i;
// Can't have LONG in a register.
assert(dstType == TYP_INT);
return INS_vmov_f2i;
}
#else // TARGET*
#error "Unknown TARGET"
Expand Down
5 changes: 5 additions & 0 deletions src/coreclr/jit/lower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1507,6 +1507,11 @@ GenTree* Lowering::LowerFloatArgReg(GenTree* arg, regNumber regNum)
#ifdef TARGET_ARM
if (floatType == TYP_DOUBLE)
{
// A special case when we introduce TYP_LONG
// during lowering for arm32 softFP to pass double
// in int registers.
assert(comp->opts.compUseSoftFP);

regNumber nextReg = REG_NEXT(regNum);
intArg->AsMultiRegOp()->gtOtherReg = nextReg;
}
Expand Down