diff options
| author | Jessica Paquette <jpaquette@apple.com> | 2019-02-04 17:10:55 +0000 |
|---|---|---|
| committer | Jessica Paquette <jpaquette@apple.com> | 2019-02-04 17:10:55 +0000 |
| commit | 616a1fb4920f269e4a60f25d9abca8a7228b1691 (patch) | |
| tree | 2230d6bd6c3a0de4f4ff131c811fb049444414f2 /llvm | |
| parent | c00bdab4c897032f773b1101d48a68e8e273aae4 (diff) | |
| download | bcm5719-llvm-616a1fb4920f269e4a60f25d9abca8a7228b1691.tar.gz bcm5719-llvm-616a1fb4920f269e4a60f25d9abca8a7228b1691.zip | |
[GlobalISel] Introduce a generic floating point floor opcode, G_FFLOOR
This introduces a generic opcode for floating point floor, working towards
selecting @llvm.floor.
Differential Revision: https://reviews.llvm.org/D57484
llvm-svn: 353057
Diffstat (limited to 'llvm')
4 files changed, 15 insertions, 1 deletions
diff --git a/llvm/include/llvm/Support/TargetOpcodes.def b/llvm/include/llvm/Support/TargetOpcodes.def index 23d008a0147..5f4e9c67a09 100644 --- a/llvm/include/llvm/Support/TargetOpcodes.def +++ b/llvm/include/llvm/Support/TargetOpcodes.def @@ -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) diff --git a/llvm/include/llvm/Target/GenericOpcodes.td b/llvm/include/llvm/Target/GenericOpcodes.td index b61ed926501..41d1ed9937a 100644 --- a/llvm/include/llvm/Target/GenericOpcodes.td +++ b/llvm/include/llvm/Target/GenericOpcodes.td @@ -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 //------------------------------------------------------------------------------ diff --git a/llvm/include/llvm/Target/GlobalISel/SelectionDAGCompat.td b/llvm/include/llvm/Target/GlobalISel/SelectionDAGCompat.td index cbda4ab86a5..6b0434a0758 100644 --- a/llvm/include/llvm/Target/GlobalISel/SelectionDAGCompat.td +++ b/llvm/include/llvm/Target/GlobalISel/SelectionDAGCompat.td @@ -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 diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/legalizer-info-validation.mir b/llvm/test/CodeGen/AArch64/GlobalISel/legalizer-info-validation.mir index 09574f0b85d..ab144eedfac 100644 --- a/llvm/test/CodeGen/AArch64/GlobalISel/legalizer-info-validation.mir +++ b/llvm/test/CodeGen/AArch64/GlobalISel/legalizer-info-validation.mir @@ -340,7 +340,10 @@ # 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 |

