qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: <ltaylorsimpson@gmail.com>
To: "'Brian Cain'" <brian.cain@oss.qualcomm.com>, <qemu-devel@nongnu.org>
Cc: <richard.henderson@linaro.org>, <philmd@linaro.org>,
	<quic_mathbern@quicinc.com>, <ale@rev.ng>, <anjo@rev.ng>,
	<quic_mliebel@quicinc.com>, <alex.bennee@linaro.org>,
	<quic_mburton@quicinc.com>, <sidneym@quicinc.com>,
	"'Brian Cain'" <bcain@quicinc.com>
Subject: RE: [PATCH 21/38] target/hexagon: Add system reg insns
Date: Fri, 7 Mar 2025 19:32:53 -0600	[thread overview]
Message-ID: <030601db8fca$04123730$0c36a590$@gmail.com> (raw)
In-Reply-To: <20250301052628.1011210-22-brian.cain@oss.qualcomm.com>



> -----Original Message-----
> From: Brian Cain <brian.cain@oss.qualcomm.com>
> Sent: Friday, February 28, 2025 11:26 PM
> To: qemu-devel@nongnu.org
> Cc: brian.cain@oss.qualcomm.com; richard.henderson@linaro.org;
> philmd@linaro.org; quic_mathbern@quicinc.com; ale@rev.ng; anjo@rev.ng;
> quic_mliebel@quicinc.com; ltaylorsimpson@gmail.com;
> alex.bennee@linaro.org; quic_mburton@quicinc.com;
> sidneym@quicinc.com; Brian Cain <bcain@quicinc.com>
> Subject: [PATCH 21/38] target/hexagon: Add system reg insns
> 
> From: Brian Cain <bcain@quicinc.com>
> 
> Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
> ---
>  target/hexagon/macros.h               |   2 +
>  target/hexagon/hex_common.py          |  15 +-
>  target/hexagon/imported/encode_pp.def | 213 +++++++++++++++------
>  target/hexagon/imported/system.idef   | 262
> +++++++++++++++++++++++---
>  4 files changed, 410 insertions(+), 82 deletions(-)
> 
> diff --git a/target/hexagon/macros.h b/target/hexagon/macros.h index
> 6e4a3a1697..b0e9610d98 100644
> --- a/target/hexagon/macros.h
> +++ b/target/hexagon/macros.h
> @@ -675,3 +675,5 @@ static inline TCGv gen_read_ireg(TCGv result, TCGv
> val, int shift)  #endif
> 
>  #endif
> +
> +#define fPREDUSE_TIMING()

Why wasn't this in the previous patch with all the changes to macros.h?

> diff --git a/target/hexagon/hex_common.py
> b/target/hexagon/hex_common.py index 7fb11a0819..9147701333 100755
> --- a/target/hexagon/hex_common.py
> +++ b/target/hexagon/hex_common.py
> @@ -1235,11 +1235,18 @@ def init_registers():
>      for reg in new_regs:
>          new_registers[f"{reg.regtype}{reg.regid}"] = reg
> 
> +def is_new_reg(tag, regid):
> +    if regid[0] in "NO":
> +        return True
> +    return regid[0] == "P" and \
> +           f"{regid}N" in semdict[tag] and \
> +           f"{regid}V" not in semdict[tag]
> +
>  def get_register(tag, regtype, regid):
> -    if f"{regtype}{regid}V" in semdict[tag]:
> -        return registers[f"{regtype}{regid}"]
> -    else:
> -        return new_registers[f"{regtype}{regid}"]
> +    regid = f"{regtype}{regid}"
> +    is_new = is_new_reg(tag, regid)
> +    reg = new_registers[regid] if is_new else registers[regid]
> +    return reg

This looks OK but is out of place in this patch.

> 
>  def helper_ret_type(tag, regs):
>      ## If there is a scalar result, it is the return type diff --git
> a/target/hexagon/imported/encode_pp.def
> b/target/hexagon/imported/encode_pp.def
> index 0cd30a5e85..37faf62b1b 100644
> --- a/target/hexagon/imported/encode_pp.def
> +++ b/target/hexagon/imported/encode_pp.def
> @@ -1,5 +1,5 @@
>  /*
> - *  Copyright(c) 2019-2023 Qualcomm Innovation Center, Inc. All Rights
> Reserved.
> + *  Copyright(c) 2019-2020 Qualcomm Innovation Center, Inc. All Rights
> Reserved.

Why are you changing the copyright date badkward?

>   *
>   *  This program is free software; you can redistribute it and/or modify
>   *  it under the terms of the GNU General Public License as published by @@
> -16,6 +16,7 @@
>   */
> 
>  /*
> + * encode32.def
>   * Encodings for 32 bit instructions
>   *
>   */
> @@ -341,6 +342,8 @@ DEF_ENC32(L4_pload##TAG##tnew_abs,ICLASS_LD"
> 1 11 "OPC"  iiiii  PP110tti  1--ddd
> DEF_ENC32(L4_pload##TAG##fnew_abs,ICLASS_LD" 1 11 "OPC"  iiiii  PP111tti
> 1--ddddd")
> 
> 
> +
> +
>  /*               0 000  misc: dealloc,loadw_locked,dcfetch      */
>  STD_LD_ENC(bzw4,"0 101")
>  STD_LD_ENC(bzw2,"0 011")
> @@ -375,6 +378,7 @@ DEF_ANTICLASS32(ICLASS_LD" 1110 000----- PP------ --
> ------",LD_ADDR_POST_REG)
> 
>  DEF_ENC32(L2_deallocframe,    ICLASS_LD" 000 0 000 sssss PP0----- ---
> ddddd")
>  DEF_ENC32(L4_return,          ICLASS_LD" 011 0 000 sssss PP0000-- ---ddddd")
> +
>  DEF_ENC32(L4_return_t,        ICLASS_LD" 011 0 000 sssss PP0100vv ---ddddd")
>  DEF_ENC32(L4_return_f,        ICLASS_LD" 011 0 000 sssss PP1100vv ---ddddd")
>  DEF_ENC32(L4_return_tnew_pt,  ICLASS_LD" 011 0 000 sssss PP0110vv ---
> ddddd") @@ -382,15 +386,18 @@ DEF_ENC32(L4_return_fnew_pt,
> ICLASS_LD" 011 0 000 sssss PP1110vv ---ddddd")
> DEF_ENC32(L4_return_tnew_pnt, ICLASS_LD" 011 0 000 sssss PP0010vv ---
> ddddd")  DEF_ENC32(L4_return_fnew_pnt, ICLASS_LD" 011 0 000 sssss
> PP1010vv ---ddddd")
> 
> -DEF_ENC32(L2_loadw_locked,ICLASS_LD" 001 0 000 sssss PP000---
> 000ddddd")
> -
> +/** Load Acquire Store Release Encoding **/
> 
> +DEF_ENC32(L2_loadw_locked,    ICLASS_LD" 001 0 000 sssss PP000---
> 000ddddd")
> +DEF_ENC32(L4_loadd_locked,    ICLASS_LD" 001 0 000 sssss PP010---
> 000ddddd")

There are lots of changes here that look like formatting/whitespace.  It would be easier to review if you could minimize these.

> diff --git a/target/hexagon/imported/system.idef
> b/target/hexagon/imported/system.idef
> index 7c6568e75e..fd7ef18b3e 100644
> --- a/target/hexagon/imported/system.idef
> +++ b/target/hexagon/imported/system.idef
> @@ -25,44 +25,262 @@
>  /* User->OS interface                       */
>  /********************************************/
> 
> -Q6INSN(J2_trap0,"trap0(#u8)",ATTRIBS(A_COF),
> +Q6INSN(J2_trap0,"trap0(#u8)",ATTRIBS(A_COF,A_NOTE_NOPACKET,A_RES
> TRICT_N
> +OPACKET),
>  "Trap to Operating System",
> -    fTRAP(0,uiV);
> +	fTRAP(0,uiV);

The formatting/whitespace changes are not as rampant in this file, but this is one example.

>  )



  reply	other threads:[~2025-03-08  1:33 UTC|newest]

Thread overview: 120+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-01  5:25 [PATCH 00/38] hexagon system emu, part 1/3 Brian Cain
2025-03-01  5:25 ` [PATCH 01/38] docs: Add hexagon sysemu docs Brian Cain
2025-03-05 19:29   ` ltaylorsimpson
2025-03-01  5:25 ` [PATCH 02/38] docs/system: Add hexagon CPU emulation Brian Cain
2025-03-05 19:36   ` ltaylorsimpson
2025-03-05 20:12     ` Brian Cain
2025-03-05 21:21       ` ltaylorsimpson
2025-03-05 21:28         ` Brian Cain
2025-03-01  5:25 ` [PATCH 03/38] target/hexagon: Add System/Guest register definitions Brian Cain
2025-03-06 20:54   ` ltaylorsimpson
2025-04-16 17:54   ` ltaylorsimpson
2025-04-16 19:43     ` Brian Cain
2025-04-16 22:02       ` ltaylorsimpson
2025-09-02  0:17         ` Brian Cain
2025-03-01  5:25 ` [PATCH 04/38] target/hexagon: Make gen_exception_end_tb non-static Brian Cain
2025-03-06 20:55   ` ltaylorsimpson
2025-03-01  5:25 ` [PATCH 05/38] target/hexagon: Switch to tag_ignore(), generate via get_{user, sys}_tags() Brian Cain via
2025-03-06 21:07   ` ltaylorsimpson
2025-03-01  5:25 ` [PATCH 06/38] target/hexagon: Add privilege check, use tag_ignore() Brian Cain
2025-03-06 21:11   ` ltaylorsimpson
2025-03-06 22:01   ` Richard Henderson
2025-09-02  0:24     ` Brian Cain
2025-03-01  5:25 ` [PATCH 07/38] target/hexagon: Add a placeholder fp exception Brian Cain
2025-03-06 21:22   ` ltaylorsimpson
2025-03-01  5:25 ` [PATCH 08/38] target/hexagon: Add guest, system reg number defs Brian Cain
2025-03-06 21:30   ` ltaylorsimpson
2025-03-08  0:35     ` Sid Manning
2025-09-02  0:25     ` Brian Cain
2025-03-01  5:25 ` [PATCH 09/38] target/hexagon: Add guest, system reg number state Brian Cain
2025-03-06 21:32   ` ltaylorsimpson
2025-03-12 19:15   ` Philippe Mathieu-Daudé
2025-09-02  0:27     ` Brian Cain
2025-03-01  5:26 ` [PATCH 10/38] target/hexagon: Add TCG values for sreg, greg Brian Cain
2025-03-06 21:38   ` ltaylorsimpson
2025-09-02  0:28     ` Brian Cain
2025-03-01  5:26 ` [PATCH 11/38] target/hexagon: Add guest/sys reg writes to DisasContext Brian Cain
2025-03-06 21:40   ` ltaylorsimpson
2025-03-01  5:26 ` [PATCH 12/38] target/hexagon: Add imported macro, attr defs for sysemu Brian Cain
2025-03-07 19:01   ` ltaylorsimpson
2025-09-02  0:36     ` Brian Cain
2025-03-01  5:26 ` [PATCH 13/38] target/hexagon: Define DCache states Brian Cain
2025-03-07 19:03   ` ltaylorsimpson
2025-03-01  5:26 ` [PATCH 14/38] target/hexagon: Add new macro definitions for sysemu Brian Cain
2025-03-07 19:35   ` ltaylorsimpson
2025-09-02  0:38     ` Brian Cain
2025-03-01  5:26 ` [PATCH 15/38] target/hexagon: Add handlers for guest/sysreg r/w Brian Cain
2025-03-07 19:46   ` ltaylorsimpson
2025-09-02  0:40     ` Brian Cain
2025-03-01  5:26 ` [PATCH 16/38] target/hexagon: Add placeholder greg/sreg r/w helpers Brian Cain
2025-03-07 20:45   ` ltaylorsimpson
2025-03-01  5:26 ` [PATCH 17/38] target/hexagon: Add vmstate representation Brian Cain
2025-03-07 21:19   ` ltaylorsimpson
2025-03-01  5:26 ` [PATCH 18/38] target/hexagon: Make A_PRIV, "J2_trap*" insts need_env() Brian Cain
2025-03-07 21:20   ` ltaylorsimpson
2025-03-01  5:26 ` [PATCH 19/38] target/hexagon: Define register fields for system regs Brian Cain
2025-03-07 21:21   ` ltaylorsimpson
2025-03-01  5:26 ` [PATCH 20/38] target/hexagon: Implement do_raise_exception() Brian Cain
2025-03-07 21:28   ` ltaylorsimpson
2025-09-02  0:41     ` Brian Cain
2025-03-01  5:26 ` [PATCH 21/38] target/hexagon: Add system reg insns Brian Cain
2025-03-08  1:32   ` ltaylorsimpson [this message]
2025-09-02  0:44     ` Brian Cain
2025-03-01  5:26 ` [PATCH 22/38] target/hexagon: Add sysemu TCG overrides Brian Cain
2025-03-08  1:43   ` ltaylorsimpson
2025-09-02  0:46     ` Brian Cain
2025-03-01  5:26 ` [PATCH 23/38] target/hexagon: Add implicit attributes to sysemu macros Brian Cain
2025-03-11 22:30   ` ltaylorsimpson
2025-09-02  0:47     ` Brian Cain
2025-03-01  5:26 ` [PATCH 24/38] target/hexagon: Add TCG overrides for int handler insts Brian Cain
2025-03-08  1:46   ` ltaylorsimpson
2025-03-01  5:26 ` [PATCH 25/38] target/hexagon: Add TCG overrides for thread ctl Brian Cain
2025-03-08  1:47   ` ltaylorsimpson
2025-03-01  5:26 ` [PATCH 26/38] target/hexagon: Add TCG overrides for rte, nmi Brian Cain
2025-03-11 22:33   ` ltaylorsimpson
2025-03-01  5:26 ` [PATCH 27/38] target/hexagon: Add sreg_{read,write} helpers Brian Cain
2025-03-11 23:22   ` ltaylorsimpson
2025-09-02  0:53     ` Brian Cain
2025-03-01  5:26 ` [PATCH 28/38] target/hexagon: Initialize htid, modectl regs Brian Cain
2025-03-11 23:26   ` ltaylorsimpson
2025-03-12 14:02     ` Sid Manning
2025-03-12 19:19   ` Philippe Mathieu-Daudé
2025-03-12 23:10     ` Brian Cain
2025-03-12 23:40       ` Philippe Mathieu-Daudé
2025-03-13 18:47         ` ltaylorsimpson
2025-03-13 19:06           ` Richard Henderson
2025-03-19 16:08             ` Sid Manning
2025-03-20 15:34               ` Richard Henderson
2025-03-20 17:38                 ` Sid Manning
2025-09-02  0:56                   ` Brian Cain
2025-03-01  5:26 ` [PATCH 29/38] target/hexagon: Add locks, id, next_PC to state Brian Cain
2025-03-11 23:33   ` ltaylorsimpson
2025-03-01  5:26 ` [PATCH 30/38] target/hexagon: Add a TLB count property Brian Cain
2025-03-11 23:41   ` ltaylorsimpson
2025-03-12 14:01     ` Sid Manning
2025-03-01  5:26 ` [PATCH 31/38] target/hexagon: Add {TLB, k0}lock, cause code, wait_next_pc Brian Cain via
2025-03-11 23:44   ` ltaylorsimpson
2025-03-12 16:58   ` [PATCH 31/38] target/hexagon: Add {TLB,k0}lock, " Sid Manning
2025-03-01  5:26 ` [PATCH 32/38] target/hexagon: Add stubs for modify_ssr/get_exe_mode Brian Cain
2025-03-11 23:43   ` ltaylorsimpson
2025-03-01  5:26 ` [PATCH 33/38] target/hexagon: Add gdb support for sys regs Brian Cain
2025-03-12 16:27   ` ltaylorsimpson
2025-03-12 19:10     ` Sid Manning
2025-03-12 19:27       ` Sid Manning
2025-03-12 19:46         ` Matheus Tavares Bernardino
2025-09-02  1:15   ` Brian Cain
2025-03-01  5:26 ` [PATCH 34/38] target/hexagon: Add initial MMU model Brian Cain
2025-03-12 17:04   ` ltaylorsimpson
2025-09-02  1:20     ` Brian Cain
2025-03-12 19:20   ` Philippe Mathieu-Daudé
2025-03-12 21:15     ` Sid Manning
2025-03-12 23:32       ` Philippe Mathieu-Daudé
2025-03-01  5:26 ` [PATCH 35/38] target/hexagon: Add IRQ events Brian Cain
2025-03-12 17:06   ` ltaylorsimpson
2025-03-01  5:26 ` [PATCH 36/38] target/hexagon: Add clear_wait_mode() definition Brian Cain
2025-03-12 17:08   ` ltaylorsimpson
2025-03-01  5:26 ` [PATCH 37/38] target/hexagon: Define f{S,G}ET_FIELD macros Brian Cain
2025-03-12 17:11   ` ltaylorsimpson
2025-03-01  5:26 ` [PATCH 38/38] target/hexagon: Add hex_interrupts support Brian Cain
2025-03-12 17:32   ` ltaylorsimpson
2025-09-02  1:22     ` Brian Cain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='030601db8fca$04123730$0c36a590$@gmail.com' \
    --to=ltaylorsimpson@gmail.com \
    --cc=ale@rev.ng \
    --cc=alex.bennee@linaro.org \
    --cc=anjo@rev.ng \
    --cc=bcain@quicinc.com \
    --cc=brian.cain@oss.qualcomm.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quic_mathbern@quicinc.com \
    --cc=quic_mburton@quicinc.com \
    --cc=quic_mliebel@quicinc.com \
    --cc=richard.henderson@linaro.org \
    --cc=sidneym@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).