[PATCH] D147480: [M68k] Basic FP register files and FMOVE implementations
Sheng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 7 17:19:42 PDT 2023
0x59616e 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;
+ }
+ }
----------------
myhsu wrote:
> 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
It looks even better now.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D147480/new/
https://reviews.llvm.org/D147480
More information about the llvm-commits
mailing list