Optimizations on long long multiply/divide on PowerPC32 don't work
Linus Torvalds
torvalds@transmeta.com
Mon Dec 10 09:21:00 GMT 2001
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
More information about the Gcc
mailing list