From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32004 invoked by alias); 2 May 2004 20:49:35 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 31735 invoked from network); 2 May 2004 20:49:31 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 2 May 2004 20:49:31 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i42KnVkG019627; Sun, 2 May 2004 16:49:31 -0400 Received: from post-office.corp.redhat.com (post-office.corp.redhat.com [172.16.52.227]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i423CTv10424; Sat, 1 May 2004 23:12:29 -0400 Received: from greed.delorie.com (dj.cipe.redhat.com [10.0.0.222]) by post-office.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i423CTH26360; Sat, 1 May 2004 23:12:29 -0400 Received: from greed.delorie.com (localhost [127.0.0.1]) by greed.delorie.com (8.12.10/8.12.10) with ESMTP id i423CS2g008736; Sat, 1 May 2004 23:12:28 -0400 Received: (from dj@localhost) by greed.delorie.com (8.12.10/8.12.10/Submit) id i423CSlH008732; Sat, 1 May 2004 23:12:28 -0400 Date: Sun, 02 May 2004 20:49:00 -0000 Message-Id: <200405020312.i423CSlH008732@greed.delorie.com> From: DJ Delorie To: cagney@gnu.org CC: binutils@sources.redhat.com, gdb-patches@sources.redhat.com In-reply-to: <4093DC36.9040304@gnu.org> (message from Andrew Cagney on Sat, 01 May 2004 13:19:50 -0400) Subject: Re: [patch/rfc] Add host's floatformat References: <40939DD4.3000706@gnu.org> <4093DC36.9040304@gnu.org> X-SW-Source: 2004-05/txt/msg00050.txt.bz2 Minor request: the functions should have "get" in there somewhere, such as "floatformat_get_host_float" or "get_host_float_floatformat" or something. I can be talked out of this, though. As for the code, I was thinking of something like this (probably got the bit patterns wrong): struct { float f; int size; unsigned char bits[8]; /* Expand as needed. */ const struct floatformat *ff; } host_floats[] = { { 1.0, 4, {0x3f, 0xff, 0x00, 0x00, 0, 0, 0, 0 }, &floatformat_ieee_single_little }, { 1.0, 4, {0x00, 0x00, 0xff, 0x3f, 0, 0, 0, 0 }, &floatformat_ieee_single_big } /* Fill in more as needed, choosing values to ensure uniqueness. */ }; const struct floatformat * floatformat_host_float () { static floatformat *ff = 0; static int ff_set = 0; if (!ff_set) { int i; ff_set = 1; for (i=0; i