diff options
author | George Kyriazis <[email protected]> | 2018-03-14 12:29:04 -0500 |
---|---|---|
committer | George Kyriazis <[email protected]> | 2018-04-18 10:51:38 -0500 |
commit | 4c69823d150805c6f1d1ea212efa4e20558768bd (patch) | |
tree | d91c6ad81680b653ba8d8f860106869f3b05828f /src/gallium/drivers/swr | |
parent | c2163dc56a237d79e8aea3265e5aba0e603f677d (diff) |
swr/rast: WIP builder rewrite (2)
Finish up the remaining explicit intrinsic uses. At this point all
explicit Intrinsic::getDeclaration() usage has been replaced with auto
generated macros generated with gen_llvm_ir_macros.py. Going forward,
make sure to only use the intrinsics here, adding new ones as needed.
Next step is to remove all references to x86 intrinsics to keep the
builder target-independent. Any x86 lowering will be handled by a
separate pass.
Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr')
-rw-r--r-- | src/gallium/drivers/swr/rasterizer/codegen/gen_llvm_ir_macros.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/codegen/gen_llvm_ir_macros.py b/src/gallium/drivers/swr/rasterizer/codegen/gen_llvm_ir_macros.py index 9dfc1e75591..024558458a6 100644 --- a/src/gallium/drivers/swr/rasterizer/codegen/gen_llvm_ir_macros.py +++ b/src/gallium/drivers/swr/rasterizer/codegen/gen_llvm_ir_macros.py @@ -61,8 +61,9 @@ intrinsics = [ ['VPTESTZ', 'x86_avx_ptestz_256', ['a', 'b']], ['VFMADDPS', 'x86_fma_vfmadd_ps_256', ['a', 'b', 'c']], ['VMOVMSKPS', 'x86_avx_movmsk_ps_256', ['a']], - ['INTERRUPT', 'x86_int', ['a']], ['VPHADDD', 'x86_avx2_phadd_d', ['a', 'b']], + ['PDEP32', 'x86_bmi_pdep_32', ['a', 'b']], + ['RDTSC', 'x86_rdtsc', []], ] llvm_intrinsics = [ @@ -74,7 +75,11 @@ llvm_intrinsics = [ ['VMINPS', 'minnum', ['a', 'b'], ['a']], ['VMAXPS', 'maxnum', ['a', 'b'], ['a']], ['DEBUGTRAP', 'debugtrap', [], []], - ['POPCNT', 'ctpop', ['a'], ['a']] + ['POPCNT', 'ctpop', ['a'], ['a']], + ['LOG2', 'log2', ['a'], ['a']], + ['FABS', 'fabs', ['a'], ['a']], + ['EXP2', 'exp2', ['a'], ['a']], + ['POW', 'pow', ['a', 'b'], ['a', 'b']] ] this_dir = os.path.dirname(os.path.abspath(__file__)) @@ -225,10 +230,14 @@ def generate_x86_h(output_dir): functions = [] for inst in intrinsics: #print('Inst: %s, x86: %s numArgs: %d' % (inst[0], inst[1], len(inst[2]))) - declargs = 'Value* ' + ', Value* '.join(inst[2]) + if len(inst[2]) != 0: + declargs = 'Value* ' + ', Value* '.join(inst[2]) + decl = 'Value* %s(%s, const llvm::Twine& name = "")' % (inst[0], declargs) + else: + decl = 'Value* %s(const llvm::Twine& name = "")' % (inst[0]) functions.append({ - 'decl' : 'Value* %s(%s, const llvm::Twine& name = "")' % (inst[0], declargs), + 'decl' : decl, 'intrin' : inst[1], 'args' : inst[2], }) |