public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* GCC MMX PATCH
@ 1998-03-02 20:02 Hasdi R Hashim
  1998-03-03 12:53 ` John Carr
  0 siblings, 1 reply; 5+ messages in thread
From: Hasdi R Hashim @ 1998-03-02 20:02 UTC (permalink / raw)
  To: egcs

Hello All,

	I have a beta version of MMX patch for GCC 2.7.2.x. You can check
it out from my homepage:

	http://www-personal.umich.edu/~hasdi/mmx.html
	http://www-personal.umich.eud/~hasdi/simd.html (draft)

	There is still a lot of work to be done. I haven't done any work
on 2.8.x and egcs source tree. Basically all the patch does is recognize
the 'x' register constraint (MMX_REGS) and emits EMMS whenever necessary. 
Everything else is done using GCC's extended asm, inline, and
__attribute((const))__. This should give you automatic register
allocation, dead code elim and CSE.  Intermixing of MMX and FP code within
the same function is not supported. 

	BTW, I am not subscribed to egcs (I used but mailbox quickly went
full :( Please CC all discussions to me. Pointers all welcome.

	Support for PA-RISC 2.0, UltraSparc, DEC and generic RISC should
come RealSoonNow (tm). 

	See ya. and good luck.

Hasdi



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

* Re: GCC MMX PATCH
  1998-03-02 20:02 GCC MMX PATCH Hasdi R Hashim
@ 1998-03-03 12:53 ` John Carr
  1998-03-05 16:38   ` Hasdi R Hashim
  0 siblings, 1 reply; 5+ messages in thread
From: John Carr @ 1998-03-03 12:53 UTC (permalink / raw)
  To: Hasdi R Hashim; +Cc: egcs

Some comments:

Check out the Sun VIS SDK for a similar conecpt.  Sun's compiler has
inline assembly but the format is much different.

You need a target macro to enable MMX.  When it is clear
REG_CLASS_FROM_LETTER('x') must return NO_REGS.

gcc needs to enforce the rule that floating point and MMX don't mix.

You probably need register classes for general registers + MMX registers
because gcc will want to use such a class for DImode values.  You don't
need a constraint letter for these classes.

If you plan to do anything for UltraSPARC VIS, check with me first.


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

* Re: GCC MMX PATCH
  1998-03-05 16:38     ` John Carr
@ 1998-03-03 20:48       ` Hasdi R Hashim
  0 siblings, 0 replies; 5+ messages in thread
From: Hasdi R Hashim @ 1998-03-03 20:48 UTC (permalink / raw)
  To: John Carr; +Cc: egcs

On Tue, 3 Mar 1998, John Carr wrote: 
> It is part of the UltraSPARC reference manual, which I have.  What is
> the URL for your VIS files?

Right now, my vis.h is partially done. You can take a look at it at
	http://www-personal.umich.edu/~hasdi/vis.h
	http://www-personal.umich.edu/~hasdi/vis_types.h

This is based on the interface from SUN VIS toolkit
( http://www.sun.com/sparc/vis ) 

I plan to create a common interface for SIMD instructions
~hasdi/simd.html). Right now, I have two interface for MMX, mmx.h and
simd.h. Writing simd.h for usparc takes work but it is quite
straightforward.

Later

Hasdi



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

* Re: GCC MMX PATCH
  1998-03-05 16:38   ` Hasdi R Hashim
@ 1998-03-05 16:38     ` John Carr
  1998-03-03 20:48       ` Hasdi R Hashim
  0 siblings, 1 reply; 5+ messages in thread
From: John Carr @ 1998-03-05 16:38 UTC (permalink / raw)
  To: Hasdi R Hashim; +Cc: egcs

> I did, the assembly samples should be in vis*.il. For some reason, Sun
> does not have a reference manual for VIS.

It is part of the UltraSPARC reference manual, which I have.  What is
the URL for your VIS files?

> > You need a target macro to enable MMX.  When it is clear
> > REG_CLASS_FROM_LETTER('x') must return NO_REGS.
> 
> Okay, I just don't see the point because you have explicitly use the 'x'
> constraint (in asms) before you can take advantage of it. Still, might be
> worthwhile. 

The new move patterns use the 'x' constraint.

> > gcc needs to enforce the rule that floating point and MMX don't mix.
> 
> That is WAYYYYYYY out of my league.

To start, turn off TARGET_80387 when TARGET_MMX is on.


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

* Re: GCC MMX PATCH
  1998-03-03 12:53 ` John Carr
@ 1998-03-05 16:38   ` Hasdi R Hashim
  1998-03-05 16:38     ` John Carr
  0 siblings, 1 reply; 5+ messages in thread
From: Hasdi R Hashim @ 1998-03-05 16:38 UTC (permalink / raw)
  To: John Carr; +Cc: egcs

On Tue, 3 Mar 1998, John Carr wrote:
> Some comments:
> 
> Check out the Sun VIS SDK for a similar conecpt.  Sun's compiler has
> inline assembly but the format is much different.

I did, the assembly samples should be in vis*.il. For some reason, Sun
does not have a reference manual for VIS. :( I think I can abstract it out
for simd.h. I believe GCC extensions should generate code better than
Sun's compiler (able to avoid unnecessary register transferring and
spills).

Heck, I can generate better and more readble MMX code with GCC than hard
core assembly (okay so I can't take advantege of mode m just yet :) 

> You need a target macro to enable MMX.  When it is clear
> REG_CLASS_FROM_LETTER('x') must return NO_REGS.

Okay, I just don't see the point because you have explicitly use the 'x'
constraint (in asms) before you can take advantage of it. Still, might be
worthwhile. 

> gcc needs to enforce the rule that floating point and MMX don't mix.

That is WAYYYYYYY out of my league. I have some idea how to do it but it
will require massive changes to reg-stack.c. I don't know if this is worth
it. Even if it is, I don't know if it should be implemented in 2.8.* or
egcs. Richard Kenner has not got back to me on 2.7.*

As it is, you can only use MMX within a leaf function (strictly no FP). If
you have any idea how I can enforce the FP/mmX rule this easily let me
know. 
 
> You probably need register classes for general registers + MMX registers
> because gcc will want to use such a class for DImode values.  You don't
> need a constraint letter for these classes.

I dunno about this since I am very new to rtl/md. My goal is to hide the
existing of MMX form GCC regular insn as much as possible, i.e. to use the
MMX registers you *MUST* explicitly use in inline assembly. 
 
> If you plan to do anything for UltraSPARC VIS, check with me first.

Actually I do. If you want, you can do it (I am busy with my projects :(. 
If you untar the file from VIS homepage, there should be vis*.il
somewhere. Look at my 'simd.h'. This is the GENERIC interface for SIMD
instructions. You should be able to encode simd.h for UltraSparcs without
any braindead patches. You have to decide if 32-bit word or 64-bit word is
more efficient (I think 32-bit is quicker the last the time tested them). 

Thanks for replying. Hope to hear from you soon.

Hasdi



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

end of thread, other threads:[~1998-03-05 16:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-03-02 20:02 GCC MMX PATCH Hasdi R Hashim
1998-03-03 12:53 ` John Carr
1998-03-05 16:38   ` Hasdi R Hashim
1998-03-05 16:38     ` John Carr
1998-03-03 20:48       ` Hasdi R Hashim

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).