mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-03 08:30:47 +03:00
Zero out padding of fp80.
This commit is contained in:
parent
8362b86c5a
commit
b2efd0d317
1 changed files with 11 additions and 0 deletions
|
@ -91,11 +91,22 @@ void DtoDeleteArray(DValue* arr)
|
||||||
|
|
||||||
llvm::AllocaInst* DtoAlloca(const LLType* lltype, const std::string& name)
|
llvm::AllocaInst* DtoAlloca(const LLType* lltype, const std::string& name)
|
||||||
{
|
{
|
||||||
|
if(lltype == LLType::X86_FP80Ty)
|
||||||
|
{
|
||||||
|
llvm::AllocaInst* alloca = new llvm::AllocaInst(lltype, name, gIR->topallocapoint());
|
||||||
|
LLValue* castv = new llvm::BitCastInst(alloca, getPtrToType(LLType::Int16Ty), "fp80toi16", gIR->scopebb());
|
||||||
|
LLValue* padding = DtoGEPi1(castv, 5, "fp80padding");
|
||||||
|
new llvm::StoreInst(llvm::Constant::getNullValue(LLType::Int16Ty), padding, gIR->scopebb());
|
||||||
|
|
||||||
|
return alloca;
|
||||||
|
}
|
||||||
|
|
||||||
return new llvm::AllocaInst(lltype, name, gIR->topallocapoint());
|
return new llvm::AllocaInst(lltype, name, gIR->topallocapoint());
|
||||||
}
|
}
|
||||||
|
|
||||||
llvm::AllocaInst* DtoAlloca(const LLType* lltype, LLValue* arraysize, const std::string& name)
|
llvm::AllocaInst* DtoAlloca(const LLType* lltype, LLValue* arraysize, const std::string& name)
|
||||||
{
|
{
|
||||||
|
assert(lltype != LLType::X86_FP80Ty && "Zero-init of fp80 padding for array allocas not yet implemented");
|
||||||
return new llvm::AllocaInst(lltype, arraysize, name, gIR->topallocapoint());
|
return new llvm::AllocaInst(lltype, arraysize, name, gIR->topallocapoint());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue