LLVM API Documentation

RuntimeLibcalls.h

Go to the documentation of this file.
00001 //===-- CodeGen/RuntimeLibcall.h - Runtime Library Calls --------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file defines the enum representing the list of runtime library calls
00011 // the backend may emit during code generation, and also some helper functions.
00012 //
00013 //===----------------------------------------------------------------------===//
00014 
00015 #ifndef LLVM_CODEGEN_RUNTIMELIBCALLS_H
00016 #define LLVM_CODEGEN_RUNTIMELIBCALLS_H
00017 
00018 #include "llvm/CodeGen/ValueTypes.h"
00019 
00020 namespace llvm {
00021 namespace RTLIB {
00022   /// RTLIB::Libcall enum - This enum defines all of the runtime library calls
00023   /// the backend can emit.  The various long double types cannot be merged,
00024   /// because 80-bit library functions use "xf" and 128-bit use "tf".
00025   /// 
00026   /// When adding PPCF128 functions here, note that their names generally need
00027   /// to be overridden for Darwin with the xxx$LDBL128 form.  See
00028   /// PPCISelLowering.cpp.
00029   ///
00030   enum Libcall {
00031     // Integer
00032     SHL_I16,
00033     SHL_I32,
00034     SHL_I64,
00035     SHL_I128,
00036     SRL_I16,
00037     SRL_I32,
00038     SRL_I64,
00039     SRL_I128,
00040     SRA_I16,
00041     SRA_I32,
00042     SRA_I64,
00043     SRA_I128,
00044     MUL_I16,
00045     MUL_I32,
00046     MUL_I64,
00047     MUL_I128,
00048     SDIV_I32,
00049     SDIV_I64,
00050     SDIV_I128,
00051     UDIV_I32,
00052     UDIV_I64,
00053     UDIV_I128,
00054     SREM_I32,
00055     SREM_I64,
00056     SREM_I128,
00057     UREM_I32,
00058     UREM_I64,
00059     UREM_I128,
00060     NEG_I32,
00061     NEG_I64,
00062 
00063     // FLOATING POINT
00064     ADD_F32,
00065     ADD_F64,
00066     ADD_F80,
00067     ADD_PPCF128,
00068     SUB_F32,
00069     SUB_F64,
00070     SUB_F80,
00071     SUB_PPCF128,
00072     MUL_F32,
00073     MUL_F64,
00074     MUL_F80,
00075     MUL_PPCF128,
00076     DIV_F32,
00077     DIV_F64,
00078     DIV_F80,
00079     DIV_PPCF128,
00080     REM_F32,
00081     REM_F64,
00082     REM_F80,
00083     REM_PPCF128,
00084     POWI_F32,
00085     POWI_F64,
00086     POWI_F80,
00087     POWI_PPCF128,
00088     SQRT_F32,
00089     SQRT_F64,
00090     SQRT_F80,
00091     SQRT_PPCF128,
00092     LOG_F32,
00093     LOG_F64,
00094     LOG_F80,
00095     LOG_PPCF128,
00096     LOG2_F32,
00097     LOG2_F64,
00098     LOG2_F80,
00099     LOG2_PPCF128,
00100     LOG10_F32,
00101     LOG10_F64,
00102     LOG10_F80,
00103     LOG10_PPCF128,
00104     EXP_F32,
00105     EXP_F64,
00106     EXP_F80,
00107     EXP_PPCF128,
00108     EXP2_F32,
00109     EXP2_F64,
00110     EXP2_F80,
00111     EXP2_PPCF128,
00112     SIN_F32,
00113     SIN_F64,
00114     SIN_F80,
00115     SIN_PPCF128,
00116     COS_F32,
00117     COS_F64,
00118     COS_F80,
00119     COS_PPCF128,
00120     POW_F32,
00121     POW_F64,
00122     POW_F80,
00123     POW_PPCF128,
00124     CEIL_F32,
00125     CEIL_F64,
00126     CEIL_F80,
00127     CEIL_PPCF128,
00128     TRUNC_F32,
00129     TRUNC_F64,
00130     TRUNC_F80,
00131     TRUNC_PPCF128,
00132     RINT_F32,
00133     RINT_F64,
00134     RINT_F80,
00135     RINT_PPCF128,
00136     NEARBYINT_F32,
00137     NEARBYINT_F64,
00138     NEARBYINT_F80,
00139     NEARBYINT_PPCF128,
00140     FLOOR_F32,
00141     FLOOR_F64,
00142     FLOOR_F80,
00143     FLOOR_PPCF128,
00144 
00145     // CONVERSION
00146     FPEXT_F32_F64,
00147     FPROUND_F64_F32,
00148     FPROUND_F80_F32,
00149     FPROUND_PPCF128_F32,
00150     FPROUND_F80_F64,
00151     FPROUND_PPCF128_F64,
00152     FPTOSINT_F32_I32,
00153     FPTOSINT_F32_I64,
00154     FPTOSINT_F32_I128,
00155     FPTOSINT_F64_I32,
00156     FPTOSINT_F64_I64,
00157     FPTOSINT_F64_I128,
00158     FPTOSINT_F80_I32,
00159     FPTOSINT_F80_I64,
00160     FPTOSINT_F80_I128,
00161     FPTOSINT_PPCF128_I32,
00162     FPTOSINT_PPCF128_I64,
00163     FPTOSINT_PPCF128_I128,
00164     FPTOUINT_F32_I32,
00165     FPTOUINT_F32_I64,
00166     FPTOUINT_F32_I128,
00167     FPTOUINT_F64_I32,
00168     FPTOUINT_F64_I64,
00169     FPTOUINT_F64_I128,
00170     FPTOUINT_F80_I32,
00171     FPTOUINT_F80_I64,
00172     FPTOUINT_F80_I128,
00173     FPTOUINT_PPCF128_I32,
00174     FPTOUINT_PPCF128_I64,
00175     FPTOUINT_PPCF128_I128,
00176     SINTTOFP_I32_F32,
00177     SINTTOFP_I32_F64,
00178     SINTTOFP_I32_F80,
00179     SINTTOFP_I32_PPCF128,
00180     SINTTOFP_I64_F32,
00181     SINTTOFP_I64_F64,
00182     SINTTOFP_I64_F80,
00183     SINTTOFP_I64_PPCF128,
00184     SINTTOFP_I128_F32,
00185     SINTTOFP_I128_F64,
00186     SINTTOFP_I128_F80,
00187     SINTTOFP_I128_PPCF128,
00188     UINTTOFP_I32_F32,
00189     UINTTOFP_I32_F64,
00190     UINTTOFP_I32_F80,
00191     UINTTOFP_I32_PPCF128,
00192     UINTTOFP_I64_F32,
00193     UINTTOFP_I64_F64,
00194     UINTTOFP_I64_F80,
00195     UINTTOFP_I64_PPCF128,
00196     UINTTOFP_I128_F32,
00197     UINTTOFP_I128_F64,
00198     UINTTOFP_I128_F80,
00199     UINTTOFP_I128_PPCF128,
00200 
00201     // COMPARISON
00202     OEQ_F32,
00203     OEQ_F64,
00204     UNE_F32,
00205     UNE_F64,
00206     OGE_F32,
00207     OGE_F64,
00208     OLT_F32,
00209     OLT_F64,
00210     OLE_F32,
00211     OLE_F64,
00212     OGT_F32,
00213     OGT_F64,
00214     UO_F32,
00215     UO_F64,
00216     O_F32,
00217     O_F64,
00218 
00219     UNKNOWN_LIBCALL
00220   };
00221 
00222   /// getFPEXT - Return the FPEXT_*_* value for the given types, or
00223   /// UNKNOWN_LIBCALL if there is none.
00224   Libcall getFPEXT(MVT OpVT, MVT RetVT);
00225 
00226   /// getFPROUND - Return the FPROUND_*_* value for the given types, or
00227   /// UNKNOWN_LIBCALL if there is none.
00228   Libcall getFPROUND(MVT OpVT, MVT RetVT);
00229 
00230   /// getFPTOSINT - Return the FPTOSINT_*_* value for the given types, or
00231   /// UNKNOWN_LIBCALL if there is none.
00232   Libcall getFPTOSINT(MVT OpVT, MVT RetVT);
00233 
00234   /// getFPTOUINT - Return the FPTOUINT_*_* value for the given types, or
00235   /// UNKNOWN_LIBCALL if there is none.
00236   Libcall getFPTOUINT(MVT OpVT, MVT RetVT);
00237 
00238   /// getSINTTOFP - Return the SINTTOFP_*_* value for the given types, or
00239   /// UNKNOWN_LIBCALL if there is none.
00240   Libcall getSINTTOFP(MVT OpVT, MVT RetVT);
00241 
00242   /// getUINTTOFP - Return the UINTTOFP_*_* value for the given types, or
00243   /// UNKNOWN_LIBCALL if there is none.
00244   Libcall getUINTTOFP(MVT OpVT, MVT RetVT);
00245 }
00246 }
00247 
00248 #endif