Re: [PATCH,i386] fma,fma4 and xop flags

2012-08-10 Thread Uros Bizjak
On Fri, Aug 10, 2012 at 7:27 AM, Gopalasubramanian, Ganesh wrote: >> -mxop implies -mfma4, but reverse is not true. > > I think this handling went in for bdver1. > But, with bdver2, we have both fma and fma4. > So for bdver2, -mxop should not be enabling one of them. > >> if someone set -mfma4 tog

Re: [PATCH,i386] fma,fma4 and xop flags

2012-08-10 Thread Richard Henderson
On 2012-08-10 12:59, Uros Bizjak wrote: > Actually, this is the problem you are trying to solve. The fma4 > patterns are defined before fma3, so gcc prefers these. The Real Problem is that they should not be separate patterns. They should be a single pattern that selects alternatives via the enabl

Re: [PATCH,i386] fma,fma4 and xop flags

2012-08-10 Thread Uros Bizjak
On Fri, Aug 10, 2012 at 10:02 PM, Richard Henderson wrote: > On 2012-08-10 12:59, Uros Bizjak wrote: >> Actually, this is the problem you are trying to solve. The fma4 >> patterns are defined before fma3, so gcc prefers these. > > The Real Problem is that they should not be separate patterns. > Th

Re: [PATCH,i386] fma,fma4 and xop flags

2012-08-10 Thread Richard Henderson
On 2012-08-10 13:21, Uros Bizjak wrote: > Do you think that enabled isa is also appropriate for 4.7? I think it's more reliable than relying on pattern ordering. r~

Re: [PATCH,i386] fma,fma4 and xop flags

2012-08-10 Thread Uros Bizjak
On Fri, Aug 10, 2012 at 10:22 PM, Richard Henderson wrote: > On 2012-08-10 13:21, Uros Bizjak wrote: >> Do you think that enabled isa is also appropriate for 4.7? > > I think it's more reliable than relying on pattern ordering. OK, I will write incremental patch that uses enabled attribute for ma

Re: [PATCH,i386] fma,fma4 and xop flags

2012-08-10 Thread Uros Bizjak
On Fri, Aug 10, 2012 at 10:02 PM, Richard Henderson wrote: > On 2012-08-10 12:59, Uros Bizjak wrote: >> Actually, this is the problem you are trying to solve. The fma4 >> patterns are defined before fma3, so gcc prefers these. > > The Real Problem is that they should not be separate patterns. > Th

RE: [PATCH,i386] fma,fma4 and xop flags

2012-08-12 Thread Gopalasubramanian, Ganesh
: [PATCH,i386] fma,fma4 and xop flags On Fri, Aug 10, 2012 at 10:02 PM, Richard Henderson wrote: > On 2012-08-10 12:59, Uros Bizjak wrote: >> Actually, this is the problem you are trying to solve. The fma4 >> patterns are defined before fma3, so gcc prefers these. > > The Real

Re: [PATCH,i386] fma,fma4 and xop flags

2012-08-13 Thread Richard Henderson
On 08/10/2012 03:24 PM, Uros Bizjak wrote: > + (eq_attr "isa" "fma") (symbol_ref "TARGET_FMA") > + (eq_attr "isa" "fma4") > +(symbol_ref "TARGET_FMA4 && !TARGET_FMA") Why the !TARGET_FMA for fma4? If both ISAs are enabled, I don't see why we couldn't choose from either. If they

Re: [PATCH,i386] fma,fma4 and xop flags

2012-08-13 Thread Uros Bizjak
On Mon, Aug 13, 2012 at 9:03 PM, Richard Henderson wrote: >> + (eq_attr "isa" "fma") (symbol_ref "TARGET_FMA") >> + (eq_attr "isa" "fma4") >> +(symbol_ref "TARGET_FMA4 && !TARGET_FMA") > > Why the !TARGET_FMA for fma4? > > If both ISAs are enabled, I don't see why we couldn't ch

Re: [PATCH,i386] fma,fma4 and xop flags

2012-08-13 Thread Richard Henderson
On 08/13/2012 12:33 PM, Uros Bizjak wrote: > AFAIU fma3 is better than fma4 for bdver2 (the only CPU that > implements both FMA sets). Current description of bdver2 doesn't even > enable fma4 in processor_alias_table due to this fact. > > The change you are referring to adds preference for fma3 in

Re: [PATCH,i386] fma,fma4 and xop flags

2012-08-14 Thread Uros Bizjak
On Mon, Aug 13, 2012 at 9:50 PM, Richard Henderson wrote: > On 08/13/2012 12:33 PM, Uros Bizjak wrote: >> AFAIU fma3 is better than fma4 for bdver2 (the only CPU that >> implements both FMA sets). Current description of bdver2 doesn't even >> enable fma4 in processor_alias_table due to this fact.

RE: [PATCH,i386] fma,fma4 and xop flags

2012-08-16 Thread Gopalasubramanian, Ganesh
opalasubramanian, Ganesh; gcc-patches@gcc.gnu.org Subject: Re: [PATCH,i386] fma,fma4 and xop flags On Mon, Aug 13, 2012 at 9:50 PM, Richard Henderson wrote: > On 08/13/2012 12:33 PM, Uros Bizjak wrote: >> AFAIU fma3 is better than fma4 for bdver2 (the only CPU that >> implements b

Re: [PATCH,i386] fma,fma4 and xop flags

2012-08-16 Thread Uros Bizjak
On Thu, Aug 16, 2012 at 1:43 PM, Gopalasubramanian, Ganesh wrote: >> This won't work, since we have to prefer FMA3 also in case when only "-mfma >> -mfma4" without -mtune=XX is used. >> We can add TARGET_FMA_BOTH though, but I doubt there will ever be target >> that implements both insn sets wit

Re: [PATCH,i386] fma,fma4 and xop flags

2012-08-08 Thread Richard Guenther
On Wed, Aug 8, 2012 at 1:31 PM, wrote: > Hello, > > Bdver2 cpu supports both fma and fma4 instructions. > Previous to patch, option "-mno-xop" removes "-mfma4". > Similarly, option "-mno-fma4" removes "-mxop". Eh? Why's that? I think we should disentangle -mxop and -mfma4 instead. Otherwise,

RE: [PATCH,i386] fma,fma4 and xop flags

2012-08-08 Thread Gopalasubramanian, Ganesh
w your opinion. Regards Ganesh -Original Message- From: Richard Guenther [mailto:richard.guent...@gmail.com] Sent: Wednesday, August 08, 2012 5:12 PM To: Gopalasubramanian, Ganesh Cc: gcc-patches@gcc.gnu.org; ubiz...@gmail.com Subject: Re: [PATCH,i386] fma,fma4 and xop flags On Wed, Aug 8

Re: [PATCH,i386] fma,fma4 and xop flags

2012-08-09 Thread Richard Guenther
looks reasonable then. I'll defer to x86 maintainers for approval though. Thanks, Richard. > Regards > Ganesh > > -Original Message- > From: Richard Guenther [mailto:richard.guent...@gmail.com] > Sent: Wednesday, August 08, 2012 5:12 PM > To: Gopalasubramanian, Gan

Re: [PATCH,i386] fma,fma4 and xop flags

2012-08-09 Thread Uros Bizjak
On Wed, Aug 8, 2012 at 1:31 PM, wrote: > Bdver2 cpu supports both fma and fma4 instructions. > Previous to patch, option "-mno-xop" removes "-mfma4". > Similarly, option "-mno-fma4" removes "-mxop". It looks to me that there is some misunderstanding. AFAICS: -mxop implies -mfma4, but reverse i

RE: [PATCH,i386] fma,fma4 and xop flags

2012-08-09 Thread Gopalasubramanian, Ganesh
ags. This will be a one to one mapping and leave the user with lot more liberty. Please let me know your opinion. Regards Ganesh -Original Message- From: Uros Bizjak [mailto:ubiz...@gmail.com] Sent: Friday, August 10, 2012 1:21 AM To: Gopalasubramanian, Ganesh Cc: gcc-patches@gcc.gnu.org S