Skip to content

Commit

Permalink
JIT: Fix illegal instruction encoding for float->float casts (#112217)
Browse files Browse the repository at this point in the history
* fix illegal instruction encoding for floating->floating casts

* remove path-based trigger for jitstress-isas-avx512 pipeline
  • Loading branch information
saucecontrol authored Feb 14, 2025
1 parent 77ccd7b commit eb99e93
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 22 deletions.
14 changes: 0 additions & 14 deletions eng/pipelines/coreclr/jitstress-isas-avx512.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
# This pipeline only runs on GitHub PRs, not on merges.
trigger: none

# Only run on specific changes to the JIT directory that are likely to affect AVX-512.
pr:
branches:
include:
- main
paths:
include:
- src/coreclr/jit/hwintrinsiccodegenxarch.cpp
- src/coreclr/jit/hwintrinsiclistxarch.h
- src/coreclr/jit/hwintrinsicxarch.cpp
- src/coreclr/jit/instrsxarch.h
- src/coreclr/jit/emitxarch.cpp
- src/coreclr/jit/emitxarch.h

schedules:
- cron: "30 19 * * 6"
displayName: Sat at 11:30 AM (UTC-8:00)
Expand Down
13 changes: 9 additions & 4 deletions src/coreclr/jit/codegenxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7235,11 +7235,16 @@ void CodeGen::genFloatToFloatCast(GenTree* treeNode)
assert(varTypeIsFloating(srcType) && varTypeIsFloating(dstType));

genConsumeOperands(treeNode->AsOp());
if (srcType == dstType && (op1->isUsedFromReg() && (targetReg == op1->GetRegNum())))
if (srcType == dstType)
{
// source and destinations types are the same and also reside in the same register.
// we just need to consume and produce the reg in this case.
;
if (op1->isUsedFromReg())
{
GetEmitter()->emitIns_Mov(INS_movaps, EA_16BYTE, targetReg, op1->GetRegNum(), /* canSkip */ true);
}
else
{
inst_RV_TT(ins_Move_Extend(dstType, /* srcInReg */ false), emitTypeSize(dstType), targetReg, op1);
}
}
else
{
Expand Down
4 changes: 0 additions & 4 deletions src/coreclr/jit/instr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2477,8 +2477,6 @@ instruction CodeGen::ins_FloatConv(var_types to, var_types from)
return INS_cvttss2si32;
case TYP_LONG:
return INS_cvttss2si64;
case TYP_FLOAT:
return ins_Move_Extend(TYP_FLOAT, false);
case TYP_DOUBLE:
return INS_cvtss2sd;
case TYP_ULONG:
Expand All @@ -2499,8 +2497,6 @@ instruction CodeGen::ins_FloatConv(var_types to, var_types from)
return INS_cvttsd2si64;
case TYP_FLOAT:
return INS_cvtsd2ss;
case TYP_DOUBLE:
return ins_Move_Extend(TYP_DOUBLE, false);
case TYP_ULONG:
return INS_vcvttsd2usi64;
case TYP_UINT:
Expand Down

0 comments on commit eb99e93

Please sign in to comment.