[PATCH] D60921: [GlobalISel] Add a G_FNEARBYINT opcode
Jessica Paquette via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 25 09:34:09 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL359201: [GlobalISel] Add a G_FNEARBYINT opcode (authored by paquette, committed by ).
Herald added a subscriber: kristina.
Changed prior to commit:
https://reviews.llvm.org/D60921?vs=195910&id=196658#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D60921/new/
https://reviews.llvm.org/D60921
Files:
llvm/trunk/include/llvm/Support/TargetOpcodes.def
llvm/trunk/include/llvm/Target/GenericOpcodes.td
llvm/trunk/include/llvm/Target/GlobalISel/SelectionDAGCompat.td
llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalizer-info-validation.mir
Index: llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalizer-info-validation.mir
===================================================================
--- llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalizer-info-validation.mir
+++ llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalizer-info-validation.mir
@@ -350,6 +350,9 @@
#
# DEBUG-NEXT: G_FRINT (opcode {{[0-9]+}}): 1 type index
# DEBUG: .. type index coverage check SKIPPED: user-defined predicate detected
+#
+# DEBUG-NEXT: G_FNEARBYINT (opcode {{[0-9]+}}): 1 type index
+# DEBUG: .. type index coverage check SKIPPED: no rules defined
# CHECK-NOT: ill-defined
Index: llvm/trunk/include/llvm/Target/GenericOpcodes.td
===================================================================
--- llvm/trunk/include/llvm/Target/GenericOpcodes.td
+++ llvm/trunk/include/llvm/Target/GenericOpcodes.td
@@ -599,6 +599,13 @@
let hasSideEffects = 0;
}
+// Floating point round to the nearest integer.
+def G_FNEARBYINT : GenericInstruction {
+ let OutOperandList = (outs type0:$dst);
+ let InOperandList = (ins type0:$src1);
+ let hasSideEffects = 0;
+}
+
//------------------------------------------------------------------------------
// Opcodes for LLVM Intrinsics
//------------------------------------------------------------------------------
Index: llvm/trunk/include/llvm/Target/GlobalISel/SelectionDAGCompat.td
===================================================================
--- llvm/trunk/include/llvm/Target/GlobalISel/SelectionDAGCompat.td
+++ llvm/trunk/include/llvm/Target/GlobalISel/SelectionDAGCompat.td
@@ -96,6 +96,7 @@
def : GINodeEquiv<G_FSQRT, fsqrt>;
def : GINodeEquiv<G_FFLOOR, ffloor>;
def : GINodeEquiv<G_FRINT, frint>;
+def : GINodeEquiv<G_FNEARBYINT, fnearbyint>;
// Broadly speaking G_LOAD is equivalent to ISD::LOAD but there are some
// complications that tablegen must take care of. For example, Predicates such
Index: llvm/trunk/include/llvm/Support/TargetOpcodes.def
===================================================================
--- llvm/trunk/include/llvm/Support/TargetOpcodes.def
+++ llvm/trunk/include/llvm/Support/TargetOpcodes.def
@@ -539,6 +539,9 @@
/// Floating point round to next integer.
HANDLE_TARGET_OPCODE(G_FRINT)
+/// Floating point round to nearest integer.
+HANDLE_TARGET_OPCODE(G_FNEARBYINT)
+
/// Generic AddressSpaceCast.
HANDLE_TARGET_OPCODE(G_ADDRSPACE_CAST)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60921.196658.patch
Type: text/x-patch
Size: 2399 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190425/523ddf2e/attachment.bin>
More information about the llvm-commits
mailing list