Re: SSE, XMM and GMP's configure

2014-02-03 Thread Torbjorn Granlund
For what it is worth, there are now 32-bit and 64-bit fbsd5 and fbsd56
systems in the test array:  https://gmplib.org/devel/testsystems.html

Both seem to allow XMM access.  The problem might be limited to fbsd4.

At some point, it would be nice to clean up the broken logics for this
in GMP's configure, but we should keep it mind that it is not very
important in practice.  (We could actually consider fixing it, or
removing the XMM checking code altogether.)
___
gmp-devel mailing list
gmp-devel@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-devel


Re: SSE, XMM and GMP's configure

2014-02-02 Thread Torbjorn Granlund
  Il Sab, 25 Gennaio 2014 7:15 pm, Torbjorn Granlund ha scritto:
  > operating system support.  Now, we suppress use of (some) gcc
  > sse-related options which trigger bad behaviour (via the acinclude.m4
  > GMP_GCC_PENTIUM4_SSE2) and in that context check of the OS handles XMM
  > (via GMP_OS_X86_XMM).
  
  Should we suppress all of them when XMM is not supported? We should add
  -march=corei7~-mno-sse2 -march=atom~-mno-sse2 -march=bdver4~-mno-sse2
  -march=bdver3~-mno-sse2 -march=bdver2~-mno-sse2 -march=bdver1~-mno-sse2
  -march=btver2~-mno-sse2 -march=btver1~-mno-sse2 -march=amdfam10~-mno-sse2
  ?
  
Perhaps that'd take care of the gcc generated xmm stuff, but again would
suppress sse2+mmx which should be allowed (assuming a cooperating
assembler).  A -mno-xmm is more suitable, but that might already be
implied by a well-configured gcc install.

  > Limiting that check to that context does not properly suppress assembly
  > code in sse2 subdirs. Suppressing all that code would actually be
  > sub-optimal, since some of it might actually stick to MMX regs.
  
  Does this means move the three offending asm in an xmm subdir, then add:
   case "$path $fat_path" in
 *xmm*)   GMP_OS_X86_XMM($cc $cflags $cppflags, , [GMP_STRIP_PATH(xmm)]) ;;
   esac
  
  ?
  
Sort of.  Except that cc, cflags, and cppflags are not defined there, I
think.

  > I discovered this problem when running tests on the long-obsolete
  > FreeBSD 4.
  
  Uhm, a comment in acinclude.m4 says:
  dnl  - FreeBSD version 4 is the first supporting xmm.
  should we also change the condition there, from
  [freebsd[123] | freebsd[123].*])
  to
  [freebsd[1234] | freebsd[1234].*])
  ?
  
  The first sounds like a lot of work, the second and the third step might
  be worth doing, even for a long-obsolete OS.
  
The comment is confusing.  It might be that FreeBSD 4.x (for which x?)
supports xmm but that the FreeBSD code only handles it for the
then-unique xmm chip Pentium 4.  The test system I use is a Haswell,
which with its family code 6 might be assumed to be Pentium pro, II, or
III by the old FreeBSD.

Or the comment is just wrong and FreeBSD 4 doesn't handle xmm at all.



Torbjörn
Please encrypt, key id 0xC8601622
___
gmp-devel mailing list
gmp-devel@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-devel


Re: SSE, XMM and GMP's configure

2014-02-01 Thread bodrato
Ciao,

Il Sab, 25 Gennaio 2014 7:15 pm, Torbjorn Granlund ha scritto:
> operating system support.  Now, we suppress use of (some) gcc
> sse-related options which trigger bad behaviour (via the acinclude.m4
> GMP_GCC_PENTIUM4_SSE2) and in that context check of the OS handles XMM
> (via GMP_OS_X86_XMM).

Should we suppress all of them when XMM is not supported? We should add
-march=corei7~-mno-sse2 -march=atom~-mno-sse2 -march=bdver4~-mno-sse2
-march=bdver3~-mno-sse2 -march=bdver2~-mno-sse2 -march=bdver1~-mno-sse2
-march=btver2~-mno-sse2 -march=btver1~-mno-sse2 -march=amdfam10~-mno-sse2
?

> Limiting that check to that context does not properly suppress assembly
> code in sse2 subdirs. Suppressing all that code would actually be
> sub-optimal, since some of it might actually stick to MMX regs.

Does this means move the three offending asm in an xmm subdir, then add:
 case "$path $fat_path" in
   *xmm*)   GMP_OS_X86_XMM($cc $cflags $cppflags, , [GMP_STRIP_PATH(xmm)]) ;;
 esac

?

> I discovered this problem when running tests on the long-obsolete
> FreeBSD 4.

Uhm, a comment in acinclude.m4 says:
dnl  - FreeBSD version 4 is the first supporting xmm.
should we also change the condition there, from
[freebsd[123] | freebsd[123].*])
to
[freebsd[1234] | freebsd[1234].*])
?

The first sounds like a lot of work, the second and the third step might
be worth doing, even for a long-obsolete OS.

Regards,
m

-- 
http://bodrato.it/papers/

___
gmp-devel mailing list
gmp-devel@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-devel