Commit 3140e714 authored by George Kyriazis's avatar George Kyriazis

swr/rast: x86 autogenerated macro work

Add name argument to x86 autogenerated macros.
Add useful variable names for DCL_inputVec implementation.
Reviewed-by: Bruce Cherniak's avatarBruce Cherniak <bruce.cherniak@intel.com>
parent 4cd6e2eb
......@@ -223,7 +223,7 @@ def generate_x86_h(output_dir):
declargs = 'Value* ' + ', Value* '.join(inst[2])
functions.append({
'decl' : 'Value* %s(%s)' % (inst[0], declargs),
'decl' : 'Value* %s(%s, const llvm::Twine& name = "")' % (inst[0], declargs),
'args' : ', '.join(inst[2]),
'intrin' : inst[1],
})
......
......@@ -41,7 +41,7 @@ ${func['decl']}
{
%if isX86:
Function *pFunc = Intrinsic::getDeclaration(JM()->mpCurrentModule, Intrinsic::${func['intrin']});
return CALL(pFunc, std::initializer_list<Value*>{${func['args']}});
return CALL(pFunc, std::initializer_list<Value*>{${func['args']}}, name);
%else:
return IRB()->${func['intrin']}(${func['args']});
%endif
......
......@@ -267,7 +267,7 @@ namespace SwrJit
return UndefValue::get(VectorType::get(ty, size));
}
Value *Builder::VBROADCAST(Value *src)
Value *Builder::VBROADCAST(Value *src, const llvm::Twine& name)
{
// check if src is already a vector
if (src->getType()->isVectorTy())
......@@ -275,7 +275,7 @@ namespace SwrJit
return src;
}
return VECTOR_SPLAT(mVWidth, src);
return VECTOR_SPLAT(mVWidth, src, name);
}
Value *Builder::VBROADCAST_16(Value *src)
......@@ -367,12 +367,12 @@ namespace SwrJit
return STORE(val, GEPA(basePtr, valIndices));
}
CallInst *Builder::CALL(Value *Callee, const std::initializer_list<Value*> &argsList)
CallInst *Builder::CALL(Value *Callee, const std::initializer_list<Value*> &argsList, const llvm::Twine& name)
{
std::vector<Value*> args;
for (auto arg : argsList)
args.push_back(arg);
return CALLA(Callee, args);
return CALLA(Callee, args, name);
}
CallInst *Builder::CALL(Value *Callee, Value* arg)
......@@ -406,9 +406,9 @@ namespace SwrJit
return CALL(func);
}
Value *Builder::VRCP(Value *va)
Value *Builder::VRCP(Value *va, const llvm::Twine& name)
{
return FDIV(VIMMED1(1.0f), va); // 1 / a
return FDIV(VIMMED1(1.0f), va, name); // 1 / a
}
Value *Builder::VPLANEPS(Value* vA, Value* vB, Value* vC, Value* &vX, Value* &vY)
......@@ -990,11 +990,11 @@ namespace SwrJit
/// @brief Generate a VCVTPH2PS operation (float16->float32 conversion)
/// in LLVM IR. If not supported on the underlying platform, emulate it
/// @param a - 128bit SIMD lane(8x16bit) of float16 in int16 format.
Value *Builder::CVTPH2PS(Value* a)
Value *Builder::CVTPH2PS(Value* a, const llvm::Twine& name)
{
if (JM()->mArch.F16C())
{
return VCVTPH2PS(a);
return VCVTPH2PS(a, name);
}
else
{
......@@ -1014,6 +1014,7 @@ namespace SwrJit
pResult = VINSERT(pResult, pConv, C(i));
}
pResult->setName(name);
return pResult;
}
}
......
......@@ -81,10 +81,10 @@ Value *VUNDEF(Type* ty, uint32_t size);
Value *VUNDEF_IPTR();
Value *VBROADCAST(Value *src);
Value *VBROADCAST(Value *src, const llvm::Twine& name = "");
Value *VBROADCAST_16(Value *src);
Value *VRCP(Value *va);
Value *VRCP(Value *va, const llvm::Twine& name = "");
Value *VPLANEPS(Value* vA, Value* vB, Value* vC, Value* &vX, Value* &vY);
uint32_t IMMED(Value* i);
......@@ -95,7 +95,7 @@ Value *GEP(Value* ptr, const std::initializer_list<uint32_t> &indexList);
Value *IN_BOUNDS_GEP(Value* ptr, const std::initializer_list<Value*> &indexList);
Value *IN_BOUNDS_GEP(Value* ptr, const std::initializer_list<uint32_t> &indexList);
CallInst *CALL(Value *Callee, const std::initializer_list<Value*> &args);
CallInst *CALL(Value *Callee, const std::initializer_list<Value*> &args, const llvm::Twine& name = "");
CallInst *CALL(Value *Callee) { return CALLA(Callee); }
CallInst *CALL(Value *Callee, Value* arg);
CallInst *CALL2(Value *Callee, Value* arg1, Value* arg2);
......@@ -158,7 +158,7 @@ Value *PMOVSXBD(Value* a);
Value *PMOVSXWD(Value* a);
Value *PERMD(Value* a, Value* idx);
Value *PERMPS(Value* a, Value* idx);
Value *CVTPH2PS(Value* a);
Value *CVTPH2PS(Value* a, const llvm::Twine& name = "");
Value *CVTPS2PH(Value* a, Value* rounding);
Value *PMAXSD(Value* a, Value* b);
Value *PMINSD(Value* a, Value* b);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment