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

Jinyang He via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Nov 3 23:58:18 PDT 2022


MQ-mengqing added inline comments.


================
Comment at: libunwind/src/Registers.hpp:5109
+  if (regNum == UNW_LOONGARCH_R0)
+    return 0;
+  if (regNum > 0 && regNum < 32)
----------------
It is not appreciated to return 0 directly. Generally we don't get dwarf NO.0 because $zero always is 0. As that it allows the user to use NO.0 as magic to do things like '.cfi_return_column $zero'.



================
Comment at: libunwind/src/Registers.hpp:5122
+    // $r0 is hardwired to zero.
+    return;
+  else if (regNum > 0 && regNum < 32)
----------------
Same as ::getRegister, though it seems not change anything...


================
Comment at: libunwind/src/UnwindRegistersRestore.S:1337
+
+  // $r0 is zero
+  ld.d    $r1, $a0, (8 * 1)
----------------
Neither uwn_setcontext nor uwn_getcontext use the 0 position. Besides, is there no needed to save or restore the fscr and the fcc?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137010



More information about the libcxx-commits mailing list