[PATCH] D147480: [M68k] Basic FP register files and FMOVE implementations

Min-Yih Hsu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 7 11:01:50 PDT 2023


myhsu added inline comments.


================
Comment at: llvm/lib/Target/M68k/AsmParser/M68kAsmParser.cpp:645-651
+    if (StringRef(RegisterNameLower).take_front(2) == "fp") {
+      auto RegIndex = unsigned(RegisterNameLower[2] - '0');
+      if (RegIndex < 8) {
+        RegNo = getRegisterByIndex(16 + RegIndex);
+        return true;
+      }
+    }
----------------
0x59616e wrote:
> 0x59616e wrote:
> > nit: Maybe use early exist to reduce indentation ?
> > 
> > 
> nit: Can "starts_with" do better in terms of readability ? 
I wrote in this way so that we can easily plug in the parsing logics for floating point control registers (e.g. fpcr, fpiar) in the future. Please take a look again


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

https://reviews.llvm.org/D147480



More information about the llvm-commits mailing list