This is the mail archive of the
mailing list for the GCC project.
Re: Machine description and code generation
- From: Joern Rennecke <joern dot rennecke at embecosm dot com>
- To: Mathias Roslund <mathias dot roslund at amidog dot se>
- Cc: GCC <gcc at gcc dot gnu dot org>
- Date: Wed, 26 Nov 2014 17:13:27 +0000
- Subject: Re: Machine description and code generation
- Authentication-results: sourceware.org; auth=none
- References: <0da8f1de56a66c2c3394004190e74c32 dot squirrel at amidog dot se> <54514FA6 dot 3020108 at redhat dot com> <000001d00998$d7b114d0$87133e70$ at amidog dot se>
On 26 November 2014 at 16:48, Mathias Roslund <firstname.lastname@example.org> wrote:
> Since then I've added more instructions and gotten to the point where most
> stuff seems to be working. My current issue is that signed divide and all
> shift operations insists on sign/zero extending the operands, resulting in
> 32bit operations even when only 8bit ones would be required.
That's a matter of the input language. In C, you get default promotions to
int from narrower integer types.
> multiplies and unsigned divides behave as desired, i.e. only operate on the
> required number of bits.
That's because the results are the same regardless, and the optimizers
are able to undo the effects of the type promotions.