Skip to content
Snippets Groups Projects
  1. Nov 28, 2023
  2. Nov 07, 2023
  3. Oct 18, 2023
    • Brian Cain's avatar
      target/hexagon: fix some occurrences of -Wshadow=local · 20c34a92
      Brian Cain authored
      
      Of the changes in this commit, the changes in `HELPER(commit_hvx_stores)()`
      are less obvious.  They are required because of some macro invocations like
      SCATTER_OP_WRITE_TO_MEM().
      
      e.g.:
      
          In file included from ../target/hexagon/op_helper.c:31:
          ../target/hexagon/mmvec/macros.h:205:18: error: declaration of ‘i’ shadows a previous local [-Werror=shadow=compatible-local]
            205 |         for (int i = 0; i < sizeof(MMVector); i += sizeof(TYPE)) { \
                |                  ^
          ../target/hexagon/op_helper.c:157:17: note: in expansion of macro ‘SCATTER_OP_WRITE_TO_MEM’
            157 |                 SCATTER_OP_WRITE_TO_MEM(uint16_t);
                |                 ^~~~~~~~~~~~~~~~~~~~~~~
          ../target/hexagon/op_helper.c:135:9: note: shadowed declaration is here
            135 |     int i;
                |         ^
          In file included from ../target/hexagon/op_helper.c:31:
          ../target/hexagon/mmvec/macros.h:204:19: error: declaration of ‘ra’ shadows a previous local [-Werror=shadow=compatible-local]
            204 |         uintptr_t ra = GETPC(); \
                |                   ^~
          ../target/hexagon/op_helper.c:160:17: note: in expansion of macro ‘SCATTER_OP_WRITE_TO_MEM’
            160 |                 SCATTER_OP_WRITE_TO_MEM(uint32_t);
                |                 ^~~~~~~~~~~~~~~~~~~~~~~
          ../target/hexagon/op_helper.c:134:15: note: shadowed declaration is here
            134 |     uintptr_t ra = GETPC();
                |               ^~
      
      Reviewed-by: default avatarMatheus Tavares Bernardino <quic_mathbern@quicinc.com>
      Signed-off-by: default avatarBrian Cain <bcain@quicinc.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      Message-Id: <20231008220945.983643-3-bcain@quicinc.com>
      20c34a92
    • Matheus Tavares Bernardino's avatar
      target/hexagon: move GETPC() calls to top level helpers · 3bd83593
      Matheus Tavares Bernardino authored
      
      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: default avatarMatheus Tavares Bernardino <quic_mathbern@quicinc.com>
      Reviewed-by: default avatarTaylor Simpson <ltaylorsimpson@gmail.com>
      Message-Id: <2c74c3696946edba7cc5b2942cf296a5af532052.1689070412.git.quic_mathbern@quicinc.com>-ne
      Reviewed-by: default avatarBrian Cain <bcain@quicinc.com>
      Signed-off-by: default avatarBrian Cain <bcain@quicinc.com>
      Message-Id: <20231008220945.983643-2-bcain@quicinc.com>
      3bd83593
  4. Oct 17, 2023
  5. Oct 04, 2023
  6. Oct 03, 2023
  7. Sep 08, 2023
  8. Aug 31, 2023
  9. Jun 26, 2023
  10. Jun 05, 2023
  11. May 26, 2023
  12. May 18, 2023
Loading