[Mesa-dev] [PATCH v2 7/8] i965: perf: add support for new equation operators

Kenneth Graunke kenneth at whitecape.org
Mon Mar 19 23:58:00 UTC 2018


On Wednesday, March 14, 2018 10:19:13 AM PDT Lionel Landwerlin wrote:
> Some equations of the CNL metrics started to use operators we haven't
> defined yet, just add those.
> 
> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
> ---
>  src/mesa/drivers/dri/i965/brw_oa.py | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_oa.py b/src/mesa/drivers/dri/i965/brw_oa.py
> index 7931c825f08..06995a6bf40 100644
> --- a/src/mesa/drivers/dri/i965/brw_oa.py
> +++ b/src/mesa/drivers/dri/i965/brw_oa.py
> @@ -125,6 +125,18 @@ def emit_umin(tmp_id, args):
>      c("uint64_t tmp{0} = MIN({1}, {2});".format(tmp_id, args[1], args[0]))
>      return tmp_id + 1
>  
> +def emit_lshft(tmp_id, args):
> +    c("uint64_t tmp{0} = {1} << {2};".format(tmp_id, args[1], args[0]))
> +    return tmp_id + 1
> +
> +def emit_rshft(tmp_id, args):
> +    c("uint64_t tmp{0} = {1} >> {2};".format(tmp_id, args[1], args[0]))
> +    return tmp_id + 1
> +
> +def emit_and(tmp_id, args):
> +    c("uint64_t tmp{0} = {1} & {2};".format(tmp_id, args[1], args[0]))
> +    return tmp_id + 1
> +
>  ops = {}
>  #             (n operands, emitter)
>  ops["FADD"] = (2, emit_fadd)
> @@ -138,6 +150,9 @@ ops["UDIV"] = (2, emit_udiv)
>  ops["UMUL"] = (2, emit_umul)
>  ops["USUB"] = (2, emit_usub)
>  ops["UMIN"] = (2, emit_umin)
> +ops["<<"]   = (2, emit_lshft)
> +ops[">>"]   = (2, emit_rshft)
> +ops["AND"]  = (2, emit_and)
>  
>  def brkt(subexp):
>      if " " in subexp:
> 

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180319/0f8fa779/attachment.sig>


More information about the mesa-dev mailing list