linux-mips
[Top] [All Lists]

Re: [PATCH]: fix compiler warnings in the math-emulator

To: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
Subject: Re: [PATCH]: fix compiler warnings in the math-emulator
From: Juan Quintela <quintela@mandrakesoft.com>
Date: 18 Dec 2002 23:21:17 +0100
Cc: linux mips mailing list <linux-mips@linux-mips.org>, Ralf Baechle <ralf@linux-mips.org>
In-reply-to: <Pine.GSO.3.96.1021218194246.5977G-100000@delta.ds2.pg.gda.pl>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <Pine.GSO.3.96.1021218194246.5977G-100000@delta.ds2.pg.gda.pl>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.92
>>>>> "maciej" == Maciej W Rozycki <macro@ds2.pg.gda.pl> writes:

maciej> On 18 Dec 2002, Juan Quintela wrote:
maciej> Is it needed?  The part that returns .mx should be optimized away by the
maciej> compiler automagically if unused. 
>> 
>> Idea was to make things compile without warnings, that way when you
>> change anything, you search for warnings :(

maciej> The idea is fine, sure.

>> With the changes that I sent, I have put the warnings levels down to
>> (for IP22) to:
>> - 7 C warnings
>> - 2 Asm warnings

maciej> A few warnings are unavoidable -- e.g. there is no way to shut up gas
maciej> complaining about macros expanding into multiple instructions in branch
maciej> delay slots.  Too bad.

I tried the 
  .set nowarn 
and found it didn't work.


maciej> How about this patch? -- it seems to work here (gcc 2.95.4).

Nope, the probem is that in the 3 places that I use the SETANDTEST()
macro they need the returned value.

Later, Juan.

maciej> -- 
maciej> +  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
maciej> +--------------------------------------------------------------+
maciej> +        e-mail: macro@ds2.pg.gda.pl, PGP key available        +

maciej> patch-mips-2.4.20-pre6-20021212-setcx-0
maciej> diff -up --recursive --new-file 
linux-mips-2.4.20-pre6-20021212.macro/arch/mips/math-emu/ieee754int.h 
linux-mips-2.4.20-pre6-20021212/arch/mips/math-emu/ieee754int.h
maciej> --- 
linux-mips-2.4.20-pre6-20021212.macro/arch/mips/math-emu/ieee754int.h       
2002-12-16 17:17:55.000000000 +0000
maciej> +++ linux-mips-2.4.20-pre6-20021212/arch/mips/math-emu/ieee754int.h     
2002-12-18 18:31:51.000000000 +0000
maciej> @@ -58,10 +58,10 @@
maciej> #define CLPAIR(x,y)     ((x)*6+(y))
 
maciej> #define CLEARCX \
maciej> -  (ieee754_csr.cx = 0)
maciej> +       (ieee754_csr.cx = 0)
 
maciej> #define SETCX(x) \
maciej> -  (ieee754_csr.cx |= (x),ieee754_csr.sx |= (x),ieee754_csr.mx & (x))
maciej> +       ({ieee754_csr.cx |= (x); ieee754_csr.sx |= (x); ieee754_csr.mx 
& (x);})
 
maciej> #define TSTX()  \
maciej> (ieee754_csr.cx & ieee754_csr.mx)


-- 
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy

<Prev in Thread] Current Thread [Next in Thread>