[PATCH] D59046: [mips] Map SW instruction to its microMIPS R6 variant

Petar Avramovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 12 08:31:12 PDT 2019


Petar.Avramovic added a comment.

I see. I think that in order to keep up with current implementation of microMIPS r6 in `MicroMips32r6InstrInfo.td` we should map microMIPS instruction to its corresponding standard encoding instruction when necessary.
According to documentation `cb e5` has assembler format `swsp $ra, 20($sp)` but since here both clang and gcc use assembler format `sw $ra, 20($sp)` I think that we should keep the same behavior.
I would prefer solution in which when target instruction is selected it cannot be changed later. Alternatively for efficiency pseudo instruction could be selected and expanded into target instruction later.  This approach would allow faster localization if problem occurs. 
Regarding microMIPS r6 implementation I think that we should add both " patterns / manual instruction select" and "instruction mapping" when possible for completeness, since both are present.  "Instruction mapping" approach also introduces some code duplication since often there is no difference between microMIPS  pre-r6 and r6 instructions.
I agree that mapping in `.td` file is the best solution here.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D59046





More information about the llvm-commits mailing list