1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

[GlobalISel] Add G_FSIN and G_FCOS generic instructions

This introduces generic instrutions for floating point sin and cos, G_FCOS and
G_FSIN. It updates the tests, etc.

https://reviews.llvm.org/D57197
1/3

llvm-svn: 352400
This commit is contained in:
Jessica Paquette 2019-01-28 18:34:16 +00:00
parent ca31619260
commit e2b76b0235
4 changed files with 29 additions and 1 deletions

View File

@ -520,6 +520,12 @@ HANDLE_TARGET_OPCODE(G_BSWAP)
/// Floating point ceil.
HANDLE_TARGET_OPCODE(G_FCEIL)
/// Floating point cosine.
HANDLE_TARGET_OPCODE(G_FCOS)
/// Floating point sine.
HANDLE_TARGET_OPCODE(G_FSIN)
/// Generic AddressSpaceCast.
HANDLE_TARGET_OPCODE(G_ADDRSPACE_CAST)

View File

@ -555,6 +555,20 @@ def G_FCEIL : GenericInstruction {
let hasSideEffects = 0;
}
// Floating point cosine of a value.
def G_FCOS : GenericInstruction {
let OutOperandList = (outs type0:$dst);
let InOperandList = (ins type0:$src1);
let hasSideEffects = 0;
}
// Floating point sine of a value.
def G_FSIN : GenericInstruction {
let OutOperandList = (outs type0:$dst);
let InOperandList = (ins type0:$src1);
let hasSideEffects = 0;
}
//------------------------------------------------------------------------------
// Opcodes for LLVM Intrinsics
//------------------------------------------------------------------------------

View File

@ -89,6 +89,8 @@ def : GINodeEquiv<G_CTTZ_ZERO_UNDEF, cttz_zero_undef>;
def : GINodeEquiv<G_CTPOP, ctpop>;
def : GINodeEquiv<G_EXTRACT_VECTOR_ELT, vector_extract>;
def : GINodeEquiv<G_FCEIL, fceil>;
def : GINodeEquiv<G_FCOS, fcos>;
def : GINodeEquiv<G_FSIN, fsin>;
// Broadly speaking G_LOAD is equivalent to ISD::LOAD but there are some
// complications that tablegen must take care of. For example, Predicates such

View File

@ -331,7 +331,13 @@
# DEBUG: .. the first uncovered type index: 1, OK
#
# DEBUG-NEXT: G_FCEIL (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_FCOS (opcode {{[0-9]+}}): 1 type index
# DEBUG: .. type index coverage check SKIPPED: no rules defined
#
# DEBUG-NEXT: G_FSIN (opcode {{[0-9]+}}): 1 type index
# DEBUG: .. type index coverage check SKIPPED: no rules defined
# CHECK-NOT: ill-defined