blob: 8a02e8156175643f3395f55473b354f57a4bb606 [file] [log] [blame]
Reed Kotler4cdaa7d2014-02-14 19:16:39 +00001//===---- Mips16HardFloatInfo.cpp for Mips16 Hard Float -----===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Reed Kotler4cdaa7d2014-02-14 19:16:39 +00006//
7//===----------------------------------------------------------------------===//
8//
9// This file contains the Mips16 implementation of Mips16HardFloatInfo
10// namespace.
11//
12//===----------------------------------------------------------------------===//
13
Reed Kotler4cdaa7d2014-02-14 19:16:39 +000014#include "Mips16HardFloatInfo.h"
Chandler Carruth442f7842014-03-04 10:07:28 +000015#include <string.h>
Reed Kotler4cdaa7d2014-02-14 19:16:39 +000016
17namespace llvm {
18
19namespace Mips16HardFloatInfo {
20
21const FuncNameSignature PredefinedFuncs[] = {
22 { "__floatdidf", { NoSig, DRet } },
23 { "__floatdisf", { NoSig, FRet } },
24 { "__floatundidf", { NoSig, DRet } },
25 { "__fixsfdi", { FSig, NoFPRet } },
26 { "__fixunsdfsi", { DSig, NoFPRet } },
27 { "__fixunsdfdi", { DSig, NoFPRet } },
28 { "__fixdfdi", { DSig, NoFPRet } },
29 { "__fixunssfsi", { FSig, NoFPRet } },
30 { "__fixunssfdi", { FSig, NoFPRet } },
31 { "__floatundisf", { NoSig, FRet } },
Craig Topper062a2ba2014-04-25 05:30:21 +000032 { nullptr, { NoSig, NoFPRet } }
Reed Kotler4cdaa7d2014-02-14 19:16:39 +000033};
34
35// just do a search for now. there are very few of these special cases.
36//
37extern FuncSignature const *findFuncSignature(const char *name) {
38 const char *name_;
39 int i = 0;
40 while (PredefinedFuncs[i].Name) {
41 name_ = PredefinedFuncs[i].Name;
42 if (strcmp(name, name_) == 0)
43 return &PredefinedFuncs[i].Signature;
44 i++;
45 }
Craig Topper062a2ba2014-04-25 05:30:21 +000046 return nullptr;
Reed Kotler4cdaa7d2014-02-14 19:16:39 +000047}
Alexander Kornienkof00654e2015-06-23 09:49:53 +000048}
49}