Index | Thread | Search

From:
Alexander Bluhm <bluhm@openbsd.org>
Subject:
Re: ctfconv: handle 96bit float for i386
To:
tech@openbsd.org
Date:
Tue, 3 Sep 2024 18:27:02 +0200

Download raw body.

Thread
On Tue, Sep 03, 2024 at 03:29:18PM +0200, Claudio Jeker wrote:
> On i386 the long double has 96bits or 12 bytes. This is the size that the
> ctftools ctfconvert uses and I think we should do as well.
> The spec is a bit unclear on how to exactly encode int and floats.
> Especially how a 95bit bitfield will be encoded (size of 12 or 16)?
>  
> It seems the common way is to use the same size a the dwarf type.

This fixes regress/usr.bin/ctfdump on i386.

OK bluhm@

> Index: ctfconv/generate.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/ctfconv/generate.c,v
> diff -u -p -r1.7 generate.c
> --- ctfconv/generate.c	27 Feb 2024 06:58:19 -0000	1.7
> +++ ctfconv/generate.c	3 Sep 2024 12:54:27 -0000
> @@ -208,6 +208,8 @@ imcs_add_type(struct imcs *imcs, struct 
>  				ctt.ctt_size = 4;
>  			else if (size <= 64)
>  				ctt.ctt_size = 8;
> +			else if (size <= 96)
> +				ctt.ctt_size = 12;
>  			else
>  				ctt.ctt_size = 16;
>  		} else