public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* floating point sse & sse2
@ 2002-02-01  5:07 rkm
  2002-02-01  6:07 ` Daniel Berlin
  2002-02-01 10:41 ` Tim Prince
  0 siblings, 2 replies; 5+ messages in thread
From: rkm @ 2002-02-01  5:07 UTC (permalink / raw)
  To: gcc

Hello,

  I am new to this mailing list, sorry if my question has
already been discussed here.
  I will soon have Redhat Linux 7.2 installed on a Pentium 4
machine. I am trying to determine whether I can make use of the
floating point streaming simd extensions (SSE,SSE2) with GCC
or the AS assembler. I assume that if this is possible at all, I
will probably have to write in-line assembly code with the SSE
instructions, is that right? However I have downloaded the
latest version of the binutils I could find on ftp sites (version 2.11.2),
and I looked at the info files for the AS assembler -- the info
file says that AS currently does not support floating point SIMD
for intel processors. While I saw that the AS assembler can access
the XMM registers, there are other registers required for SSE that
are not mentioned in the info file (e.g. CR4). Is the info file 
out of date, or is it true that floating point SSE is not yet supported 
in AS (or GCC) for intel Pentium processors? If it is not yet supported, 
is this a project that is in the works for future versions?
  Even if SSE is supported in GCC or AS, I also have questions
whether the Linux kernel can support SSE. I have read that
the kernel must support context switching for floating point SSE
to work properly. I don't understand the implications of this, but
Redhat 7.2 uses kernel version 2.4.7-10 -- Would I have to use
a different version of the kernel to support SSE?
  Thanks for any assistance,

Richard

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: floating point sse & sse2
  2002-02-01  5:07 floating point sse & sse2 rkm
@ 2002-02-01  6:07 ` Daniel Berlin
  2002-02-01 10:41 ` Tim Prince
  1 sibling, 0 replies; 5+ messages in thread
From: Daniel Berlin @ 2002-02-01  6:07 UTC (permalink / raw)
  To: rkm; +Cc: gcc

On Fri, 1 Feb 2002, rkm@usol.com wrote:

> Hello,
> 
>   I am new to this mailing list, sorry if my question has
> already been discussed here.
>   I will soon have Redhat Linux 7.2 installed on a Pentium 4
> machine. I am trying to determine whether I can make use of the
> floating point streaming simd extensions (SSE,SSE2) with GCC
> or the AS assembler. I assume that if this is possible at all, I
> will probably have to write in-line assembly code with the SSE
> instructions, is that right?

Depends.
To make full use, yes.
However, the current CVS version of gcc can produce serial SSE code for 
floating point (IE use SSE instead of x87).

> However I have downloaded the
> latest version of the binutils I could find on ftp sites (version 2.11.2),
> and I looked at the info files for the AS assembler -- the info
> file says that AS currently does not support floating point SIMD
> for intel processors.
It needs to be updated, it does indeed support it.
> While I saw that the AS assembler can access
> the XMM registers, there are other registers required for SSE that
> are not mentioned in the info file (e.g. CR4).

However, they also work fine.
> Is the info file 
> out of date, or is it true that floating point SSE is not yet supported 
> in AS (or GCC) for intel Pentium processors?
The first.
SSE support in AS has been around for a while.

>  If it is not yet supported, 
> is this a project that is in the works for future versions?
>   Even if SSE is supported in GCC or AS, I also have questions
> whether the Linux kernel can support SSE. I have read that
> the kernel must support context switching for floating point SSE
> to work properly. I don't understand the implications of this, but
> Redhat 7.2 uses kernel version 2.4.7-10 -- Would I have to use
> a different version of the kernel to support SSE?

Nope, that version should work fine.
--Dan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: floating point sse & sse2
  2002-02-01  5:07 floating point sse & sse2 rkm
  2002-02-01  6:07 ` Daniel Berlin
@ 2002-02-01 10:41 ` Tim Prince
  1 sibling, 0 replies; 5+ messages in thread
From: Tim Prince @ 2002-02-01 10:41 UTC (permalink / raw)
  To: rkm, gcc

On Friday 01 February 2002 05:07, rkm@usol.com wrote:
> Hello,
>
>   I am new to this mailing list, sorry if my question has
> already been discussed here.
>   I will soon have Redhat Linux 7.2 installed on a Pentium 4
> machine. I am trying to determine whether I can make use of the
> floating point streaming simd extensions (SSE,SSE2) with GCC
> or the AS assembler. I assume that if this is possible at all, I
> will probably have to write in-line assembly code with the SSE
> instructions, is that right? However I have downloaded the
> latest version of the binutils I could find on ftp sites (version 2.11.2),
> and I looked at the info files for the AS assembler -- the info
> file says that AS currently does not support floating point SIMD
> for intel processors. While I saw that the AS assembler can access
> the XMM registers, there are other registers required for SSE that
> are not mentioned in the info file (e.g. CR4). Is the info file
> out of date, or is it true that floating point SSE is not yet supported
> in AS (or GCC) for intel Pentium processors? If it is not yet supported,
> is this a project that is in the works for future versions?
>   Even if SSE is supported in GCC or AS, I also have questions
> whether the Linux kernel can support SSE. I have read that
> the kernel must support context switching for floating point SSE
> to work properly. I don't understand the implications of this, but
> Redhat 7.2 uses kernel version 2.4.7-10 -- Would I have to use
> a different version of the kernel to support SSE?
>   Thanks for any assistance,
>
> Richard

I have not had any difficulties such as you mention with 'gcc -msse2 
-march=pentium4' (gcc-3.1) running on rh 7.1 with recent binutils installed.  
With my current SuSE 7.3 installation default binutils (which works fine with 
gcc-3.1), it says:
tim@linux:~> as --version
GNU assembler 2.11.90.0.29
Copyright 2001 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
This assembler was configured for a target of `i486-suse-linux'.

The one feature of current Intel CPU's which is not supported in the stock rh 
kernel is HyperThreading; you must either disable it in BIOS (to avoid 
serious performance loss) or use kernel 2.4.17 (unless rh comes out with 
another of their own kernels).

gcc-3.1 employs only the scalar SSE and SSE2 instructions.  as should work 
with the parallel instructions, if you observe the required data alignments.  
Only Intel's icc compiler uses parallel SSE by auto-vectorization or by their 
IPP extensions, as well as through gcc style asm() syntax.

Surely, you could find some interesting information more quickly at 
http://gcc.gnu.org, and more by reading the mail list archives, which people 
are unlikely to wish to repeat for you.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: floating point sse & sse2
  2002-02-01  5:31 George.R.Goffe
@ 2002-02-01  5:58 ` Christoph Hellwig
  0 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2002-02-01  5:58 UTC (permalink / raw)
  To: George.R.Goffe; +Cc: rkm, gcc

On Fri, Feb 01, 2002 at 05:31:17AM -0800, George.R.Goffe@seagate.com wrote:
> 
> Richard,
> 
> As I understand it, the kernel would have to save the contents (state) of
> processes during a context switch out and restore them after a return
> context switch. If the kernel doesn't "know" about the extra regs then they
> WILL NOT BE restored at "switch in" time which is NOT GOOD. I've seen this
> in the mainframe world with new processor architectures. The result is caos
> since every process would "see" every other  processes regs. IBM calls this
> "unpredictible results" and they're right.

The kernel _does_ save SSE registers.  This is the main reason why
current 2.2 and 2.4 kernel do task switches much slower than early 2.2.

	Christoph

-- 
Of course it doesn't work. We've performed a software upgrade.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: floating point sse & sse2
@ 2002-02-01  5:31 George.R.Goffe
  2002-02-01  5:58 ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: George.R.Goffe @ 2002-02-01  5:31 UTC (permalink / raw)
  To: rkm; +Cc: gcc


Richard,

As I understand it, the kernel would have to save the contents (state) of
processes during a context switch out and restore them after a return
context switch. If the kernel doesn't "know" about the extra regs then they
WILL NOT BE restored at "switch in" time which is NOT GOOD. I've seen this
in the mainframe world with new processor architectures. The result is caos
since every process would "see" every other  processes regs. IBM calls this
"unpredictible results" and they're right.

Does this help?

Regards,

George...

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-02-01 18:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-01  5:07 floating point sse & sse2 rkm
2002-02-01  6:07 ` Daniel Berlin
2002-02-01 10:41 ` Tim Prince
2002-02-01  5:31 George.R.Goffe
2002-02-01  5:58 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).