Index | Thread | Search

From:
Claudio Jeker <cjeker@diehard.n-r-g.com>
Subject:
ctfconv: handle 96bit float for i386
To:
tech@openbsd.org
Date:
Tue, 3 Sep 2024 15:29:18 +0200

Download raw body.

Thread
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.
-- 
:wq Claudio

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