Re: inhibit the sincos optimization when the target has sin and cos instructions

2016-05-19 Thread Nathan Sidwell
On 05/19/16 14:42, Cesar Philippidis wrote: + "operands[2] = make_safe_from (operands[2], operands[0]);" Please use { ... } rather than "" for readability. Ok with that change. nathan

Re: inhibit the sincos optimization when the target has sin and cos instructions

2016-05-19 Thread Nathan Sidwell
On 05/18/16 23:42, Cesar Philippidis wrote: +(define_expand "sincossf3" + [(set (match_operand:SF 0 "nvptx_register_operand" "=R") +(unspec:SF [(match_operand:SF 2 "nvptx_register_operand" "R")] + UNSPEC_COS)) + (set (match_operand:SF 1 "nvptx_register_operand" "=R") +(u

Re: inhibit the sincos optimization when the target has sin and cos instructions

2016-05-19 Thread Cesar Philippidis
On 05/19/2016 04:29 AM, Alexander Monakov wrote: > On Wed, 18 May 2016, Cesar Philippidis wrote: > Note that the documentation suggests using 'make_safe_from' to concisely > express conflict resolution: > >> diff --git a/gcc/config/nvptx/nvptx.md b/gcc/config/nvptx/nvptx.md >> index 33a4862..69bb

Re: inhibit the sincos optimization when the target has sin and cos instructions

2016-05-19 Thread Alexander Monakov
On Wed, 18 May 2016, Cesar Philippidis wrote: > >> +(define_expand "sincossf3" > >> + [(set (match_operand:SF 0 "nvptx_register_operand" "=R") > >> +(unspec:SF [(match_operand:SF 2 "nvptx_register_operand" "R")] > >> + UNSPEC_COS)) > >> + (set (match_operand:SF 1 "nvptx_registe

Re: inhibit the sincos optimization when the target has sin and cos instructions

2016-05-18 Thread Cesar Philippidis
On 05/18/2016 05:29 AM, Nathan Sidwell wrote: > On 05/17/16 17:30, Cesar Philippidis wrote: >> On 05/17/2016 02:22 PM, Andrew Pinski wrote: gcc.sum Tests that now fail, but worked before: nvptx-none-run: gcc.c-torture/execute/20100316-1.c -Os execution test nvptx-n

Re: inhibit the sincos optimization when the target has sin and cos instructions

2016-05-18 Thread Nathan Sidwell
On 05/17/16 17:30, Cesar Philippidis wrote: On 05/17/2016 02:22 PM, Andrew Pinski wrote: Good eyes, thanks! I thought I had to create a new insn, but I got away with an expand. I attached the updated patch. Cesar gcc.sum Tests that now fail, but worked before: nvptx-none-run: gcc.c-tortur

Re: inhibit the sincos optimization when the target has sin and cos instructions

2016-05-17 Thread Cesar Philippidis
On 05/17/2016 02:22 PM, Andrew Pinski wrote: > On Tue, May 17, 2016 at 2:10 PM, Cesar Philippidis > wrote: >> On 05/13/2016 01:13 PM, Andrew Pinski wrote: >>> On Fri, May 13, 2016 at 12:58 PM, Richard Biener >>> wrote: On May 13, 2016 9:18:57 PM GMT+02:00, Cesar Philippidis wrote: >>>

Re: inhibit the sincos optimization when the target has sin and cos instructions

2016-05-17 Thread Andrew Pinski
On Tue, May 17, 2016 at 2:10 PM, Cesar Philippidis wrote: > On 05/13/2016 01:13 PM, Andrew Pinski wrote: >> On Fri, May 13, 2016 at 12:58 PM, Richard Biener >> wrote: >>> On May 13, 2016 9:18:57 PM GMT+02:00, Cesar Philippidis >>> wrote: The cse_sincos pass tries to optimize sequences such

Re: inhibit the sincos optimization when the target has sin and cos instructions

2016-05-17 Thread Cesar Philippidis
On 05/13/2016 01:13 PM, Andrew Pinski wrote: > On Fri, May 13, 2016 at 12:58 PM, Richard Biener > wrote: >> On May 13, 2016 9:18:57 PM GMT+02:00, Cesar Philippidis >> wrote: >>> The cse_sincos pass tries to optimize sequences such as >>> >>> sin (x); >>> cos (x); >>> >>> into a single call to

Re: inhibit the sincos optimization when the target has sin and cos instructions

2016-05-13 Thread Andrew Pinski
On Fri, May 13, 2016 at 12:58 PM, Richard Biener wrote: > On May 13, 2016 9:18:57 PM GMT+02:00, Cesar Philippidis > wrote: >>The cse_sincos pass tries to optimize sequences such as >> >> sin (x); >> cos (x); >> >>into a single call to sincos, or cexpi, when available. However, the >>nvptx targ

Re: inhibit the sincos optimization when the target has sin and cos instructions

2016-05-13 Thread Richard Biener
On May 13, 2016 9:18:57 PM GMT+02:00, Cesar Philippidis wrote: >The cse_sincos pass tries to optimize sequences such as > > sin (x); > cos (x); > >into a single call to sincos, or cexpi, when available. However, the >nvptx target has sin and cos instructions, albeit with some loss of >precision