------- Additional Comments From uros at kss-loka dot si  2004-12-24 14:29 
-------
With current TARGET_SSE_MATH work, mainline gcc produces:

main:
      pushl  %ebp
      movl   %esp, %ebp
      subl   $24, %esp
      andl   $-16, %esp
      movl   $0, %eax
      addl   $15, %eax
      addl   $15, %eax
      shrl   $4, %eax
      sall   $4, %eax
      subl   %eax, %esp
      movl   $1, -8(%ebp)
      movl   -8(%ebp), %eax
      imull  -8(%ebp), %eax
      pushl  %eax
      fildl  (%esp)
      leal   4(%esp), %esp
      fstps  -4(%ebp)
      movl   $0, %eax
      leave
      ret

However, -mfpmath just tells which instruction set is preferred. It is -msse,
-mmmx etc. that tells the compiler which instructions it can use, independently
of -mfpmath setting. For example, cvttss2si insn will be generated when -msse is
specified, no matter what -mfpmath setting you use.

-mmmx, -msse and -msse2 are treated the same way as -march=pentium3, etc. You
can not run the code, compiled with -march=pentium4 on i586.

However, this part of documentation should be fixed:

          For i387 you need to use `-march=CPU-TYPE', `-msse' or
          `-msse2' switches to enable SSE extensions and make this
 
I belive, it should read:

          For i386 compiler, you need to use `-march=CPU-TYPE', `-msse' or
          `-msse2' switches to enable SSE extensions and make this
 
Uros.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16584

Reply via email to