| 1 | //===---- Mips16HardFloatInfo.cpp for Mips16 Hard Float -----===// |
| 2 | // |
| 3 | // 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 |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | // This file contains the Mips16 implementation of Mips16HardFloatInfo |
| 10 | // namespace. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "Mips16HardFloatInfo.h" |
| 15 | #include <string.h> |
| 16 | |
| 17 | namespace llvm { |
| 18 | |
| 19 | namespace Mips16HardFloatInfo { |
| 20 | |
| 21 | const FuncNameSignature PredefinedFuncs[] = { |
| 22 | { .Name: "__floatdidf" , .Signature: { .ParamSig: NoSig, .RetSig: DRet } }, |
| 23 | { .Name: "__floatdisf" , .Signature: { .ParamSig: NoSig, .RetSig: FRet } }, |
| 24 | { .Name: "__floatundidf" , .Signature: { .ParamSig: NoSig, .RetSig: DRet } }, |
| 25 | { .Name: "__fixsfdi" , .Signature: { .ParamSig: FSig, .RetSig: NoFPRet } }, |
| 26 | { .Name: "__fixunsdfsi" , .Signature: { .ParamSig: DSig, .RetSig: NoFPRet } }, |
| 27 | { .Name: "__fixunsdfdi" , .Signature: { .ParamSig: DSig, .RetSig: NoFPRet } }, |
| 28 | { .Name: "__fixdfdi" , .Signature: { .ParamSig: DSig, .RetSig: NoFPRet } }, |
| 29 | { .Name: "__fixunssfsi" , .Signature: { .ParamSig: FSig, .RetSig: NoFPRet } }, |
| 30 | { .Name: "__fixunssfdi" , .Signature: { .ParamSig: FSig, .RetSig: NoFPRet } }, |
| 31 | { .Name: "__floatundisf" , .Signature: { .ParamSig: NoSig, .RetSig: FRet } }, |
| 32 | { .Name: nullptr, .Signature: { .ParamSig: NoSig, .RetSig: NoFPRet } } |
| 33 | }; |
| 34 | |
| 35 | // just do a search for now. there are very few of these special cases. |
| 36 | // |
| 37 | extern 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(s1: name, s2: name_) == 0) |
| 43 | return &PredefinedFuncs[i].Signature; |
| 44 | i++; |
| 45 | } |
| 46 | return nullptr; |
| 47 | } |
| 48 | } |
| 49 | } |
| 50 | |