]> granicus.if.org Git - llvm/commitdiff
[GlobalISel] Introduce a generic floating point floor opcode, G_FFLOOR
authorJessica Paquette <jpaquette@apple.com>
Mon, 4 Feb 2019 17:10:55 +0000 (17:10 +0000)
committerJessica Paquette <jpaquette@apple.com>
Mon, 4 Feb 2019 17:10:55 +0000 (17:10 +0000)
This introduces a generic opcode for floating point floor, working towards
selecting @llvm.floor.

Differential Revision: https://reviews.llvm.org/D57484

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353057 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/TargetOpcodes.def
include/llvm/Target/GenericOpcodes.td
include/llvm/Target/GlobalISel/SelectionDAGCompat.td
test/CodeGen/AArch64/GlobalISel/legalizer-info-validation.mir

index 23d008a0147282bd7123d2f19de3cc60805cfc5a..5f4e9c67a0934d48e17bcb001d4766b950f3ef3f 100644 (file)
@@ -529,6 +529,9 @@ HANDLE_TARGET_OPCODE(G_FSIN)
 /// Floating point square root.
 HANDLE_TARGET_OPCODE(G_FSQRT)
 
+/// Floating point floor.
+HANDLE_TARGET_OPCODE(G_FFLOOR)
+
 /// Generic AddressSpaceCast.
 HANDLE_TARGET_OPCODE(G_ADDRSPACE_CAST)
 
index b61ed92650101774718bc9a8eea5bcad7703235b..41d1ed9937aedf08ff4bce0f96133f9afc09f4fd 100644 (file)
@@ -579,6 +579,13 @@ def G_FSQRT : GenericInstruction {
   let hasSideEffects = 0;
 }
 
+// Floating point floor of a value.
+def G_FFLOOR : GenericInstruction {
+  let OutOperandList = (outs type0:$dst);
+  let InOperandList = (ins type0:$src1);
+  let hasSideEffects = 0;
+}
+
 //------------------------------------------------------------------------------
 // Opcodes for LLVM Intrinsics
 //------------------------------------------------------------------------------
index cbda4ab86a504fed662f6f835aca0c7ef8ab5a75..6b0434a0758cd44bacbc96d6dcdc2f310e47a0cc 100644 (file)
@@ -93,6 +93,7 @@ def : GINodeEquiv<G_FCOS, fcos>;
 def : GINodeEquiv<G_FSIN, fsin>;
 def : GINodeEquiv<G_FABS, fabs>;
 def : GINodeEquiv<G_FSQRT, fsqrt>;
+def : GINodeEquiv<G_FFLOOR, ffloor>;
 
 // 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 09574f0b85d4db66b0222e5b81102708820925ce..ab144eedfacc26d1626b76f304db70a7430d3f57 100644 (file)
 # DEBUG: .. the first uncovered type index: 1, OK
 #
 # DEBUG-NEXT: G_FSQRT (opcode {{[0-9]+}}): 1 type index
-# DEBUG: .. the first uncovered type index: 1, OK
+# DEBUG: .. type index coverage check SKIPPED: user-defined predicate detected
+#
+# DEBUG-NEXT: G_FFLOOR (opcode {{[0-9]+}}): 1 type index
+# DEBUG: .. type index coverage check SKIPPED: no rules defined
 
 # CHECK-NOT: ill-defined