Re: [Gimp-developer] MMX in 1.3 tree

2003-07-11 Thread pcg
On Thu, Jul 10, 2003 at 01:17:49PM +0200, Sven Neumann [EMAIL PROTECTED] wrote:
   __asm__ __volatile__ ()
 
 while the new code in The GIMP seems to be using
 
   asm()
 
 I don't know this stuff good enough to know the difference, but I'd

__keyword__-style keywords are always there, even if gcc extensions should
be disabled (strict ansi mode etc..

volatile means that there are side effects that are not (or can not) be
properly specified. unless you write a kernel or other arcane magic, the
need to use volatile indicates a bug in the constraints (i.e. forgetting
to tell the compiler properly about the effects of the statement).

for example, gcc will happily optimize away an asm() if the output
operands aren't used, as it can then assume that the computing isn't
necessary. volatile will keep it from doing that, but that might also keep
useful optimizations from doing their work.

-- 
  -==- |
  ==-- _   |
  ---==---(_)__  __   __   Marc Lehmann  +--
  --==---/ / _ \/ // /\ \/ /   [EMAIL PROTECTED]  |e|
  -=/_/_//_/\_,_/ /_/\_\   XX11-RIPE --+
The choice of a GNU generation   |
 |
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer


Re: [Gimp-developer] MMX in 1.3 tree

2003-07-11 Thread Steinar H. Gunderson
On Fri, Jul 11, 2003 at 12:52:08AM +0200, David Neary wrote:
 asm(movq %0, %%mm1
 :
 : m(rgba8_alpha_mask)
 : %mm1);
  
 breaks on the second %mm1;

I don't think there should be a % in the list of clobbered registers. What's
worse, I don't even think most versions of gcc know about MMX registers at
all (I might be mistaken, though :-) ) and thus you'd need to simply clobber
the entire FPU stack (which the MMX registers get aliased upon).

/* Steinar */
-- 
Homepage: http://www.sesse.net/
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer


Re: [Gimp-developer] MMX in 1.3 tree

2003-07-11 Thread pcg
On Fri, Jul 11, 2003 at 12:13:29PM +0200, Steinar H. Gunderson [EMAIL PROTECTED] 
wrote:
 I don't think there should be a % in the list of clobbered registers.

yupp, there is no %mm1 register :)

 worse, I don't even think most versions of gcc know about MMX registers at

versions 2.x (usually) don't know them, versions 3.x generally do know
them.

-- 
  -==- |
  ==-- _   |
  ---==---(_)__  __   __   Marc Lehmann  +--
  --==---/ / _ \/ // /\ \/ /   [EMAIL PROTECTED]  |e|
  -=/_/_//_/\_,_/ /_/\_\   XX11-RIPE --+
The choice of a GNU generation   |
 |
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer


Re: [Gimp-developer] MMX in 1.3 tree

2003-07-11 Thread Nathan Carl Summers
On Fri, 11 Jul 2003, Steinar H. Gunderson wrote:

 On Fri, Jul 11, 2003 at 12:52:08AM +0200, David Neary wrote:
 I don't think there should be a % in the list of clobbered registers. What's
 worse, I don't even think most versions of gcc know about MMX registers at
 all (I might be mistaken, though :-) ) and thus you'd need to simply clobber
 the entire FPU stack (which the MMX registers get aliased upon).

How hard would it be to write an autoconf test for that?

Rockwlrs

___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer


Re: [Gimp-developer] MMX in 1.3 tree

2003-07-10 Thread Sven Neumann
Hi,

David Neary [EMAIL PROTECTED] writes:

 That said, some day soon, the GIMP developers are going to have
 to get together for a brainstorning session about how we can
 communicate better with the user base, and vice versa. With IRC,
 Bugzilla, 2 mailing lists, usenet, the [EMAIL PROTECTED] mail address, the 
 web page and the GUG (wouldn't it be nice to tie in more tightly 
 with those guys?), there is an awful lot of information flying 
 about, but none of it is getting to everybody.

 Sven's talked about the dead documentation project, lots of
 usability issues have cropped up recently on the mailing list,
 and we seem to have become quite insular in our thinking. I would
 like us to sit down and talk about how we can make it easier for
 people to find out what's happenning with the GIMP, and easier
 for them to let us know what they thing should be happening.

The long-due overhaul of the web-site could help to improve this
situation.


Sven

___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer


Re: [Gimp-developer] MMX in 1.3 tree

2003-07-10 Thread Sven Neumann
Hi,

David Neary [EMAIL PROTECTED] writes:

 The new code is missing a #ifdef somewhere, I think - perhaps
 composite-mmx.c shouldn't be build at all if USE_MMX isn't
 defined... but that's another issue.

I've added an #ifdef that causes the file content to be skipped. I
prefer #ifdefs over automake conditionals since the latter tend to
slow down the build and clutter the Makefile.am.

 My processor does support mmx. It passes the configure test - when I
 run the configure test manually (that is, load register %mm0 in a .S
 file), it works fine. However, the same thing in an asm() in a C
 file seems to not compile. Really weird...

So config.h defines USE_MMX for you? Looks as if we have to improve
the configure test. The check we use now is copied from DirectFB and
seems to work there. In DirectFB we include the assembler code as

  __asm__ __volatile__ ()

while the new code in The GIMP seems to be using

  asm()

I don't know this stuff good enough to know the difference, but I'd
say we need to change the configure check so that is uses the same
asm constructs that the code in app/composite is using.


Sven
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer


Re: [Gimp-developer] MMX in 1.3 tree

2003-07-10 Thread Sven Neumann
Hi David,

could you please test the attached diff to configure.in. It should
find the problem with your compiler and it even simplifies things a
bit.


Sven

Index: configure.in
===
RCS file: /cvs/gnome/gimp/configure.in,v
retrieving revision 1.465
diff -u -p -r1.465 configure.in
--- configure.in9 Jul 2003 23:52:46 -   1.465
+++ configure.in10 Jul 2003 13:40:36 -
@@ -423,14 +423,10 @@ AC_ARG_ENABLE(sse,
 
 if test x$enable_mmx = xyes; then
 
-  dnl Necessary for assembler sources
-  save_ac_ext=$ac_ext
-  ac_ext=S
-
   AC_MSG_CHECKING(whether we can compile MMX code)
 
-  echomovq 0, %mm0  conftest.S
-  if AC_TRY_EVAL(ac_compile); then
+  AC_COMPILE_IFELSE([asm (movq 0, %mm0);],
+
 AC_DEFINE(USE_MMX, 1, [Define to 1 if MMX assembly is available.])
 AC_MSG_RESULT(yes)
 
@@ -438,26 +434,21 @@ if test x$enable_mmx = xyes; then
 
   AC_MSG_CHECKING(whether we can compile SSE code)
 
-  echomovntps %xmm0, 0  conftest.S
-  if AC_TRY_EVAL(ac_compile); then
+  AC_COMPILE_IFELSE([asm (movntps %xmm0, 0);],
 AC_DEFINE(USE_SSE, 1, [Define to 1 if SSE assembly is available.])
 AC_MSG_RESULT(yes)
-  else
+  ,
 enable_sse=no
 AC_MSG_RESULT(no)
 AC_MSG_WARN([The assembler does not support the SSE command set.])
-  fi
+  )
 
 fi
-
-  else
+  ,
 enable_mmx=no
 AC_MSG_RESULT(no)
 AC_MSG_WARN([The assembler does not support the MMX command set.])
-  fi
-
-  rm conftest*
-  ac_ext=$save_ac_ext
+  )
 
 fi
 
@@ -472,24 +463,16 @@ AC_ARG_ENABLE(altivec,
 
 if test x$enable_altivec = xyes; then
 
-  dnl Necessary for assembler sources
-  save_ac_ext=$ac_ext
-  ac_ext=S
-
   AC_MSG_CHECKING(whether we can compile Altivec code)
 
-  echovand %v0, %v0, %v0  conftest.S
-  if AC_TRY_EVAL(ac_compile); then
+  AC_COMPILE_IFELSE([asm (vand %v0, %v0, %v0);],
 AC_DEFINE(USE_ALTIVEC, 1, [Define to 1 if Altivec assembly is available.])
 AC_MSG_RESULT(yes)
-  else
+  ,
 enable_altivec=no
 AC_MSG_RESULT(no)
 AC_MSG_WARN([The assembler does not support the Altivec command set.])
-  fi
-
-  rm conftest*
-  ac_ext=$save_ac_ext
+  )
 
 fi
 
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer


Re: [Gimp-developer] MMX in 1.3 tree

2003-07-10 Thread Helvetix Victorinox
This isn't quite ready to go yet.  But thanks for the note.  The default
build behaviour right now is to not build the new code. 

Helvetix

On Thu, Jul 10, 2003 at 08:36:44AM +0200, David Neary wrote:
 
 Hi,
 
 The new MMX composite code in the 1.3 tree doesn't build for me -
 am I the only one? My processor is a 350MHz K6-2 with mmx
 support, and the error says that there are a bunch (6, I think)
 of unknown registers in the asm (%mm0, %mm1, ...).
 
 I'm mailing this to the list because, to be quite honest, I'm not
 sure how many people actually look at bugzilla these days apart
 from Sven and Raphael. But that's another issue... 
 
 Cheers,
 Dave.
 
 -- 
David Neary,
Lyon, France
   E-Mail: [EMAIL PROTECTED]
 ___
 Gimp-developer mailing list
 [EMAIL PROTECTED]
 http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer


Re: [Gimp-developer] MMX in 1.3 tree

2003-07-10 Thread David Neary
Sven Neumann wrote:
 Hi David,
 
 could you please test the attached diff to configure.in. It should
 find the problem with your compiler and it even simplifies things a
 bit.

I have stried, and my computer passes the mmx test with flying 
colours :) It seems that the thing which is annoying my compiler
is teh doubling of the % signs - with one % all passes well, with
two, not so well. A sligntly modified configure confirms this.

Are the two %s necessary to prefix the mm registers?

Thanks for the patch, though.

Cheers,
Dave.

-- 
   David Neary,
   Lyon, France
  E-Mail: [EMAIL PROTECTED]
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer