From a67ed7297b7e280cb13094aa70ec3777a71fcecc Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Wed, 29 May 2024 09:00:23 -0700 Subject: [PATCH] fix native linux/arm failure (#102760) --- src/coreclr/jit/target.h | 16 +++++++++++----- src/coreclr/jit/unwind.cpp | 3 ++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/coreclr/jit/target.h b/src/coreclr/jit/target.h index 932c4ca41cabb9..8c615cc3bc1708 100644 --- a/src/coreclr/jit/target.h +++ b/src/coreclr/jit/target.h @@ -371,24 +371,30 @@ static bool operator>(regMaskTP first, regMaskTP second) return first.getLow() > second.getLow(); } -static regMaskTP operator<<(regMaskTP& first, const int b) +static regMaskTP operator<<(regMaskTP first, const int b) { regMaskTP result(first.getLow() << b); return result; } -static regMaskTP operator>>(regMaskTP& first, const int b) +static regMaskTP& operator<<=(regMaskTP& first, const int b) +{ + first = first << b; + return first; +} +#endif + +static regMaskTP operator>>(regMaskTP first, const int b) { regMaskTP result(first.getLow() >> b); return result; } -static regMaskTP& operator<<=(regMaskTP& first, const int b) +static regMaskTP& operator>>=(regMaskTP& first, const int b) { - first = first << b; + first = first >> b; return first; } -#endif static regMaskTP operator~(regMaskTP first) { diff --git a/src/coreclr/jit/unwind.cpp b/src/coreclr/jit/unwind.cpp index 97f05939013906..a51a52ab21d640 100644 --- a/src/coreclr/jit/unwind.cpp +++ b/src/coreclr/jit/unwind.cpp @@ -224,11 +224,12 @@ void Compiler::unwindPushPopMaskCFI(regMaskTP regMask, bool isFloat) // because LLVM only know about D0-D31. // As such pairs Sx,Sx+1 are referenced as D0-D15 registers in DWARF // For that we process registers in pairs. + regBit >>= isFloat ? 2 : 1; regNum = isFloat ? REG_PREV(REG_PREV(regNum)) : REG_PREV(regNum); #else + regBit >>= 1; regNum = REG_PREV(regNum); #endif - regBit = genRegMask(regNum); } }