Changed the C API to use templates to indicate memory alignment to the C compiler

This should help with performance of the generated code.
Updated the relevant header files (sse4.h, generic-16.h, generic-32.h, generic-64.h)

Updated generic-32.h and generic-64.h to the new memory API
This commit is contained in:
Jean-Luc Duprat
2012-06-28 09:29:15 -07:00
committed by Matt Pharr
parent d34a87404d
commit e431b07e04
5 changed files with 188 additions and 59 deletions

View File

@@ -3950,9 +3950,8 @@ void CWriter::writeMemoryAccess(llvm::Value *Operand, llvm::Type *OperandType,
void CWriter::visitLoadInst(llvm::LoadInst &I) {
llvm::VectorType *VT = llvm::dyn_cast<llvm::VectorType>(I.getType());
if (VT != NULL) {
Out << "__load(";
Out << "__load<" << I.getAlignment() << ">(";
writeOperand(I.getOperand(0));
Out << ", " << I.getAlignment();
Out << ")";
return;
}
@@ -3964,11 +3963,11 @@ void CWriter::visitLoadInst(llvm::LoadInst &I) {
void CWriter::visitStoreInst(llvm::StoreInst &I) {
llvm::VectorType *VT = llvm::dyn_cast<llvm::VectorType>(I.getOperand(0)->getType());
if (VT != NULL) {
Out << "__store(";
Out << "__store<" << I.getAlignment() << ">(";
writeOperand(I.getOperand(1));
Out << ", ";
writeOperand(I.getOperand(0));
Out << ", " << I.getAlignment() << ")";
Out << ")";
return;
}