|
| 1 | +//===- llvm/IR/ConstrainedOps.def - Constrained intrinsics ------*- C++ -*-===// |
| 2 | +// |
| 3 | +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | +// See https://llvm.org/LICENSE.txt for license information. |
| 5 | +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | +// |
| 7 | +//===----------------------------------------------------------------------===// |
| 8 | +// |
| 9 | +// Defines properties of constrained intrinsics, in particular corresponding |
| 10 | +// floating point operations and DAG nodes. |
| 11 | +// |
| 12 | +//===----------------------------------------------------------------------===// |
| 13 | + |
| 14 | +#ifndef INSTRUCTION |
| 15 | +#define INSTRUCTION(N,A,R,I,D) |
| 16 | +#endif |
| 17 | + |
| 18 | +// In most cases intrinsic function is handled similar to instruction. |
| 19 | +#ifndef FUNCTION |
| 20 | +#define FUNCTION INSTRUCTION |
| 21 | +#endif |
| 22 | + |
| 23 | +// Arguments of the entries are: |
| 24 | +// - instruction or intrinsic function name. |
| 25 | +// - Number of original instruction/intrinsic arguments. |
| 26 | +// - 1 if the corresponding constrained intrinsic has rounding mode argument. |
| 27 | +// - name of the constrained intrinsic to represent this instruction/function. |
| 28 | +// - DAG node corresponding to the constrained intrinsic without prefix STRICT_. |
| 29 | + |
| 30 | +// These are definitions for instructions, that are converted into constrained |
| 31 | +// intrinsics. |
| 32 | +// |
| 33 | +INSTRUCTION(FAdd, 2, 1, experimental_constrained_fadd, FADD) |
| 34 | +INSTRUCTION(FSub, 2, 1, experimental_constrained_fsub, FSUB) |
| 35 | +INSTRUCTION(FMul, 2, 1, experimental_constrained_fmul, FMUL) |
| 36 | +INSTRUCTION(FDiv, 2, 1, experimental_constrained_fdiv, FDIV) |
| 37 | +INSTRUCTION(FRem, 2, 1, experimental_constrained_frem, FREM) |
| 38 | +INSTRUCTION(FPExt, 1, 0, experimental_constrained_fpext, FP_EXTEND) |
| 39 | +INSTRUCTION(FPToSI, 1, 0, experimental_constrained_fptosi, FP_TO_SINT) |
| 40 | +INSTRUCTION(FPToUI, 1, 0, experimental_constrained_fptoui, FP_TO_UINT) |
| 41 | +INSTRUCTION(FPTrunc, 1, 1, experimental_constrained_fptrunc, FP_ROUND) |
| 42 | + |
| 43 | +// Theses are definitions for intrinsic functions, that are converted into |
| 44 | +// constrained intrinsics. |
| 45 | +// |
| 46 | +FUNCTION(ceil, 1, 1, experimental_constrained_ceil, FCEIL) |
| 47 | +FUNCTION(cos, 1, 1, experimental_constrained_cos, FCOS) |
| 48 | +FUNCTION(exp, 1, 1, experimental_constrained_exp, FEXP) |
| 49 | +FUNCTION(exp2, 1, 1, experimental_constrained_exp2, FEXP2) |
| 50 | +FUNCTION(floor, 1, 1, experimental_constrained_floor, FFLOOR) |
| 51 | +FUNCTION(fma, 3, 1, experimental_constrained_fma, FMA) |
| 52 | +FUNCTION(log, 1, 1, experimental_constrained_log, FLOG) |
| 53 | +FUNCTION(log10, 1, 1, experimental_constrained_log10, FLOG10) |
| 54 | +FUNCTION(log2, 1, 1, experimental_constrained_log2, FLOG2) |
| 55 | +FUNCTION(lrint, 1, 1, experimental_constrained_lrint, LRINT) |
| 56 | +FUNCTION(llrint, 1, 1, experimental_constrained_llrint, LLRINT) |
| 57 | +FUNCTION(lround, 1, 0, experimental_constrained_lround, LROUND) |
| 58 | +FUNCTION(llround, 1, 0, experimental_constrained_llround, LLROUND) |
| 59 | +FUNCTION(maxnum, 2, 1, experimental_constrained_maxnum, FMAXNUM) |
| 60 | +FUNCTION(minnum, 2, 1, experimental_constrained_minnum, FMINNUM) |
| 61 | +FUNCTION(nearbyint, 1, 1, experimental_constrained_nearbyint, FNEARBYINT) |
| 62 | +FUNCTION(pow, 2, 1, experimental_constrained_pow, FPOW) |
| 63 | +FUNCTION(powi, 2, 1, experimental_constrained_powi, FPOWI) |
| 64 | +FUNCTION(rint, 1, 1, experimental_constrained_rint, FRINT) |
| 65 | +FUNCTION(round, 1, 1, experimental_constrained_round, FROUND) |
| 66 | +FUNCTION(sin, 1, 1, experimental_constrained_sin, FSIN) |
| 67 | +FUNCTION(sqrt, 1, 1, experimental_constrained_sqrt, FSQRT) |
| 68 | +FUNCTION(trunc, 1, 1, experimental_constrained_trunc, FTRUNC) |
| 69 | + |
| 70 | +#undef INSTRUCTION |
| 71 | +#undef FUNCTION |
0 commit comments