Commit 7c4fec605c488907ee3f88b68d15f3fa9a8d37d1
1 parent
32a4e672
fixed todo
Showing
1 changed file
with
2 additions
and
2 deletions
sdk/plugins/llvm.cpp
| ... | ... | @@ -140,7 +140,7 @@ struct MatrixBuilder : public jit_matrix |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | std::vector<Value*> mallocArgs; |
| 143 | - mallocArgs.push_back(elementsCode()); // TODO: FIX | |
| 143 | + mallocArgs.push_back(bytesCode()); | |
| 144 | 144 | setData(b->CreateCall(malloc, mallocArgs)); |
| 145 | 145 | } |
| 146 | 146 | |
| ... | ... | @@ -165,7 +165,7 @@ struct MatrixBuilder : public jit_matrix |
| 165 | 165 | Value *singleFrameCode() const { return get(SingleFrame); } |
| 166 | 166 | void setSingleFrameCode(bool singleFrame) const { setBit(singleFrame, SingleFrame); } |
| 167 | 167 | Value *elementsCode() const { return b->CreateMul(b->CreateMul(b->CreateMul(getChannels(), getColumns()), getRows()), getFrames()); } |
| 168 | - Value *bytesCode() const { return b->CreateMul(b->CreateUDiv(bitsCode(), constant(8, 16)), elementsCode()); } | |
| 168 | + Value *bytesCode() const { return b->CreateMul(b->CreateUDiv(b->CreateCast(Instruction::ZExt, bitsCode(), Type::getInt32Ty(getGlobalContext())), constant(8, 32)), elementsCode()); } | |
| 169 | 169 | |
| 170 | 170 | Value *columnStep() const { Value *columnStep = getChannels(); columnStep->setName(name+"_cStep"); return columnStep; } |
| 171 | 171 | Value *rowStep() const { return b->CreateMul(getColumns(), columnStep(), name+"_rStep"); } | ... | ... |