[PATCH] D137010: [libunwind][LoongArch] Add 64-bit LoongArch support

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 28 23:49:44 PDT 2022


MaskRay added inline comments.


================
Comment at: libunwind/src/Registers.hpp:5090
+inline bool Registers_loongarch::validRegister(int regNum) const {
+  if (regNum == UNW_REG_IP)
+    return true;
----------------
combine two `==` into one `if`


================
Comment at: libunwind/src/Registers.hpp:5094
+    return true;
+  if (regNum < 0)
+    return false;
----------------
combine `<` and `>`


================
Comment at: libunwind/src/Registers.hpp:5119
+  else if (regNum == UNW_LOONGARCH_R0)
+    /* $r0 is hardwired to zero */
+    return;
----------------
`//` and end with `.`


================
Comment at: libunwind/src/Registers.hpp:5267
+inline bool Registers_loongarch::validFloatRegister(int regNum) const {
+  if (regNum < UNW_LOONGARCH_F0)
+    return false;
----------------
combine into one `if`


================
Comment at: libunwind/src/UnwindRegistersRestore.S:1369
+  ld.d    $r31, $r4, (8 * 31)
+  ld.d    $r4, $r4, (8 * 4)   // restore $a0
+  ld.d    $r1, $r4, (8 * 32)   // load new pc into $ra
----------------
misaligned


================
Comment at: libunwind/src/UnwindRegistersSave.S:1302
+
+  or     $r4, $r0, $r0  // return UNW_ESUCCESS
+  jr       $r1           // jump to $ra
----------------
misaligned


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137010/new/

https://reviews.llvm.org/D137010



More information about the llvm-commits mailing list