[PATCH] D34507: [mips] Generate NMADD and NMSUB instructions when fneg node is present

Simon Dardis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 11 07:53:03 PDT 2017


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

You should also add a test with -asm-show-inst for micromips and show that we only generate instructions with _MM suffixes.

Some more comments inlined.



================
Comment at: lib/Target/Mips/MicroMipsInstrFPU.td:274
+
+let AdditionalPredicates = [InMicroMips] in {
+  defm : NMADD_NMSUB<NMADD_S_MM, NMSUB_S_MM, FGR32Opnd>;
----------------
These predicates don't match the ones for standard mips.


================
Comment at: lib/Target/Mips/MipsInstrFPU.td:863
+// To generate NMADD and NMSUB instructions when fneg node is present
+
+multiclass NMADD_NMSUB<Instruction Nmadd, Instruction Nmsub, RegisterOperand RC> {
----------------
Spurious blank line.


================
Comment at: test/CodeGen/Mips/nmadd.ll:9
+; RUN: llc < %s -march=mipsel   -mcpu=mips32r6 -enable-no-nans-fp-math | FileCheck %s -check-prefixes=ALL,CHECK-NOT-NM
+; RUN: llc < %s -march=mipsel   -mcpu=mips32r6 -mattr=micromips64r6 -enable-no-nans-fp-math | FileCheck %s -check-prefixes=ALL,CHECK-NOT-NM
+; RUN: llc < %s -march=mips64el -mcpu=mips3    -target-abi=n64 -enable-no-nans-fp-math | FileCheck %s -check-prefixes=ALL,CHECK-NOT-NM-64
----------------
That should be -mattr=micromips. You can skip testing for micromips64r6 as that backend is going to be removed.


https://reviews.llvm.org/D34507





More information about the llvm-commits mailing list