Page MenuHomePhabricator

[CSKY 5/n] Add support for all CSKY basic integer instructions except for branch series
ClosedPublic

Authored by zixuan-wu on Jan 4 2021, 12:17 AM.

Details

Summary

This patch adds basic CSKY integer instructions except for branch series such as bsr, br.
It mainly includes basic ALU, load & store, compare and data move instructions.

Branch series instructions need handle complex symbol operand as following patch later.

Diff Detail

Event Timeline

zixuan-wu created this revision.Jan 4 2021, 12:17 AM
zixuan-wu requested review of this revision.Jan 4 2021, 12:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 4 2021, 12:17 AM

Can you also link patch 1~3 as the related revisions as well?

llvm/lib/Target/CSKY/AsmParser/CSKYAsmParser.cpp
498

(typo) registe -> register

llvm/lib/Target/CSKY/CSKYInstrFormats.td
407

Is the imm here still pcode?

zixuan-wu added inline comments.Jan 21 2021, 1:08 AM
llvm/lib/Target/CSKY/CSKYInstrFormats.td
407

Yep, the imm is encoded as constant statically.

This looks good to me. @MaskRay any comments?

llvm/lib/Target/CSKY/AsmParser/CSKYAsmParser.cpp
165

These helpers look unnecessary, since the actual function call is so simple...

416
zixuan-wu added inline comments.Apr 13 2021, 10:31 PM
llvm/lib/Target/CSKY/AsmParser/CSKYAsmParser.cpp
165

It's hook function described in td file. The following Name is related to those functions.

class ImmAsmOperand<string prefix, int width, string suffix> : AsmOperandClass {
  let Name = prefix # "Imm" # width # suffix;
  let RenderMethod = "addImmOperands";
  let DiagnosticType = !strconcat("Invalid", Name);
}
rengolin accepted this revision.Apr 14 2021, 2:39 AM

This looks good to me, thanks!

llvm/lib/Target/CSKY/AsmParser/CSKYAsmParser.cpp
165

Ah, yes, makes sense. Thanks!

This revision is now accepted and ready to land.Apr 14 2021, 2:39 AM
This revision was landed with ongoing or failed builds.Apr 20 2021, 12:38 AM
This revision was automatically updated to reflect the committed changes.