Hello Pedro,<br><br>As others have said we're assuming that you're using Clang as the frontend, the MSP430TargetInfo class inside lib/Basic/Targets.cpp (clang codebase) set ints to be 16 bits wide, so you should get 16bit mults straight away without promotion. But anyways for 8bit multiplicantions you can do the following to bypass argument promotion:<br>
<br>1) go to the lib/CodeGen/TargetInfo.cpp (clang codebase)<br><br>2) implement a MSP430ABIInfo class derived from ABIInfo, check how other targets do it in the same file. The important part here is how you implement the classifyReturnType and classifyArgumentType functions, they should basically look like this:<br>
<br>class MSP430ABIInfo : public ABIInfo<br>{<br>public:<br>  MSP430ABIInfo (CodeGenTypes &CGT) : ABIInfo(CGT) {}<br><br>  ABIArgInfo classifyReturnType(QualType RetTy) const;<br>  ABIArgInfo classifyArgumentType(QualType RetTy) const;<br>
<br>  virtual void computeInfo(CGFunctionInfo &FI) const {<br>    FI.getReturnInfo() = classifyReturnType(FI.getReturnType());<br>    for (CGFunctionInfo::arg_iterator it = FI.arg_begin(), ie = FI.arg_end();<br>         it != ie; ++it)<br>
      it->info = classifyArgumentType(it->type);<br>  }<br><br>  virtual llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,<br>                                 CodeGenFunction &CGF) const { return 0; }<br>
};<br><br>ABIArgInfo MSP430ABIInfo::classifyReturnType(QualType RetTy) const {<br>  if (RetTy->isVoidType())<br>    return ABIArgInfo::getIgnore();<br>  if (isAggregateTypeForABI(RetTy))<br>    return ABIArgInfo::getIndirect(0);<br>
<br>  return ABIArgInfo::getDirect();<br>}<br><br>ABIArgInfo MSP430ABIInfo::classifyArgumentType(QualType Ty) const {<br>  if (isAggregateTypeForABI(Ty))<br>    return ABIArgInfo::getIndirect(0);<br><br>  return ABIArgInfo::getDirect();<br>
}<br><br>3) Register your new MSP430ABIInfo class in the TargetCodeGenInfo constructor inside MSP430TargetCodeGenInfo by replacing DefaultABIInfo.<br><br>Hope this helps.<br><br><br>