This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
mmx and gcc
- To: gcc at gcc dot gnu dot org
- Subject: mmx and gcc
- From: Bill Schelter <wfs at math dot utexas dot edu>
- Date: Mon, 4 Oct 1999 12:16:22 -0500
- Reply-to: wfs at fireant dot ma dot utexas dot edu
I have written inline functions and macros for the
mmx and 3dnow instructions, and added code to i386.md
and i386.h to know about the mmx registers, so that people
wanting to utilize these very efficient instructions may do
so.
It all works quite well, and is correct in that I make
the asm statements do all the clobbering. However I still
have a problem that can arise:
1) How do you make movdi do a clobber of all floating point regs?
If you add the clobber to the template using define_expand,
then it wont be recognized by recog_memoized, because that calls
recog with a NULL_PTR into the pnum_clobbers argument, disallowing
the possibility of extra clobbers. And also the compiler will
generate (set (reg:DI n) (mem:DI ..)) (without clobbers)
as it needs to move things in and out of registers.
2) Is there any support for Processor Dependent mode type?
I am currently using DImode as the mode for the arguments
and results and for the mmx registers. It would seem to
be impossible to tell gcc at the current time that a certain
variable should go in mmx registers as opposed to a pair
of ordinary registers. gcc would have to look ahead and
see that the some subsequent usage was in places that constraints
required an MMX reg.
One way I can see around this is if there was another MODE defined, eg
MMXmode, same size etc as DImode. This is similar to the difference
in Float and Int modes. Then the usual type declarations by the
programmer, would indicate what to do. Note the instructions that act
on data in `MMXmode' are quite different from the instructions on
DImode data. The difference is at least as big as between SI and SF.
This combined with the fact that a move into or out of an MMX reg
automatically CLOBBERS all floating point regs, means that you dont
want to just mix in randomly.
William Schelter