int lengthOf(int simdWidth, const Type* type) { if ( type->isIntegerTy() ) { int size = type->getPrimitiveSizeInBits(); if (size == 1) // this is a bool return 0; else return simdWidth / (type->getPrimitiveSizeInBits() / 8); } else if ( type->isFloatTy() || type->isDoubleTy() ) return simdWidth / (type->getPrimitiveSizeInBits() / 8); else if (type->isVoidTy() ) return 0; // let other types decide int n = 0; LLVMTypes subTypes = getSubTypes(type); for (size_t i = 0; i < subTypes.size(); ++i) { const Type* attr = subTypes[i]; int tmp = vec::lengthOf(simdWidth, attr); if (tmp == -1) return -1; else if (n == 0) n = tmp; else if (tmp != 0 && tmp != n) return -1; } return n; }
int printSignatures(QString sType,QList<__SIGNATURE> *pList) { int nResult=getNumberOfScripts(pList); printf("Number of %s signatures: %d\n",sType.toAscii().data(),getNumberOfScripts(pList)); QMap<QString,int> mapSubtypes=getSubTypes(pList); QMapIterator<QString, int> i(mapSubtypes); while(i.hasNext()) { i.next(); printf("\tNumber of %s signatures: %d\n",i.key().toAscii().data(),i.value()); } return nResult; }