From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22707 invoked by alias); 5 Dec 2001 14:54:13 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 22671 invoked from network); 5 Dec 2001 14:54:10 -0000 Received: from unknown (HELO mail00.oculustech.com) (64.221.47.99) by sources.redhat.com with SMTP; 5 Dec 2001 14:54:10 -0000 Received: from oculustech.com (dsl-64-192-85-73.telocity.com [64.192.85.73]) by mail00.oculustech.com (Postfix) with ESMTP id 7512E6DAA for ; Wed, 5 Dec 2001 09:53:37 -0500 (EST) Message-ID: <3C0E3509.7EAF89EF@oculustech.com> Date: Wed, 05 Dec 2001 06:54:00 -0000 From: Timothy Wall Reply-To: twall@oculustech.com Organization: Oculus Technologies X-Mailer: Mozilla 4.74 (Macintosh; U; PPC) X-Accept-Language: en MIME-Version: 1.0 To: gdb@sources.redhat.com Subject: ARM float/double conversion Content-Type: text/plain; charset=us-ascii; x-mac-type="54455854"; x-mac-creator="4D4F5353" Content-Transfer-Encoding: 7bit X-SW-Source: 2001-12/txt/msg00028.txt.bz2 In gdb/doublest.c, there is some conversion done for floatformat_littlebyte_bigword (currently only used by ARM): longswaps = fmt->totalsize / FLOATFORMAT_CHAR_BIT; longswaps >>= 3; while (longswaps-- > 0) { /* This is ugly, but efficient */ *swapout++ = swapin[4]; *swapout++ = swapin[5]; *swapout++ = swapin[6]; *swapout++ = swapin[7]; *swapout++ = swapin[0]; *swapout++ = swapin[1]; *swapout++ = swapin[2]; *swapout++ = swapin[3]; swapin += 8; } What's odd is that fmt->totalsize can be either 64 or 96, based on the formats defined in libiberty/floatformat.c. For either case, longswaps will be 1, so I don't understand why this code was "generalized". I assume that the extended double on the ARM has just the first two 32-bit words swapped. I actually need to extend this code to do similar swaps for a 32-bit float, and was going to "generalize" to accommodate that (little-endian, bigword, word size is 16 bits). T.