Re: [TESTING] ssse3 backport from gcc 4.3

2011-03-10 Thread Alexander Best
On Thu Mar 10 11, Dimitry Andric wrote:
 On 2011-03-09 22:18, David Schultz wrote:
 The proliferation of -mno-sse -mno-sse2 -mno-sse3 options in the
 makefiles is probably not needed: I'm pretty sure -mno-sse implies
 the other two, unless -msse3 is specified explicitly.
 
 Indeed, contrib/gcc/config/i386/i386.c has:
 
 static bool
 ix86_handle_option (size_t code, const char *arg ATTRIBUTE_UNUSED, int 
 value)
 {
 ...
 case OPT_msse:
   if (!value)
 {
   target_flags = ~(MASK_SSE2 | MASK_SSE3);
   target_flags_explicit |= MASK_SSE2 | MASK_SSE3;
 }
   return true;
 
 E.g -mno-sse disables SSE2 and SSE3, unless you explicitly add -msse2 or
 -msse3 options.  In Martin's patch, this fragment uses MASK_SSSE3 too.

+1 for removing -mno-sse2, -mno-sse3 and -mno-ssse3 throughout the source
tree.

...also -mfpmath=387 is still present for amd64 and i don't think it's
necessary. with -mno-sse i don't think -mfpmath=sse remains the default for
amd64.

 
 Clang has a similar mechanism, -mno-sse disables all 'higher' SSE
 variants too.

-- 
a13x
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [TESTING] ssse3 backport from gcc 4.3

2011-03-10 Thread Alexander Best
On Wed Mar  9 11, George Liaskos wrote:
  I have prepared a patch that finishes the core2 support part and
  backports from gcc-4.3
  the SSSE3 instruction set (-mssse3, -mno-ssse3).
  It is enabled for -march=core2 by default.
 
  Testing and comments are welcome.
 
  Patch:
  http://people.freebsd.org/~mm/patches/head-gcc-ssse3.patch
 
  The backport covers three GPLv2 revisions from gcc 4.3:
  http://gcc.gnu.org/viewcvs?view=revisionrevision=117958 (applies cleanly)
  http://gcc.gnu.org/viewcvs?view=revisionrevision=121687 (small adjustment)
  http://gcc.gnu.org/viewcvs?view=revisionrevision=121726 (small adjustment)
  http://gcc.gnu.org/viewcvs?view=revisionrevision=123639 (small adjustment)
 
 Just finished compiling world and kernel with the patch, no issues
 whatsoever but i have some questions :)
 
 I have a Q6600, with -march=native gcc still uses nocona instead of
 core2, clang does the right thing. Is this a bug?
 Is it possible to support sse4.1 for penryn or is there a problem with
 the license?

same issue here:

otaku% /usr/bin/gcc -### -march=native blabla.c
Using built-in specs.
Target: amd64-undermydesk-freebsd
Configured with: FreeBSD/amd64 system compiler
Thread model: posix
gcc version 4.2.1 20070719  [FreeBSD]
 /usr/libexec/cc1 -quiet -D_LONGLONG null.c -march=nocona 
-mtune=generic -quiet -dumpbase null.c -auxbase null -o 
/var/tmp//cca3OQb6.s
 /usr/bin/as -Qy -o /var/tmp//ccmuWSiZ.o /var/tmp//cca3OQb6.s
 /usr/bin/ld --eh-frame-hdr -dynamic-linker /libexec/ld-elf.so.1 
/usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/lib 
-L/usr/lib /var/tmp//ccmuWSiZ.o -lgcc --as-needed -lgcc_s 
--no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed 
/usr/lib/crtend.o /usr/lib/crtn.o

it seems native isn't core2 aware. could this be backported to our gcc or
does that code fall under the gplv3?

cheers.
alex

 
 Regards

-- 
a13x
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [TESTING] ssse3 backport from gcc 4.3

2011-03-10 Thread Alexander Best
On Thu Mar 10 11, Alexander Best wrote:
 On Thu Mar 10 11, Dimitry Andric wrote:
  On 2011-03-09 22:18, David Schultz wrote:
  The proliferation of -mno-sse -mno-sse2 -mno-sse3 options in the
  makefiles is probably not needed: I'm pretty sure -mno-sse implies
  the other two, unless -msse3 is specified explicitly.
  
  Indeed, contrib/gcc/config/i386/i386.c has:
  
  static bool
  ix86_handle_option (size_t code, const char *arg ATTRIBUTE_UNUSED, int 
  value)
  {
  ...
  case OPT_msse:
if (!value)
  {
target_flags = ~(MASK_SSE2 | MASK_SSE3);
target_flags_explicit |= MASK_SSE2 | MASK_SSE3;
  }
return true;
  
  E.g -mno-sse disables SSE2 and SSE3, unless you explicitly add -msse2 or
  -msse3 options.  In Martin's patch, this fragment uses MASK_SSSE3 too.
 
 +1 for removing -mno-sse2, -mno-sse3 and -mno-ssse3 throughout the source
 tree.
 
 ...also -mfpmath=387 is still present for amd64 and i don't think it's
 necessary. with -mno-sse i don't think -mfpmath=sse remains the default for
 amd64.

i've compiled two kernels. one with the standard -mno-sse* options in kernel.mk
and one without -mno-sse2, -mno-sse3, -mno-ssse3 and -mfpmath=387.

CPUYTE ?= core2.

diffing showed no major differences for gcc and clang as compiler

cheers.
alex

 
  
  Clang has a similar mechanism, -mno-sse disables all 'higher' SSE
  variants too.
 
 -- 
 a13x

-- 
a13x
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


[TESTING] ssse3 backport from gcc 4.3

2011-03-09 Thread Martin Matuska
I have prepared a patch that finishes the core2 support part and
backports from gcc-4.3
the SSSE3 instruction set (-mssse3, -mno-ssse3).
It is enabled for -march=core2 by default.

Testing and comments are welcome.

Patch:
http://people.freebsd.org/~mm/patches/head-gcc-ssse3.patch

The backport covers three GPLv2 revisions from gcc 4.3:
http://gcc.gnu.org/viewcvs?view=revisionrevision=117958 (applies cleanly)
http://gcc.gnu.org/viewcvs?view=revisionrevision=121687 (small adjustment)
http://gcc.gnu.org/viewcvs?view=revisionrevision=121726 (small adjustment)
http://gcc.gnu.org/viewcvs?view=revisionrevision=123639 (small adjustment)
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [TESTING] ssse3 backport from gcc 4.3

2011-03-09 Thread George Liaskos
 I have prepared a patch that finishes the core2 support part and
 backports from gcc-4.3
 the SSSE3 instruction set (-mssse3, -mno-ssse3).
 It is enabled for -march=core2 by default.

 Testing and comments are welcome.

 Patch:
 http://people.freebsd.org/~mm/patches/head-gcc-ssse3.patch

 The backport covers three GPLv2 revisions from gcc 4.3:
 http://gcc.gnu.org/viewcvs?view=revisionrevision=117958 (applies cleanly)
 http://gcc.gnu.org/viewcvs?view=revisionrevision=121687 (small adjustment)
 http://gcc.gnu.org/viewcvs?view=revisionrevision=121726 (small adjustment)
 http://gcc.gnu.org/viewcvs?view=revisionrevision=123639 (small adjustment)

Just finished compiling world and kernel with the patch, no issues
whatsoever but i have some questions :)

I have a Q6600, with -march=native gcc still uses nocona instead of
core2, clang does the right thing. Is this a bug?
Is it possible to support sse4.1 for penryn or is there a problem with
the license?

Regards
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [TESTING] ssse3 backport from gcc 4.3

2011-03-09 Thread David Cornejo
On Wed, Mar 9, 2011 at 9:49 AM, George Liaskos geo.lias...@gmail.comwrote:

  I have prepared a patch that finishes the core2 support part and
  backports from gcc-4.3
  the SSSE3 instruction set (-mssse3, -mno-ssse3).
  It is enabled for -march=core2 by default.
 
  Testing and comments are welcome.
 
  Patch:
  http://people.freebsd.org/~mm/patches/head-gcc-ssse3.patch
 
  The backport covers three GPLv2 revisions from gcc 4.3:
  http://gcc.gnu.org/viewcvs?view=revisionrevision=117958 (applies
 cleanly)
  http://gcc.gnu.org/viewcvs?view=revisionrevision=121687 (small
 adjustment)
  http://gcc.gnu.org/viewcvs?view=revisionrevision=121726 (small
 adjustment)
  http://gcc.gnu.org/viewcvs?view=revisionrevision=123639 (small
 adjustment)

 Just finished compiling world and kernel with the patch, no issues
 whatsoever but i have some questions :)

 I have a Q6600, with -march=native gcc still uses nocona instead of
 core2, clang does the right thing. Is this a bug?
 Is it possible to support sse4.1 for penryn or is there a problem with
 the license?

 Regards
 ___
 freebsd-current@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-current
 To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


I also had success with this patch - running on a Core 2 Duo E4500.  rebuilt
world  kernel both with and without CPUTYPE=core2, so it at least doesn't
break anything.  Can you recommend a way to test Core2 specific features?

dave c
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [TESTING] ssse3 backport from gcc 4.3

2011-03-09 Thread David Schultz
On Wed, Mar 09, 2011, Martin Matuska wrote:
 I have prepared a patch that finishes the core2 support part and
 backports from gcc-4.3
 the SSSE3 instruction set (-mssse3, -mno-ssse3).
 It is enabled for -march=core2 by default.
 
 Testing and comments are welcome.
 
 Patch:
 http://people.freebsd.org/~mm/patches/head-gcc-ssse3.patch
 
 The backport covers three GPLv2 revisions from gcc 4.3:
 http://gcc.gnu.org/viewcvs?view=revisionrevision=117958 (applies cleanly)
 http://gcc.gnu.org/viewcvs?view=revisionrevision=121687 (small adjustment)
 http://gcc.gnu.org/viewcvs?view=revisionrevision=121726 (small adjustment)
 http://gcc.gnu.org/viewcvs?view=revisionrevision=123639 (small adjustment)

Cool.  Ccing gerald@, who has requested that he be kept in the
loop on gcc changes in the tree.

The proliferation of -mno-sse -mno-sse2 -mno-sse3 options in the
makefiles is probably not needed: I'm pretty sure -mno-sse implies
the other two, unless -msse3 is specified explicitly.

One suggestion from prior experience merging upstream gcc changes:
Peruse the bug database for anything significant that was reported
or fixed after the above patches were merged.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [TESTING] ssse3 backport from gcc 4.3

2011-03-09 Thread Dimitry Andric

On 2011-03-09 22:18, David Schultz wrote:

The proliferation of -mno-sse -mno-sse2 -mno-sse3 options in the
makefiles is probably not needed: I'm pretty sure -mno-sse implies
the other two, unless -msse3 is specified explicitly.


Indeed, contrib/gcc/config/i386/i386.c has:

static bool
ix86_handle_option (size_t code, const char *arg ATTRIBUTE_UNUSED, int value)
{
...
case OPT_msse:
  if (!value)
{
  target_flags = ~(MASK_SSE2 | MASK_SSE3);
  target_flags_explicit |= MASK_SSE2 | MASK_SSE3;
}
  return true;

E.g -mno-sse disables SSE2 and SSE3, unless you explicitly add -msse2 or
-msse3 options.  In Martin's patch, this fragment uses MASK_SSSE3 too.

Clang has a similar mechanism, -mno-sse disables all 'higher' SSE
variants too.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org