extending fpmuls
Frederic Riss
frederic.riss@gmail.com
Tue Oct 25 11:15:00 GMT 2011
Hi
On 25 October 2011 10:00, Jakub Jelinek <jakub@redhat.com> wrote:
> On Mon, Oct 24, 2011 at 11:12:29PM -0400, David Miller wrote:
>> While working on some test cases I noticed that the 'fsmuld'
>> instruction on sparc was not being matched by the combiner for
>> things like:
>>
>> double fsmuld (float a, float b)
>> {
>> return a * b;
>> }
>>
>> Combine does try to match:
>>
>> (set x (float_extend:DF (mul:SF y z)))
>
> That is correct. float a * float b is supposed to e.g. result in Inf
> if the product overflows float (but would still fit into double).
Some time ago, I tried to read the C standard to see what ports were
authorized to do with regard to that kind of issues. I (most
certainly wrongly) came to the conclusion that it was conformant to
generate an insn doing (set x (mul:DF (float_extend:DF y)
(float_extend:DF y))) for a pattern of (set x (float_extend:DF (mul:SF
y z))). The parts that lead me to believe this were eg. the paragaph
on FP contracted expressions (6.5.8) and the sentence on floating
point expression precision (6.3.1.8.2) that seem to allow a port to
compute results in higher precisions than requested.
Could you explain why the overflow is required here with respect to
the standard?
Thanks,
Fred
More information about the Gcc
mailing list