Skip to content
Merged
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
26 changes: 25 additions & 1 deletion src/coreclr/jit/unwindamd64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,30 @@ short Compiler::mapRegNumToDwarfReg(regNumber reg)
case REG_R15:
dwarfReg = 15;
break;
case REG_R16:
dwarfReg = 16;
break;
case REG_R17:
dwarfReg = 17;
break;
case REG_R18:
dwarfReg = 18;
break;
case REG_R19:
dwarfReg = 19;
break;
case REG_R20:
dwarfReg = 20;
break;
case REG_R21:
dwarfReg = 21;
break;
case REG_R22:
dwarfReg = 22;
break;
case REG_R23:
dwarfReg = 23;
break;
default:
noway_assert(!"unexpected REG_NUM");
}
Expand Down Expand Up @@ -399,7 +423,7 @@ void Compiler::unwindSaveRegWindows(regNumber reg, unsigned offset)
code = (UNWIND_CODE*)&func->unwindCodes[func->unwindCodeSlot -= sizeof(UNWIND_CODE)];
code->UnwindOp = (genIsValidFloatReg(reg)) ? UWOP_SAVE_XMM128_FAR : UWOP_SAVE_NONVOL_FAR;
}
code->OpInfo = (BYTE)reg;
code->OpInfo = (BYTE)(genIsValidFloatReg(reg) ? reg - XMMBASE : reg);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add an assert that genIsValidIntReg(reg) for the else case, to help catch any future bugs or expansions in this space?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could even assert on the actual range of the computed value, since the unwind codes are well-defined and if they change, we want the assert to hit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me do it as a follow up PR and merge this as is to unblock weekend runs.

unsigned int cbProlog = unwindGetCurrentOffset(func);
noway_assert((BYTE)cbProlog == cbProlog);
code->CodeOffset = (BYTE)cbProlog;
Expand Down
Loading