OSDN Git Service

gallivm: work around slow code generated for interleaving 128bit vectors
authorRoland Scheidegger <sroland@vmware.com>
Fri, 7 Jun 2013 19:20:01 +0000 (21:20 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Sat, 8 Jun 2013 15:33:51 +0000 (17:33 +0200)
commit213c207b3ac40ae769afe01b8578f566b5e7840d
treea2c21acecead6f1e470a04f3afe73260fcb56d68
parent0aca2c6b608b80661cb8fd35eb08195ab95743f5
gallivm: work around slow code generated for interleaving 128bit vectors

We use 128bit vector interleave for untwiddling in the blend code (with
256bit vectors). llvm generates terrible code for this for some reason,
so instead of generating a shuffle for 2 128bit vectors use a
extract/insert shuffle instead (it only seems to matter we're not using
128bit wide vectors for the shuffle). This decreases instruction count of
the blend code generated for a rgba8 render target without blending from
169 to 113 with llvm 3.1 and from 136 to 114 in llvm 3.2/3.3, and I got
a ~8% (llvm 3.1) and ~5% (3.2/3.3) performance improvement in gears.
(The generated code is still not terribly good as we could actually avoid
the interleaving completely but llvm can't know this.)

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_pack.c