mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
The powers that be have decided that LLVM IR should now support 16-bit
"half precision" floating-point with a first-class type. This patch adds basic IR support (but not codegen support). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146786 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -266,6 +266,7 @@ static void WriteTypeTable(const ValueEnumerator &VE, BitstreamWriter &Stream) {
|
||||
switch (T->getTypeID()) {
|
||||
default: llvm_unreachable("Unknown type!");
|
||||
case Type::VoidTyID: Code = bitc::TYPE_CODE_VOID; break;
|
||||
case Type::HalfTyID: Code = bitc::TYPE_CODE_HALF; break;
|
||||
case Type::FloatTyID: Code = bitc::TYPE_CODE_FLOAT; break;
|
||||
case Type::DoubleTyID: Code = bitc::TYPE_CODE_DOUBLE; break;
|
||||
case Type::X86_FP80TyID: Code = bitc::TYPE_CODE_X86_FP80; break;
|
||||
@ -826,7 +827,7 @@ static void WriteConstants(unsigned FirstVal, unsigned LastVal,
|
||||
} else if (const ConstantFP *CFP = dyn_cast<ConstantFP>(C)) {
|
||||
Code = bitc::CST_CODE_FLOAT;
|
||||
Type *Ty = CFP->getType();
|
||||
if (Ty->isFloatTy() || Ty->isDoubleTy()) {
|
||||
if (Ty->isHalfTy() || Ty->isFloatTy() || Ty->isDoubleTy()) {
|
||||
Record.push_back(CFP->getValueAPF().bitcastToAPInt().getZExtValue());
|
||||
} else if (Ty->isX86_FP80Ty()) {
|
||||
// api needed to prevent premature destruction
|
||||
|
Reference in New Issue
Block a user