Re: ceil division

Posted:
Tue Aug 06, 2013 1:00 am
by CIB
My integer version was also bad, but I get why now. The stuff I'm doing relies heavily on power of 2 integers, which compile down to a simple shift. But when I define the stuff as a function, and it's not inlined, the compiler has no way of knowing it'll be a power of 2 - So it applies the (apparently) expensive generic division.
That makes sense for integers, but doesn't the epiphany have some way to divide floats? Or is there only multiply?
Re: ceil division

Posted:
Tue Aug 06, 2013 2:13 am
by CIB
That works for constants, but what about "a / b"? =)
Re: ceil division

Posted:
Wed Aug 07, 2013 1:53 am
by aolofsson
cib,
We see big boost in '/' performance when using the "-ffast-math" is switch.
There are also some fast integer and floating point divisions examples here, can't recall which ones of them are in use within the compiler as of 4.8?
https://github.com/adapteva/epiphany-gc ... fast_div.Shttps://github.com/adapteva/epiphany-gc ... y/divsi3.SAndreas