blob: 2eb6e5ddd2d96ba3aa3954476cf9b338c5d2c5e3 [file] [log] [blame]
Reed Kotler4cdaa7d2014-02-14 19:16:39 +00001//===---- Mips16HardFloatInfo.cpp for Mips16 Hard Float -----===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file contains the Mips16 implementation of Mips16HardFloatInfo
11// namespace.
12//
13//===----------------------------------------------------------------------===//
14
Reed Kotler4cdaa7d2014-02-14 19:16:39 +000015#include "Mips16HardFloatInfo.h"
Chandler Carruth442f7842014-03-04 10:07:28 +000016#include <string.h>
Reed Kotler4cdaa7d2014-02-14 19:16:39 +000017
18namespace llvm {
19
20namespace Mips16HardFloatInfo {
21
22const FuncNameSignature PredefinedFuncs[] = {
23 { "__floatdidf", { NoSig, DRet } },
24 { "__floatdisf", { NoSig, FRet } },
25 { "__floatundidf", { NoSig, DRet } },
26 { "__fixsfdi", { FSig, NoFPRet } },
27 { "__fixunsdfsi", { DSig, NoFPRet } },
28 { "__fixunsdfdi", { DSig, NoFPRet } },
29 { "__fixdfdi", { DSig, NoFPRet } },
30 { "__fixunssfsi", { FSig, NoFPRet } },
31 { "__fixunssfdi", { FSig, NoFPRet } },
32 { "__floatundisf", { NoSig, FRet } },
Craig Topper062a2ba2014-04-25 05:30:21 +000033 { nullptr, { NoSig, NoFPRet } }
Reed Kotler4cdaa7d2014-02-14 19:16:39 +000034};
35
36// just do a search for now. there are very few of these special cases.
37//
38extern FuncSignature const *findFuncSignature(const char *name) {
39 const char *name_;
40 int i = 0;
41 while (PredefinedFuncs[i].Name) {
42 name_ = PredefinedFuncs[i].Name;
43 if (strcmp(name, name_) == 0)
44 return &PredefinedFuncs[i].Signature;
45 i++;
46 }
Craig Topper062a2ba2014-04-25 05:30:21 +000047 return nullptr;
Reed Kotler4cdaa7d2014-02-14 19:16:39 +000048}
Alexander Kornienkof00654e2015-06-23 09:49:53 +000049}
50}