xref: /minix3/external/bsd/llvm/dist/llvm/lib/Target/Mips/Mips16HardFloatInfo.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc //===---- Mips16HardFloatInfo.cpp for Mips16 Hard Float              -----===//
2*0a6a1f1dSLionel Sambuc //
3*0a6a1f1dSLionel Sambuc //                     The LLVM Compiler Infrastructure
4*0a6a1f1dSLionel Sambuc //
5*0a6a1f1dSLionel Sambuc // This file is distributed under the University of Illinois Open Source
6*0a6a1f1dSLionel Sambuc // License. See LICENSE.TXT for details.
7*0a6a1f1dSLionel Sambuc //
8*0a6a1f1dSLionel Sambuc //===----------------------------------------------------------------------===//
9*0a6a1f1dSLionel Sambuc //
10*0a6a1f1dSLionel Sambuc // This file contains the Mips16 implementation of Mips16HardFloatInfo
11*0a6a1f1dSLionel Sambuc // namespace.
12*0a6a1f1dSLionel Sambuc //
13*0a6a1f1dSLionel Sambuc //===----------------------------------------------------------------------===//
14*0a6a1f1dSLionel Sambuc 
15*0a6a1f1dSLionel Sambuc #include "Mips16HardFloatInfo.h"
16*0a6a1f1dSLionel Sambuc #include <string.h>
17*0a6a1f1dSLionel Sambuc 
18*0a6a1f1dSLionel Sambuc namespace llvm {
19*0a6a1f1dSLionel Sambuc 
20*0a6a1f1dSLionel Sambuc namespace Mips16HardFloatInfo {
21*0a6a1f1dSLionel Sambuc 
22*0a6a1f1dSLionel Sambuc const FuncNameSignature PredefinedFuncs[] = {
23*0a6a1f1dSLionel Sambuc   { "__floatdidf", { NoSig, DRet } },
24*0a6a1f1dSLionel Sambuc   { "__floatdisf", { NoSig, FRet } },
25*0a6a1f1dSLionel Sambuc   { "__floatundidf", { NoSig, DRet } },
26*0a6a1f1dSLionel Sambuc   { "__fixsfdi", { FSig, NoFPRet } },
27*0a6a1f1dSLionel Sambuc   { "__fixunsdfsi", { DSig, NoFPRet } },
28*0a6a1f1dSLionel Sambuc   { "__fixunsdfdi", { DSig, NoFPRet } },
29*0a6a1f1dSLionel Sambuc   { "__fixdfdi", { DSig, NoFPRet } },
30*0a6a1f1dSLionel Sambuc   { "__fixunssfsi", { FSig, NoFPRet } },
31*0a6a1f1dSLionel Sambuc   { "__fixunssfdi", { FSig, NoFPRet } },
32*0a6a1f1dSLionel Sambuc   { "__floatundisf", { NoSig, FRet } },
33*0a6a1f1dSLionel Sambuc   { nullptr, { NoSig, NoFPRet } }
34*0a6a1f1dSLionel Sambuc };
35*0a6a1f1dSLionel Sambuc 
36*0a6a1f1dSLionel Sambuc // just do a search for now. there are very few of these special cases.
37*0a6a1f1dSLionel Sambuc //
findFuncSignature(const char * name)38*0a6a1f1dSLionel Sambuc extern FuncSignature const *findFuncSignature(const char *name) {
39*0a6a1f1dSLionel Sambuc   const char *name_;
40*0a6a1f1dSLionel Sambuc   int i = 0;
41*0a6a1f1dSLionel Sambuc   while (PredefinedFuncs[i].Name) {
42*0a6a1f1dSLionel Sambuc     name_ = PredefinedFuncs[i].Name;
43*0a6a1f1dSLionel Sambuc     if (strcmp(name, name_) == 0)
44*0a6a1f1dSLionel Sambuc       return &PredefinedFuncs[i].Signature;
45*0a6a1f1dSLionel Sambuc     i++;
46*0a6a1f1dSLionel Sambuc   }
47*0a6a1f1dSLionel Sambuc   return nullptr;
48*0a6a1f1dSLionel Sambuc }
49*0a6a1f1dSLionel Sambuc }
50*0a6a1f1dSLionel Sambuc }
51