1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +02:00

Renamed TypeCode_Single to TypeCode_Float. Float struct interop fixes.

This commit is contained in:
Brian Fiete 2020-07-03 13:54:45 -07:00
parent 14c3d0cd35
commit 2fe209447e
20 changed files with 595 additions and 69 deletions

View file

@ -420,7 +420,7 @@ BfTypeCode BfIRCodeGen::GetTypeCode(llvm::Type* type, bool isSigned)
}
if (type->isFloatingPointTy())
return BfTypeCode_Single;
return BfTypeCode_Float;
if (type->isDoubleTy())
return BfTypeCode_Double;
@ -509,10 +509,12 @@ llvm::Type* BfIRCodeGen::GetLLVMType(BfTypeCode typeCode, bool& isSigned)
return llvm::Type::getInt32Ty(*mLLVMContext);
else
return llvm::Type::getInt64Ty(*mLLVMContext);*/
case BfTypeCode_Single:
case BfTypeCode_Float:
return llvm::Type::getFloatTy(*mLLVMContext);
case BfTypeCode_Double:
return llvm::Type::getDoubleTy(*mLLVMContext);
case BfTypeCode_Float2:
return llvm::VectorType::get(llvm::Type::getFloatTy(*mLLVMContext), 2);
default: break;
}
return NULL;
@ -826,7 +828,7 @@ void BfIRCodeGen::Read(llvm::Value*& llvmValue, BfIRCodeGenEntry** codeGenEntry)
bool isSigned;
llvm::Type* llvmConstType = GetLLVMType(typeCode, isSigned);
if (typeCode == BfTypeCode_Single)
if (typeCode == BfTypeCode_Float)
{
float f;
mStream->Read(&f, sizeof(float));