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-27 16:59:26 -07:00
parent b6a8d0ee7f
commit f1b3703389
5 changed files with 184 additions and 57 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;
}