[PATCH] D15418: [mips][microMIPS] Implement LH, LHE, LHU and LHUE instructions and add CodeGen support

Simon Dardis via llvm-commits llvm-commits at lists.llvm.org
Thu May 5 07:17:37 PDT 2016


sdardis requested changes to this revision.
sdardis added a comment.
This revision now requires changes to proceed.

One nit and one small change, comments are inlined.


================
Comment at: lib/Target/Mips/MicroMipsInstrFormats.td:1026
@@ +1025,3 @@
+
+class LH_LHU_FM_MM<bits<6> op> {
+  bits<5> rt;
----------------
This class needs to inherit from MMArch, so that this instruction ends up in the Std2MicroMips mapping table from direct object emission.

You can verify the mapping by looking at the Std2MicroMips function in $BUILDDIR/lib/Target/Mips/MipsGenDAGISel.inc and/or the records from llvm-tblgen for the string Arch = in the defs of the instructions.

You'll also have to remove the line "list<Pattern> = []" from the definition of MMArch, otherwise the DAG pattern doesn't get set properly and the instruction cannot be selected in the common case.

Removing that line from the MMArch definition will cause test failures as the selection mechanism be arranged and some 16bit instructions will not be chosen. Some of the test failures are fixed in D19906.

================
Comment at: test/CodeGen/Mips/llvm-ir/lh_lhu.ll:3
@@ +2,3 @@
+; RUN: llc < %s -march=mips -mcpu=mips32r3 -mattr=+micromips -relocation-model=pic | FileCheck %s
+; RUN: llc < %s -march=mips -mcpu=mips32r6 -mattr=+micromips -relocation-model=pic | FileCheck %s
+
----------------
Check microMIPS64r6 as well.


http://reviews.llvm.org/D15418





More information about the llvm-commits mailing list