[PATCH] D63541: [MIPS GlobalISel] Select floating point to integer conversions

Simon Atanasyan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 19 07:51:06 PDT 2019


atanasyan accepted this revision.
atanasyan added a comment.
This revision is now accepted and ready to land.

LGTM with a couple nits.



================
Comment at: lib/Target/Mips/MipsInstructionSelector.cpp:371
+  case G_FPTOSI: {
+    unsigned SizeInt = MRI.getType(I.getOperand(0).getReg()).getSizeInBits();
+    unsigned SizeFP = MRI.getType(I.getOperand(1).getReg()).getSizeInBits();
----------------
Maybe use the same terms as in the LegalizerHelper: FromSize and ToSize? Just for uniformity.


================
Comment at: lib/Target/Mips/MipsInstructionSelector.cpp:373
+    unsigned SizeFP = MRI.getType(I.getOperand(1).getReg()).getSizeInBits();
+    assert((SizeInt == 32 && (SizeFP == 32 || SizeFP == 64)) &&
+           "Unsupported operand size for G_FPTOSI");
----------------
In the `MipsRegisterBankInfo::getInstrMapping` the same checking made by a couple of assert. Let's either split this check or merge the check in the `MipsRegisterBankInfo::getInstrMapping`. As well for uniformity


Repository:
  rL LLVM

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

https://reviews.llvm.org/D63541





More information about the llvm-commits mailing list