From: Indu Bhagat <indu.bhagat@oracle.com>
To: binutils@sourceware.org
Cc: weimin.pan@oracle.com, Indu Bhagat <indu.bhagat@oracle.com>
Subject: [PATCH 2/6] sframe.h: make some macros more precise
Date: Wed, 7 Dec 2022 11:52:18 -0800 [thread overview]
Message-ID: <20221207195222.1182788-3-indu.bhagat@oracle.com> (raw)
In-Reply-To: <20221207195222.1182788-1-indu.bhagat@oracle.com>
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))
#define SFRAME_V1_FUNC_FRE_TYPE(data) ((data) & 0xf)
#define SFRAME_V1_FUNC_FDE_TYPE(data) ((data >> 4) & 0x1)
@@ -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))
#define SFRAME_V1_FRE_CFA_BASE_REG_ID(data) ((data) & 0x1)
#define SFRAME_V1_FRE_OFFSET_COUNT(data) (((data) >> 1) & 0xf)
--
2.37.2
next prev parent reply other threads:[~2022-12-07 19: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 ` Indu Bhagat [this message]
2022-12-07 23:52 ` [PATCH 2/6] sframe.h: make some macros more precise Hans-Peter Nilsson
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=20221207195222.1182788-3-indu.bhagat@oracle.com \
--to=indu.bhagat@oracle.com \
--cc=binutils@sourceware.org \
--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).