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_I16,
00049     SDIV_I32,
00050     SDIV_I64,
00051     SDIV_I128,
00052     UDIV_I16,
00053     UDIV_I32,
00054     UDIV_I64,
00055     UDIV_I128,
00056     SREM_I16,
00057     SREM_I32,
00058     SREM_I64,
00059     SREM_I128,
00060     UREM_I16,
00061     UREM_I32,
00062     UREM_I64,
00063     UREM_I128,
00064     NEG_I32,
00065     NEG_I64,
00066 
00067     // FLOATING POINT
00068     ADD_F32,
00069     ADD_F64,
00070     ADD_F80,
00071     ADD_PPCF128,
00072     SUB_F32,
00073     SUB_F64,
00074     SUB_F80,
00075     SUB_PPCF128,
00076     MUL_F32,
00077     MUL_F64,
00078     MUL_F80,
00079     MUL_PPCF128,
00080     DIV_F32,
00081     DIV_F64,
00082     DIV_F80,
00083     DIV_PPCF128,
00084     REM_F32,
00085     REM_F64,
00086     REM_F80,
00087     REM_PPCF128,
00088     POWI_F32,
00089     POWI_F64,
00090     POWI_F80,
00091     POWI_PPCF128,
00092     SQRT_F32,
00093     SQRT_F64,
00094     SQRT_F80,
00095     SQRT_PPCF128,
00096     LOG_F32,
00097     LOG_F64,
00098     LOG_F80,
00099     LOG_PPCF128,
00100     LOG2_F32,
00101     LOG2_F64,
00102     LOG2_F80,
00103     LOG2_PPCF128,
00104     LOG10_F32,
00105     LOG10_F64,
00106     LOG10_F80,
00107     LOG10_PPCF128,
00108     EXP_F32,
00109     EXP_F64,
00110     EXP_F80,
00111     EXP_PPCF128,
00112     EXP2_F32,
00113     EXP2_F64,
00114     EXP2_F80,
00115     EXP2_PPCF128,
00116     SIN_F32,
00117     SIN_F64,
00118     SIN_F80,
00119     SIN_PPCF128,
00120     COS_F32,
00121     COS_F64,
00122     COS_F80,
00123     COS_PPCF128,
00124     POW_F32,
00125     POW_F64,
00126     POW_F80,
00127     POW_PPCF128,
00128     CEIL_F32,
00129     CEIL_F64,
00130     CEIL_F80,
00131     CEIL_PPCF128,
00132     TRUNC_F32,
00133     TRUNC_F64,
00134     TRUNC_F80,
00135     TRUNC_PPCF128,
00136     RINT_F32,
00137     RINT_F64,
00138     RINT_F80,
00139     RINT_PPCF128,
00140     NEARBYINT_F32,
00141     NEARBYINT_F64,
00142     NEARBYINT_F80,
00143     NEARBYINT_PPCF128,
00144     FLOOR_F32,
00145     FLOOR_F64,
00146     FLOOR_F80,
00147     FLOOR_PPCF128,
00148 
00149     // CONVERSION
00150     FPEXT_F32_F64,
00151     FPROUND_F64_F32,
00152     FPROUND_F80_F32,
00153     FPROUND_PPCF128_F32,
00154     FPROUND_F80_F64,
00155     FPROUND_PPCF128_F64,
00156     FPTOSINT_F32_I8,
00157     FPTOSINT_F32_I16,
00158     FPTOSINT_F32_I32,
00159     FPTOSINT_F32_I64,
00160     FPTOSINT_F32_I128,
00161     FPTOSINT_F64_I32,
00162     FPTOSINT_F64_I64,
00163     FPTOSINT_F64_I128,
00164     FPTOSINT_F80_I32,
00165     FPTOSINT_F80_I64,
00166     FPTOSINT_F80_I128,
00167     FPTOSINT_PPCF128_I32,
00168     FPTOSINT_PPCF128_I64,
00169     FPTOSINT_PPCF128_I128,
00170     FPTOUINT_F32_I8,
00171     FPTOUINT_F32_I16,
00172     FPTOUINT_F32_I32,
00173     FPTOUINT_F32_I64,
00174     FPTOUINT_F32_I128,
00175     FPTOUINT_F64_I32,
00176     FPTOUINT_F64_I64,
00177     FPTOUINT_F64_I128,
00178     FPTOUINT_F80_I32,
00179     FPTOUINT_F80_I64,
00180     FPTOUINT_F80_I128,
00181     FPTOUINT_PPCF128_I32,
00182     FPTOUINT_PPCF128_I64,
00183     FPTOUINT_PPCF128_I128,
00184     SINTTOFP_I32_F32,
00185     SINTTOFP_I32_F64,
00186     SINTTOFP_I32_F80,
00187     SINTTOFP_I32_PPCF128,
00188     SINTTOFP_I64_F32,
00189     SINTTOFP_I64_F64,
00190     SINTTOFP_I64_F80,
00191     SINTTOFP_I64_PPCF128,
00192     SINTTOFP_I128_F32,
00193     SINTTOFP_I128_F64,
00194     SINTTOFP_I128_F80,
00195     SINTTOFP_I128_PPCF128,
00196     UINTTOFP_I32_F32,
00197     UINTTOFP_I32_F64,
00198     UINTTOFP_I32_F80,
00199     UINTTOFP_I32_PPCF128,
00200     UINTTOFP_I64_F32,
00201     UINTTOFP_I64_F64,
00202     UINTTOFP_I64_F80,
00203     UINTTOFP_I64_PPCF128,
00204     UINTTOFP_I128_F32,
00205     UINTTOFP_I128_F64,
00206     UINTTOFP_I128_F80,
00207     UINTTOFP_I128_PPCF128,
00208 
00209     // COMPARISON
00210     OEQ_F32,
00211     OEQ_F64,
00212     UNE_F32,
00213     UNE_F64,
00214     OGE_F32,
00215     OGE_F64,
00216     OLT_F32,
00217     OLT_F64,
00218     OLE_F32,
00219     OLE_F64,
00220     OGT_F32,
00221     OGT_F64,
00222     UO_F32,
00223     UO_F64,
00224     O_F32,
00225     O_F64,
00226 
00227     // MEMORY
00228     MEMCPY,
00229     MEMSET,
00230     MEMMOVE,
00231 
00232     // EXCEPTION HANDLING
00233     UNWIND_RESUME,
00234 
00235     UNKNOWN_LIBCALL
00236   };
00237 
00238   /// getFPEXT - Return the FPEXT_*_* value for the given types, or
00239   /// UNKNOWN_LIBCALL if there is none.
00240   Libcall getFPEXT(EVT OpVT, EVT RetVT);
00241 
00242   /// getFPROUND - Return the FPROUND_*_* value for the given types, or
00243   /// UNKNOWN_LIBCALL if there is none.
00244   Libcall getFPROUND(EVT OpVT, EVT RetVT);
00245 
00246   /// getFPTOSINT - Return the FPTOSINT_*_* value for the given types, or
00247   /// UNKNOWN_LIBCALL if there is none.
00248   Libcall getFPTOSINT(EVT OpVT, EVT RetVT);
00249 
00250   /// getFPTOUINT - Return the FPTOUINT_*_* value for the given types, or
00251   /// UNKNOWN_LIBCALL if there is none.
00252   Libcall getFPTOUINT(EVT OpVT, EVT RetVT);
00253 
00254   /// getSINTTOFP - Return the SINTTOFP_*_* value for the given types, or
00255   /// UNKNOWN_LIBCALL if there is none.
00256   Libcall getSINTTOFP(EVT OpVT, EVT RetVT);
00257 
00258   /// getUINTTOFP - Return the UINTTOFP_*_* value for the given types, or
00259   /// UNKNOWN_LIBCALL if there is none.
00260   Libcall getUINTTOFP(EVT OpVT, EVT RetVT);
00261 }
00262 }
00263 
00264 #endif