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

[NativeAOT/ARM] Fix unwinding over floating point registers #97863

Merged
merged 1 commit into from
Feb 2, 2024
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
28 changes: 25 additions & 3 deletions src/coreclr/nativeaot/Runtime/unix/UnwindHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,14 +335,14 @@ struct Registers_REGDISPLAY : REGDISPLAY
inline static int lastDwarfRegNum() { return _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM; }

bool validRegister(int num) const;
bool validFloatRegister(int num) { return false; };
bool validFloatRegister(int num) const;
bool validVectorRegister(int num) const { return false; };

uint32_t getRegister(int num) const;
void setRegister(int num, uint32_t value, uint32_t location);

double getFloatRegister(int num) const {abort();}
void setFloatRegister(int num, double value) {abort();}
double getFloatRegister(int num) const;
void setFloatRegister(int num, double value);

libunwind::v128 getVectorRegister(int num) const {abort();}
void setVectorRegister(int num, libunwind::v128 value) {abort();}
Expand Down Expand Up @@ -393,6 +393,10 @@ inline bool Registers_REGDISPLAY::validRegister(int num) const {
return false;
}

inline bool Registers_REGDISPLAY::validFloatRegister(int num) const {
return num >= UNW_ARM_D0 && num <= UNW_ARM_D31;
}

inline uint32_t Registers_REGDISPLAY::getRegister(int regNum) const {
if (regNum == UNW_REG_SP || regNum == UNW_ARM_SP)
return SP;
Expand Down Expand Up @@ -499,6 +503,24 @@ void Registers_REGDISPLAY::setRegister(int num, uint32_t value, uint32_t locatio
}
}

double Registers_REGDISPLAY::getFloatRegister(int num) const
{
if (num >= UNW_ARM_D8 && num <= UNW_ARM_D15)
{
return D[num - UNW_ARM_D8];
}

PORTABILITY_ASSERT("unsupported arm register");
}

void Registers_REGDISPLAY::setFloatRegister(int num, double value)
{
if (num >= UNW_ARM_D8 && num <= UNW_ARM_D15)
{
D[num - UNW_ARM_D8] = value;
}
}

#endif // TARGET_ARM

#if defined(TARGET_ARM64)
Expand Down
Loading