This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: _Fract types and conversion routines
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Steve Ellcey <sellcey at imgtec dot com>
- Cc: GCC Development <gcc at gcc dot gnu dot org>
- Date: Wed, 28 Oct 2015 13:42:39 +0100
- Subject: Re: _Fract types and conversion routines
- Authentication-results: sourceware.org; auth=none
- References: <8ea17595-285a-4062-bb85-bf6d6a3b56e6 at BAMAIL02 dot ba dot imgtec dot org>
On Wed, Oct 28, 2015 at 12:23 AM, Steve Ellcey <sellcey@imgtec.com> wrote:
>
> I have a question about the _Fract types and their conversion routines.
> If I compile this program:
>
> extern void abort (void);
> int main ()
> {
> signed char a = -1;
> _Sat unsigned _Fract b = a;
> if (b != 0.0ur)
> abort();
> return 0;
> }
>
> with -O0 and on a MIPS32 system where char is 1 byte and unsigned (int)
> is 4 bytes I see a call to '__satfractqiuhq' for the conversion.
>
> Now I think the 'qi' part of the name is for the 'from type' of the
> conversion, a 1 byte signed type (signed char), and the 'uhq' part is
> for the 'to' part of the conversion. But 'uhq' would be a 2 byte
> unsigned fract, and the unsigned fract type on MIPS should be 4 bytes
> (unsigned int is 4 bytes). So shouldn't GCC have generated a call to
> __satfractqiusq instead? Or am I confused?
did it eventually narrow the comparison? Just check some of the tree/RTL dumps.
> Steve Ellcey
> sellcey@imgtec.com