[PATCH] include: libsframe: rename SFrame V3 Flexible FDE macros to CTRLWORD

Jens Remus jremus@linux.ibm.com
Thu Jan 29 16:47:28 GMT 2026


On 1/29/2026 10:06 AM, Indu Bhagat wrote:
> The existing SFrame V3 macros for Flexible FDEs used the term 'OFFSET'
> to refer to the data word encoding control/register data word. This can
> be confusing, as the control data word (register ID, dereference flags)
> is distinct from a stack offset.
> 
> This patch renames these macros to use 'CTRLWORD' to better reflect
> their purpose. It also updates the assembler and libsframe dumper to
> use the new nomenclature.
> 
> No functional change.
> 
> gas/
> 	* gen-sframe.c (sframe_get_fre_dataword_size): Use
> 	SFRAME_V3_FLEX_FDE_CTRLWORD_ENCODE.
> 	(output_sframe_row_entry_datawords): Likewise.
> include/
> 	* sframe.h (SFRAME_V3_FLEX_FDE_REG_ENCODE): Rename from ..
> 	(SFRAME_V3_FLEX_FDE_CTRLWORD_ENCODE): .. to.
> 	(SFRAME_V3_FLEX_FDE_CTRLWORD_REGNUM): Rename from
> 	SFRAME_V3_FLEX_FDE_OFFSET_REG_NUM to this.
> 	(SFRAME_V3_FLEX_FDE_CTRLWORD_DEREF_P): Rename from
> 	SFRAME_V3_FLEX_FDE_OFFSET_REG_DEREF_P to this.
> 	(SFRAME_V3_FLEX_FDE_CTRLWORD_REG_P): Rename from
> 	SFRAME_V3_FLEX_FDE_OFFSET_REG_P to this.
> 	(SFRAME_V3_FRE_RA_UNDEFINED_P): Add new V3 macro.
> libsframe/
> 	* sframe-dump.c (dump_sframe_func_fres_flex): Update all
> 	callers to use the new CTRLWORD macros.
> libsframe/testsuite/
> 	* libsframe.decode/be-flipping-v3.c: Use renamed macros.
> ---
>  gas/gen-sframe.c                              | 34 +++++++++----------
>  include/sframe.h                              | 11 +++---
>  libsframe/sframe-dump.c                       | 18 +++++-----
>  .../libsframe.decode/be-flipping-v3.c         |  8 ++---
>  4 files changed, 37 insertions(+), 34 deletions(-)

Reviewed-by: Jens Remus <jremus@linux.ibm.com>

> diff --git a/include/sframe.h b/include/sframe.h

> @@ -342,12 +342,15 @@ typedef struct sframe_func_desc_attr_v3
>  #define SFRAME_V3_FDE_UPDATE_SIGNAL_P(signal_p, info)  \
>    ((((signal_p) & 0x1) << 7) | ((info) & 0x7f))
>  
> -#define SFRAME_V3_FLEX_FDE_REG_ENCODE(reg, deref_p, reg_p)  \
> +#define SFRAME_V3_FLEX_FDE_CTRLWORD_ENCODE(reg, deref_p, reg_p) \
>    ((((reg) << 0x3) | (0 << 0x2) | (((deref_p) & 0x1) << 0x1) | ((reg_p) & 0x1)))
>  
> -#define SFRAME_V3_FLEX_FDE_OFFSET_REG_NUM(data)       ((data) >> 3)
> -#define SFRAME_V3_FLEX_FDE_OFFSET_REG_DEREF_P(data)   (((data) >> 1) & 0x1)
> -#define SFRAME_V3_FLEX_FDE_OFFSET_REG_P(data)         ((data) & 0x1)
> +#define SFRAME_V3_FLEX_FDE_CTRLWORD_REGNUM(data)    ((data) >> 3)
> +#define SFRAME_V3_FLEX_FDE_CTRLWORD_DEREF_P(data)   (((data) >> 1) & 0x1)
> +#define SFRAME_V3_FLEX_FDE_CTRLWORD_REG_P(data)     ((data) & 0x1)
> +
> +#define SFRAME_V3_FRE_RA_UNDEFINED_P(fre_info) \
> +  (SFRAME_V2_FRE_RA_UNDEFINED_P (fre_info))
>  
>  /* Size of stack frame offsets in an SFrame Frame Row Entry.  A single
>     SFrame FRE has all offsets of the same size.  Offset size may vary

I like the new terminology.  Thank you!

Regards,
Jens
-- 
Jens Remus
Linux on Z Development (D3303)
jremus@de.ibm.com / jremus@linux.ibm.com

IBM Deutschland Research & Development GmbH; Vorsitzender des Aufsichtsrats: Wolfgang Wendt; Geschäftsführung: David Faller; Sitz der Gesellschaft: Ehningen; Registergericht: Amtsgericht Stuttgart, HRB 243294
IBM Data Privacy Statement: https://www.ibm.com/privacy/



More information about the Binutils mailing list