LLVM API Documentation

Mips16HardFloatInfo.cpp
Go to the documentation of this file.
00001 //===---- Mips16HardFloatInfo.cpp for Mips16 Hard Float              -----===//
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 contains the Mips16 implementation of Mips16HardFloatInfo
00011 // namespace.
00012 //
00013 //===----------------------------------------------------------------------===//
00014 
00015 #include "Mips16HardFloatInfo.h"
00016 #include <string.h>
00017 
00018 namespace llvm {
00019 
00020 namespace Mips16HardFloatInfo {
00021 
00022 const FuncNameSignature PredefinedFuncs[] = {
00023   { "__floatdidf", { NoSig, DRet } },
00024   { "__floatdisf", { NoSig, FRet } },
00025   { "__floatundidf", { NoSig, DRet } },
00026   { "__fixsfdi", { FSig, NoFPRet } },
00027   { "__fixunsdfsi", { DSig, NoFPRet } },
00028   { "__fixunsdfdi", { DSig, NoFPRet } },
00029   { "__fixdfdi", { DSig, NoFPRet } },
00030   { "__fixunssfsi", { FSig, NoFPRet } },
00031   { "__fixunssfdi", { FSig, NoFPRet } },
00032   { "__floatundisf", { NoSig, FRet } },
00033   { nullptr, { NoSig, NoFPRet } }
00034 };
00035 
00036 // just do a search for now. there are very few of these special cases.
00037 //
00038 extern FuncSignature const *findFuncSignature(const char *name) {
00039   const char *name_;
00040   int i = 0;
00041   while (PredefinedFuncs[i].Name) {
00042     name_ = PredefinedFuncs[i].Name;
00043     if (strcmp(name, name_) == 0)
00044       return &PredefinedFuncs[i].Signature;
00045     i++;
00046   }
00047   return nullptr;
00048 }
00049 }
00050 }