Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/llvm/IR/ConstrainedOps.def is written in an unsupported language. File is not indexed.

0001 //===- llvm/IR/ConstrainedOps.def - Constrained intrinsics ------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // Defines properties of constrained intrinsics, in particular corresponding
0010 // floating point operations and DAG nodes.
0011 //
0012 //===----------------------------------------------------------------------===//
0013 
0014 // DAG_FUNCTION defers to DAG_INSTRUCTION if its defined, otherwise FUNCTION.
0015 #ifndef DAG_FUNCTION
0016 #ifdef DAG_INSTRUCTION
0017 #define DAG_FUNCTION(N,A,R,I,D) DAG_INSTRUCTION(N,A,R,I,D)
0018 #else
0019 #define DAG_FUNCTION(N,A,R,I,D) FUNCTION(N,A,R,I)
0020 #endif
0021 #endif
0022 
0023 #ifndef INSTRUCTION
0024 #define INSTRUCTION(N,A,R,I)
0025 #endif
0026 
0027 // DAG_INSTRUCTION is treated like an INSTRUCTION if the DAG node isn't used.
0028 #ifndef DAG_INSTRUCTION
0029 #define DAG_INSTRUCTION(N,A,R,I,D) INSTRUCTION(N,A,R,I)
0030 #endif
0031 
0032 // In most cases intrinsic function is handled similar to instruction.
0033 #ifndef FUNCTION
0034 #define FUNCTION(N,A,R,I) INSTRUCTION(N,A,R,I)
0035 #endif
0036 
0037 // Compare instruction have a DAG node so they are treated like DAG_INSTRUCTION.
0038 #ifndef CMP_INSTRUCTION
0039 #define CMP_INSTRUCTION(N,A,R,I,D) DAG_INSTRUCTION(N,A,R,I,D)
0040 #endif
0041 
0042 // Arguments of the entries are:
0043 // - instruction or intrinsic function name.
0044 // - Number of original instruction/intrinsic arguments.
0045 // - 1 if the corresponding constrained intrinsic has rounding mode argument.
0046 // - name of the constrained intrinsic to represent this instruction/function.
0047 // - DAG node corresponding to the constrained intrinsic without prefix STRICT_.
0048 
0049 // These are definitions for instructions, that are converted into constrained
0050 // intrinsics.
0051 //
0052 DAG_INSTRUCTION(FAdd,         2, 1, experimental_constrained_fadd,       FADD)
0053 DAG_INSTRUCTION(FSub,         2, 1, experimental_constrained_fsub,       FSUB)
0054 DAG_INSTRUCTION(FMul,         2, 1, experimental_constrained_fmul,       FMUL)
0055 DAG_INSTRUCTION(FDiv,         2, 1, experimental_constrained_fdiv,       FDIV)
0056 DAG_INSTRUCTION(FRem,         2, 1, experimental_constrained_frem,       FREM)
0057 DAG_INSTRUCTION(FPExt,        1, 0, experimental_constrained_fpext,      FP_EXTEND)
0058 DAG_INSTRUCTION(SIToFP,       1, 1, experimental_constrained_sitofp,     SINT_TO_FP)
0059 DAG_INSTRUCTION(UIToFP,       1, 1, experimental_constrained_uitofp,     UINT_TO_FP)
0060 DAG_INSTRUCTION(FPToSI,       1, 0, experimental_constrained_fptosi,     FP_TO_SINT)
0061 DAG_INSTRUCTION(FPToUI,       1, 0, experimental_constrained_fptoui,     FP_TO_UINT)
0062 DAG_INSTRUCTION(FPTrunc,      1, 1, experimental_constrained_fptrunc,    FP_ROUND)
0063 
0064 // These are definitions for compare instructions (signaling and quiet version).
0065 // Both of these match to FCmp / SETCC.
0066 CMP_INSTRUCTION(FCmp,         2, 0, experimental_constrained_fcmp,       FSETCC)
0067 CMP_INSTRUCTION(FCmp,         2, 0, experimental_constrained_fcmps,      FSETCCS)
0068 
0069 // Theses are definitions for intrinsic functions, that are converted into
0070 // constrained intrinsics.
0071 //
0072 DAG_FUNCTION(acos,            1, 1, experimental_constrained_acos,       FACOS)
0073 DAG_FUNCTION(asin,            1, 1, experimental_constrained_asin,       FASIN)
0074 DAG_FUNCTION(atan,            1, 1, experimental_constrained_atan,       FATAN)
0075 DAG_FUNCTION(atan2,           2, 1, experimental_constrained_atan2,      FATAN2)
0076 DAG_FUNCTION(ceil,            1, 0, experimental_constrained_ceil,       FCEIL)
0077 DAG_FUNCTION(cos,             1, 1, experimental_constrained_cos,        FCOS)
0078 DAG_FUNCTION(cosh,            1, 1, experimental_constrained_cosh,       FCOSH)
0079 DAG_FUNCTION(exp,             1, 1, experimental_constrained_exp,        FEXP)
0080 DAG_FUNCTION(exp2,            1, 1, experimental_constrained_exp2,       FEXP2)
0081 DAG_FUNCTION(floor,           1, 0, experimental_constrained_floor,      FFLOOR)
0082 DAG_FUNCTION(fma,             3, 1, experimental_constrained_fma,        FMA)
0083 DAG_FUNCTION(log,             1, 1, experimental_constrained_log,        FLOG)
0084 DAG_FUNCTION(log10,           1, 1, experimental_constrained_log10,      FLOG10)
0085 DAG_FUNCTION(log2,            1, 1, experimental_constrained_log2,       FLOG2)
0086 DAG_FUNCTION(lrint,           1, 1, experimental_constrained_lrint,      LRINT)
0087 DAG_FUNCTION(llrint,          1, 1, experimental_constrained_llrint,     LLRINT)
0088 DAG_FUNCTION(lround,          1, 0, experimental_constrained_lround,     LROUND)
0089 DAG_FUNCTION(llround,         1, 0, experimental_constrained_llround,    LLROUND)
0090 DAG_FUNCTION(maxnum,          2, 0, experimental_constrained_maxnum,     FMAXNUM)
0091 DAG_FUNCTION(minnum,          2, 0, experimental_constrained_minnum,     FMINNUM)
0092 DAG_FUNCTION(maximum,         2, 0, experimental_constrained_maximum,    FMAXIMUM)
0093 DAG_FUNCTION(minimum,         2, 0, experimental_constrained_minimum,    FMINIMUM)
0094 DAG_FUNCTION(nearbyint,       1, 1, experimental_constrained_nearbyint,  FNEARBYINT)
0095 DAG_FUNCTION(pow,             2, 1, experimental_constrained_pow,        FPOW)
0096 DAG_FUNCTION(powi,            2, 1, experimental_constrained_powi,       FPOWI)
0097 DAG_FUNCTION(ldexp,           2, 1, experimental_constrained_ldexp,      FLDEXP)
0098 DAG_FUNCTION(rint,            1, 1, experimental_constrained_rint,       FRINT)
0099 DAG_FUNCTION(round,           1, 0, experimental_constrained_round,      FROUND)
0100 DAG_FUNCTION(roundeven,       1, 0, experimental_constrained_roundeven,  FROUNDEVEN)
0101 DAG_FUNCTION(sin,             1, 1, experimental_constrained_sin,        FSIN)
0102 DAG_FUNCTION(sinh,            1, 1, experimental_constrained_sinh,       FSINH)
0103 DAG_FUNCTION(sqrt,            1, 1, experimental_constrained_sqrt,       FSQRT)
0104 DAG_FUNCTION(tan,             1, 1, experimental_constrained_tan,        FTAN)
0105 DAG_FUNCTION(tanh,            1, 1, experimental_constrained_tanh,       FTANH)
0106 DAG_FUNCTION(trunc,           1, 0, experimental_constrained_trunc,      FTRUNC)
0107 
0108 // This is definition for fmuladd intrinsic function, that is converted into
0109 // constrained FMA or FMUL + FADD intrinsics.
0110 FUNCTION(fmuladd,         3, 1, experimental_constrained_fmuladd)
0111 
0112 #undef INSTRUCTION
0113 #undef FUNCTION
0114 #undef CMP_INSTRUCTION
0115 #undef DAG_INSTRUCTION
0116 #undef DAG_FUNCTION