qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 1/3] target/hexagon: move GETPC() calls to top level helpe


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v3 1/3] target/hexagon: move GETPC() calls to top level helpers
Date: Mon, 9 Oct 2023 08:10:15 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1

On 9/10/23 00:09, Brian Cain wrote:
From: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>

As docs/devel/loads-stores.rst states:

   ``GETPC()`` should be used with great care: calling
   it in other functions that are *not* the top level
   ``HELPER(foo)`` will cause unexpected behavior. Instead, the
   value of ``GETPC()`` should be read from the helper and passed
   if needed to the functions that the helper calls.

Let's fix the GETPC() usage in Hexagon, making sure it's always called
from top level helpers and passed down to the places where it's
needed. There are a few snippets where that is not currently the case:

- probe_store(), which is only called from two helpers, so it's easy to
   move GETPC() up.

- mem_load*() functions, which are also called directly from helpers,
   but through the MEM_LOAD*() set of macros. Note that this are only
   used when compiling with --disable-hexagon-idef-parser.

   In this case, we also take this opportunity to simplify the code,
   unifying the mem_load*() functions.

- HELPER(probe_hvx_stores), when called from another helper, ends up
   using its own GETPC() expansion instead of the top level caller.

Signed-off-by: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
Reviewed-by: Taylor Simpson <ltaylorsimpson@gmail.com>
Message-Id: 
<2c74c3696946edba7cc5b2942cf296a5af532052.1689070412.git.quic_mathbern@quicinc.com>-ne

Again suspicious '-ne' trailing.

Reviewed-by: Brian Cain <bcain@quicinc.com>
Signed-off-by: Brian Cain <bcain@quicinc.com>
---
  target/hexagon/macros.h    | 19 +++++-----
  target/hexagon/op_helper.c | 75 +++++++++++++++-----------------------
  target/hexagon/op_helper.h |  9 -----
  3 files changed, 38 insertions(+), 65 deletions(-)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]