generation of divxu opcode
Andrew Haley
aph@cambridge.redhat.com
Tue Jul 9 07:34:00 GMT 2002
Kai Henningsen writes:
> aph@cambridge.redhat.com (Andrew Haley) wrote on 08.07.02 in <15657.29301.560459.253061@cuddles.cambridge.redhat.com>:
>
> > Kai Henningsen writes:
> > > aph@cambridge.redhat.com (Andrew Haley) wrote on 05.07.02 in
> > > <15653.38739.706764.135879@cuddles.cambridge.redhat.com>:
> > >
> > > Care to explain what you would consider "valid results" in the
> > > cases in question?
> >
> > Sure. In the case of an overflow, it would be possible to specify
> > that the result of the operation is equal to the 8-bit truncation of
> > the correct result. This wouldn't help for a true division by zero,
> > but would leave all other results well-defined.
>
> Are we arguing well-defined, valid, or useful here? That would certainly
> be well-defined, but I cannot see it particularly valid or useful.
Well, it would allow us to write a more general RTL template for the
full range of the instruction, which is an appropriate core primitive
for classical long division -- for example Kunth 4.3.1, Algorithm D.
Andrew.
More information about the Gcc
mailing list