Add new subset of Core Instructions (not full yet). Add appropriate operands description,
modify asm parser, printer and code emitter. Modify tests to support new instructions.
Details
Diff Detail
Event Timeline
llvm/lib/Target/Xtensa/AsmParser/XtensaAsmParser.cpp | ||
---|---|---|
132–134 | There are already various forms of isInt/isUInt in MathExtras.h |
llvm/lib/Target/Xtensa/AsmParser/XtensaAsmParser.cpp | ||
---|---|---|
132–134 | Did you mean do not create/use special functions isImm and inRange? Initially I used the same approach as in SystemZ and AArch64 architecture, because we need to check whether expression immediate and also get value of it. |
Patch is updated according to LLVM upstream version and latest Xtensa backend version.
Correct instruction descriptions, format descriptions and instruction operands according to common style for *.td files. The llvm_unreachable is substituted to report_fatal_error.
Minor corrections, changed argument names in the XtensaInstPrinter::printMemOperand function.
Update according to changes in MEMW, EXTW, DSYNC, ESYNC, ISYNC and RSYNC instruction descriptions
Minor source code corrections. Test file xtensa-valid.s is splitted to several files.
llvm/lib/Target/Xtensa/AsmParser/XtensaAsmParser.cpp | ||
---|---|---|
466 | The issue is still there, RegName references deleted memory. One of the possible way to resolve this issue is to declare RegName as std::string rather than StringRef. BTW, what does this code do? I couldn't find any registers that contain only digits in their names (all start with a letter), so MatchRegisterName is bound to fail. Nor could I find a test that uses parenthesized numbers. Are those some special registers not modeled in MC layer (and represented as numbers in assembly language)? As a side node, 'SR' variable should have a more descriptive name (or, at least, its name should be explained in a comment). |
llvm/lib/Target/Xtensa/AsmParser/XtensaAsmParser.cpp | ||
---|---|---|
466 | Thank you for comment. The "RegName" variable is not used outside switch cases, so StringRef object should be alive at points where "RegName" actually used, is it correct? You noted correctly that we should have special registers defined by numbers and Xtensa architecture have such registers for example https://github.com/llvm/llvm-project/blob/ff25800d4ba0b577a44dc918da7a1fb3c29fdb13/llvm/lib/Target/Xtensa/XtensaRegisterInfo.td#L76 . But test for such kind of register names is absent and will be implemented in nearest patches and we will add more explanations to this function. |
llvm/lib/Target/Xtensa/AsmParser/XtensaAsmParser.cpp | ||
---|---|---|
466 | RegName is alive, but the data it references is not. |
llvm/lib/Target/Xtensa/AsmParser/XtensaAsmParser.cpp | ||
---|---|---|
466 | I will rewrite this code in next patches |
There are already various forms of isInt/isUInt in MathExtras.h