[Lldb-commits] [lldb] [lldb][RISCV] Fix float load and stores in RISC-V emulator (PR #167490)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 17 07:07:18 PST 2025


================
@@ -1328,32 +1328,36 @@ class Executor {
         m_emu, inst, 8, ZextD,
         [](uint64_t a, uint64_t b) { return std::max(a, b); });
   }
-  template <typename T>
-  bool F_Load(T inst, const fltSemantics &(*semantics)(),
-              unsigned int numBits) {
+  template <typename I, typename T>
+  bool F_Load(I inst, const fltSemantics &(*semantics)()) {
     return transformOptional(inst.rs1.Read(m_emu),
                              [&](auto &&rs1) {
-                               uint64_t addr = rs1 + uint64_t(inst.imm);
-                               uint64_t bits = *m_emu.ReadMem<uint64_t>(addr);
+                               uint64_t addr =
+                                   rs1 + uint64_t(SignExt(inst.imm));
----------------
DavidSpickett wrote:

Assuming you agree that this is an issue, yes. From this snippet, it does seem incorrect but I haven't looked at the supporting code myself.

https://github.com/llvm/llvm-project/pull/167490


More information about the lldb-commits mailing list