From: Hans-Peter Nilsson <hp@bitrange.com>
To: Indu Bhagat <indu.bhagat@oracle.com>
Cc: binutils@sourceware.org, weimin.pan@oracle.com
Subject: Re: [PATCH 2/6] sframe.h: make some macros more precise
Date: Wed, 7 Dec 2022 18:52:09 -0500 (EST) [thread overview]
Message-ID: <alpine.BSF.2.20.16.2212071840030.35610@arjuna.pair.com> (raw)
In-Reply-To: <20221207195222.1182788-3-indu.bhagat@oracle.com>
On Wed, 7 Dec 2022, Indu Bhagat via Binutils wrote:
> include/ChangeLog:
>
> * sframe.h (SFRAME_V1_FUNC_INFO): Use specific bits only.
> (SFRAME_V1_FRE_INFO): Likewise.
> ---
> include/sframe.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/sframe.h b/include/sframe.h
> index 7e31284e4d8..ba557b7bf7a 100644
> --- a/include/sframe.h
> +++ b/include/sframe.h
> @@ -192,7 +192,7 @@ typedef struct sframe_func_desc_entry
> /* Macros to compose and decompose function info in FDE. */
>
> #define SFRAME_V1_FUNC_INFO(fde_type, fre_enc_type) \
> - (((fde_type) & 0x1) << 4 | (fre_enc_type))
> + (((fde_type) & 0x1) << 4 | (fre_enc_type & 0xf))
Random comment: you removed the full parenthesisation (sp?) of
macro arguments here; compare to handling fde_type. ITYM:
+ (((fde_type) & 0x1) << 4 | ((fre_enc_type) & 0xf))
Looks like the SFframe code "has improvement potential" in this
regard, because right in the context of your patch, there's:
> #define SFRAME_V1_FUNC_FRE_TYPE(data) ((data) & 0xf)
> #define SFRAME_V1_FUNC_FDE_TYPE(data) ((data >> 4) & 0x1)
(Pre-existing badness for SFRAME_V1_FUNC_FDE_TYPE compared to
the goodness for SFRAME_V1_FUNC_FRE_TYPE.)
> @@ -240,7 +240,7 @@ typedef struct sframe_fre_info
> /* Macros to compose and decompose FRE info. */
>
> #define SFRAME_V1_FRE_INFO(base_reg_id, offset_num, offset_size) \
> - ((offset_size << 5) | (offset_num << 1) | (base_reg_id))
> + (((offset_size & 0x3) << 5) | ((offset_num & 0xf) << 1) | (base_reg_id & 0x1))
Also, here too, you just added one more. But better improve it
than making it ever so slightly worse.
brgds, H-P
next prev parent reply other threads:[~2022-12-07 23:52 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-07 19:52 [PATCH 0/6] Small improvements around SFrame support Indu Bhagat
2022-12-07 19:52 ` [PATCH 1/6] libsframe: minor formatting nits Indu Bhagat
2022-12-08 11:03 ` Nick Clifton
2022-12-07 19:52 ` [PATCH 2/6] sframe.h: make some macros more precise Indu Bhagat
2022-12-07 23:52 ` Hans-Peter Nilsson [this message]
2022-12-08 17:36 ` Indu Bhagat
2022-12-08 20:26 ` [PATCH,V2 " Indu Bhagat
2022-12-12 16:02 ` Nick Clifton
2022-12-07 19:52 ` [PATCH 3/6] sframe: gas: libsframe: define constants and remove magic numbers Indu Bhagat
2022-12-08 11:10 ` Nick Clifton
2022-12-08 17:43 ` Indu Bhagat
2022-12-08 18:38 ` Indu Bhagat
2022-12-07 19:52 ` [PATCH 4/6] gas: sframe: fine tune the fragment fixup for SFrame func info Indu Bhagat
2022-12-08 11:12 ` Nick Clifton
2022-12-07 19:52 ` [PATCH 5/6] libsframe: rename API sframe_fde_func_info to sframe_fde_create_func_info Indu Bhagat
2022-12-08 11:13 ` Nick Clifton
2022-12-07 19:52 ` [PATCH 6/6] objdump: sframe: fix memory leaks Indu Bhagat
2022-12-08 11:14 ` Nick Clifton
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=alpine.BSF.2.20.16.2212071840030.35610@arjuna.pair.com \
--to=hp@bitrange.com \
--cc=binutils@sourceware.org \
--cc=indu.bhagat@oracle.com \
--cc=weimin.pan@oracle.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 read-only IMAP folder(s) and NNTP newsgroup(s).