Commit a8f9863d by Nicolas Capens

Implement support for arrays.

Bug swiftshader:6 Change-Id: I9ffcca588014466acb7f13a3df551a696ada8a91 Reviewed-on: https://swiftshader-review.googlesource.com/7755Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com> Reviewed-on: https://swiftshader-review.googlesource.com/8136Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent 7f3f69cb
......@@ -446,14 +446,13 @@ namespace sw
Value *Nucleus::allocateStackVariable(Type *t, int arraySize)
{
assert(arraySize == 0 && "UNIMPLEMENTED");
Ice::Type type = T(t);
int size = Ice::typeWidthInBytes(type);
int typeSize = Ice::typeWidthInBytes(type);
int totalSize = typeSize * (arraySize ? arraySize : 1);
auto bytes = Ice::ConstantInteger32::create(::context, type, size);
auto bytes = Ice::ConstantInteger32::create(::context, type, totalSize);
auto address = ::function->makeVariable(T(getPointerType(t)));
auto alloca = Ice::InstAlloca::create(::function, address, bytes, size);
auto alloca = Ice::InstAlloca::create(::function, address, bytes, typeSize);
::function->getEntryNode()->getInsts().push_front(alloca);
return V(address);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment