Index: llvm/trunk/include/llvm/Support/TargetOpcodes.def =================================================================== --- llvm/trunk/include/llvm/Support/TargetOpcodes.def +++ llvm/trunk/include/llvm/Support/TargetOpcodes.def @@ -536,6 +536,9 @@ /// Floating point floor. HANDLE_TARGET_OPCODE(G_FFLOOR) +/// Floating point round to next integer. +HANDLE_TARGET_OPCODE(G_FRINT) + /// Generic AddressSpaceCast. HANDLE_TARGET_OPCODE(G_ADDRSPACE_CAST) Index: llvm/trunk/include/llvm/Target/GenericOpcodes.td =================================================================== --- llvm/trunk/include/llvm/Target/GenericOpcodes.td +++ llvm/trunk/include/llvm/Target/GenericOpcodes.td @@ -592,6 +592,13 @@ let hasSideEffects = 0; } +// Floating point round to next integer. +def G_FRINT : 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 @@ -95,6 +95,7 @@ def : GINodeEquiv; def : GINodeEquiv; def : GINodeEquiv; +def : GINodeEquiv; // 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/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 @@ -346,6 +346,9 @@ # 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: user-defined predicate detected +# +# DEBUG-NEXT: G_FRINT (opcode 146): 1 type index # DEBUG: .. type index coverage check SKIPPED: no rules defined # CHECK-NOT: ill-defined