jkmcnk / sx-gcc

The GNU Compiler Collection port to NEC SX CPU architecture.
GNU General Public License v2.0
0 stars 2 forks source link

fix divdi3 expand #71

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
with our method of converting 64 bit int to 64 bit FP, using FP div and
truncation the result, we can only safely divide 64 bit ints that are
strictly lower than 2^53 (size of mantissa in IEEE-754 double precision
binary format is 52 bits).

for numbers >= 2^53 we should call the sw DF division routine (probably
built by soft-fp).

Original issue reported on code.google.com by jmoc...@gmail.com on 9 Dec 2008 at 4:37

GoogleCodeExporter commented 8 years ago
argh, my bad, this should be listed as enhancement. this probably comes from 
looking
at the gcc source for way too long.

currently, we call the libgcc2 divdi3 routine. this is ok for the time being in 
order
to get gcc fully working asap.

for performance reasons, we should use hw FP div for DI numbers <2^53, and 
libgcc2
routine for larger numbers. for that we will have to (a) code and expand that 
will do
runtime checking of DI variable values and decide which way to go, and (b)
appropriate *constrained* insertions that will choose which way to go for 
build-time
constants.

Original comment by jmoc...@gmail.com on 10 Dec 2008 at 9:27