pan/bi: Add "lane_dest" modifier

Similar to the "lane" modifier, but for the instruction destination
instead the sources.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10392>
This commit is contained in:
Icecream95 2021-01-03 21:53:05 +13:00 committed by Marge Bot
parent 5fe4f245a5
commit b361a806bb
3 changed files with 6 additions and 1 deletions

View File

@ -19,7 +19,7 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
SKIP = set(["lane", "lanes", "lanes", "replicate", "swz", "widen", "swap", "neg", "abs", "not", "sign", "extend", "divzero", "clamp", "sem", "not_result", "skip"])
SKIP = set(["lane", "lane_dest", "lanes", "lanes", "replicate", "swz", "widen", "swap", "neg", "abs", "not", "sign", "extend", "divzero", "clamp", "sem", "not_result", "skip"])
TEMPLATE = """
#ifndef _BI_BUILDER_H_

View File

@ -107,6 +107,9 @@ def pack_modifier(mod, width, default, opts, body, pack_exprs):
# Construct a list
lists = [pick_from_bucket(opts, bucket) for bucket in SWIZZLE_BUCKETS]
ir_value = "src[{}].swizzle".format(arg)
elif raw == "lane_dest":
lists = [pick_from_bucket(opts, bucket) for bucket in SWIZZLE_BUCKETS]
ir_value = "dest->swizzle"
elif raw in ["abs", "sign"]:
ir_value = "src[{}].abs".format(arg)
elif raw in ["neg", "not"]:

View File

@ -129,11 +129,13 @@ bi_${mod}_as_str(enum bi_${mod} ${mod})
<%def name="print_modifiers(mods, table)">
% for mod in mods:
% if mod not in ["lane_dest"]:
% if len(table[mod]) > 2:
fputs(bi_${mod}_as_str(I->${mod}), fp);
% else:
if (I->${mod}) fputs(".${mod}", fp);
% endif
% endif
% endfor
</%def>