I'm facing the below error when trying to use PackUnsigned with Short8 - PLEASE HELP

24 views
Skip to first unread message

podeti vishal

unread,
Feb 1, 2021, 1:51:36 AMFeb 1
to swiftshader
PackUnsigned for Short8 Reactor Types

Hi All,
I'm facing the below error when trying to use PackUnsigned with Short8

swiftshader/third_party/llvm-10.0/llvm/lib/IR/Instructions.cpp:400:
void llvm::CallInst::init(llvm::FunctionType*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >, const llvm::Twine&):
 Assertion `(i >= FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType()) && "Calling a function with a bad signature!"' failed.
 
The underlying function which PackUnsigned is calling (packuswb_avx2) is as below :

RValue<Byte16> packuswb_avx2(RValue<Short8> x, RValue<Short8> y)
{
        llvm::Function *packuswb = llvm::Intrinsic::getDeclaration(jit->module.get(), llvm::Intrinsic::x86_avx2_packuswb);
        //RValue<Short8> dest = Short8();
        //Value* v =  V(jit->builder->CreateCall3(packuswb, ARGS(V(dest.value), V(x.value), V(y.value))));
        return As<Byte16>(V(jit->builder->CreateCall2(packuswb, ARGS(V(x.value), V(y.value)))));
}

        current.z = As<Short8>(PackUnsigned(current.x, current.z));
        current.y = As<Short8>(PackUnsigned(current.y, current.y));

Can anyone please help ?

Alexis Hétu

unread,
Feb 1, 2021, 8:53:46 AMFeb 1
to podeti vishal, swiftshader

--
You received this message because you are subscribed to the Google Groups "swiftshader" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swiftshader...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/swiftshader/4c833298-c9de-4c33-bbb3-e9de2052b745n%40googlegroups.com.

podeti vishal

unread,
Feb 1, 2021, 11:52:33 PMFeb 1
to swiftshader
Thanks alexis for the reply. 
My host machine supports avx2. 
I checked it with cat /proc/cpuinfo | grep avx2

podeti vishal

unread,
Feb 6, 2021, 1:35:13 AMFeb 6
to swiftshader
The error was due to type mismatch of data types when using the x86_avx2_packuswb. 
This instruction (https://www.felixcloutier.com/x86/packuswb) expects v16_i16 as input types. 
Calling this intrinsic with Short8 Reactor Type whose type is v8_i16 caused the 'calling function with bad signature' 
error.  

Thanks :) 
Reply all
Reply to author
Forward
0 new messages