This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Optimizations on long long multiply/divide on PowerPC32 don'twork
- From: Linus Torvalds <torvalds at transmeta dot com>
- To: Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>
- Cc: Richard Henderson <rth at redhat dot com>, <gcc at gcc dot gnu dot org>
- Date: Mon, 10 Dec 2001 09:08:12 -0800 (PST)
- Subject: Re: Optimizations on long long multiply/divide on PowerPC32 don'twork
On Mon, 10 Dec 2001, Franz Sirl wrote:
>
> Ah, now that is nice, I always wondered which codepath produced the
> signeddivide64-by-exactlog2constant to shift conversion on x86, but
> couldn't find anything in i386.md :-(. I'll try that one on 3.0.3pre and
> see if the FAT FS compiles again (I wonder if my ashrdi3_nopower pattern
> will get used then?).
Which part of FAT-FS actually tries to do a signed division?
I have a VERY strong suspicion that any filesystem that wants to divide by
512 is really just getting a sector number, and the division should not be
signed in the first place.
> Despite the missing GCC optimization, I always wondered if the FAT FS
> really relies the roundup happening with a signed divide, or if we could
> simply replace the "/512" with ">>9" without any ill effects? At least I
> couldn't find anything documented in the code...
It's almost certainly a "loff_t", and we should always have generated
-EINVAL for negative offsets, so it's pretty much guaranteed to be
positive modulo any bugs.
Of course, with fatfs, who knows..
Linus