Re: [Patch] Change to argument promotion in fixed conversion library calls

2015-11-09 Thread Richard Biener
On Fri, Nov 6, 2015 at 8:14 PM, Bernd Schmidt wrote: > On 11/06/2015 08:04 PM, Steve Ellcey wrote: >> >> When I made this change I had one regression in the GCC testsuite >> (gcc.dg/fixed-point/convert-sat.c). I tracked this down to the >> fact that

Re: [Patch] Change to argument promotion in fixed conversion library calls

2015-11-09 Thread Steve Ellcey
On Mon, 2015-11-09 at 21:47 +0100, Bernd Schmidt wrote: > On 11/09/2015 05:59 PM, Steve Ellcey wrote: > > Here is a version with the code moved into a new function. How does > > this look? > > > > 2015-11-09 Steve Ellcey > > > > * optabs.c (prepare_libcall_arg): New

Re: [Patch] Change to argument promotion in fixed conversion library calls

2015-11-09 Thread Steve Ellcey
On Fri, 2015-11-06 at 20:29 +0100, Bernd Schmidt wrote: > On 11/06/2015 08:27 PM, Steve Ellcey wrote: > > > > Are you thinking of a simple function that is called on all targets or a > > target specific function? Maybe a target specific function would be > > safer. > > No, I think just what you

Re: [Patch] Change to argument promotion in fixed conversion library calls

2015-11-09 Thread Bernd Schmidt
On 11/09/2015 05:59 PM, Steve Ellcey wrote: Here is a version with the code moved into a new function. How does this look? 2015-11-09 Steve Ellcey * optabs.c (prepare_libcall_arg): New function. (expand_fixed_convert): Add call to prepare_libcall_arg.

Re: [Patch] Change to argument promotion in fixed conversion library calls

2015-11-09 Thread Bernd Schmidt
On 11/09/2015 10:10 PM, Steve Ellcey wrote: emit_library_call_value_1 has no way of knowing if the promotion should be signed or unsigned because it has a mode (probably QImode or HImode) that it knows may need to be promoted to SImode but it has no way to know if that should be a signed or

Re: [Patch] Change to argument promotion in fixed conversion library calls

2015-11-06 Thread Bernd Schmidt
On 11/06/2015 08:04 PM, Steve Ellcey wrote: When I made this change I had one regression in the GCC testsuite (gcc.dg/fixed-point/convert-sat.c). I tracked this down to the fact that emit_library_call_value_1 does not do any argument promotion because it does not have the original tree type

Re: [Patch] Change to argument promotion in fixed conversion library calls

2015-11-06 Thread Steve Ellcey
On Fri, 2015-11-06 at 20:14 +0100, Bernd Schmidt wrote: > > > + if (SCALAR_INT_MODE_P (from_mode)) > > +{ > > + /* If we need to promote the integer function argument we need to do > > Extra space at the start of the comment. > > > + it here instead of inside

Re: [Patch] Change to argument promotion in fixed conversion library calls

2015-11-06 Thread Bernd Schmidt
On 11/06/2015 08:27 PM, Steve Ellcey wrote: Are you thinking of a simple function that is called on all targets or a target specific function? Maybe a target specific function would be safer. No, I think just what you have there is probably sufficient. Bernd