This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
MMX/3DNOW! patch
- To: egcs-patches at cygnus dot com
- Subject: MMX/3DNOW! patch
- From: Hasdi R Hashim <hasdi at bigfoot dot com>
- Date: Sun, 27 Sep 1998 21:31:56 -0400 (EDT)
Hello guys,
I have the MMX/3DNOW patch right here. Sorry for being late. You
can go to http://www.bigfoot.com/~hasdi/mmx for more info. But I am more
interested in getting this into the egcs tree and getting it working
correctly.
There is a bug in expand_builtin_dwarf_reg_size (dwarf2out.c) (see
my old posting in egcs mailing list). I don't really know what it is
trying to do so I disabled the aborts for now. Basically, the checks are
not consistent for the common case and general case.
I moved a lot of C code from i386.md to i386.c. This is for
maintainability and code size efficiency.
MMX support - working but not complete and optimal
----------------------------------------------------
Using -mmmx will enable gcc to recognize mmx registers. You can use
mmx_instrinsics.h to generate mmx code. gcc can use mmx registers as spill
registers (long and long long), which may improve performance. It is not
complete because gcc does not internally generate mmx code for shifts and
logical ops. If MMX registers are used, EMMS is automagically generated
before leaving the function and before calling another function. Using
-mmmx will disable -mhard-float
I have a problem with movdi. In order to move from general register 'r' to
MMX register 'x', I need an extra MMX register. I can't get
(clobber(match_scratch...)) to work. I get loads of inconsistent asm error
when compiling example codes. As it is, to more from 'r' to 'x', you have
to go through memory.
Can somebody take a long at truncdisi2? I couldn't get gcc to use that
particular insn to move mmx register contents to mem:SI. What it does it
moves to a general register "%eax" before truncating it to mem:SI.
xorsi3,iorsi3 and andsi3 can use mmx registers. notso for xordi3,iordi3
and anddi3 because .md instructs gcc to split the contents first. The
shifts can be handled later.
3DNOW! support - experimental.
------------------------------
You can -m3dnow to enable 3dnow instructions. What it does is use FEMMS
instead of EMMS and use MMX registers for floats (plus, minus, mult). The
support is flakey because FP registers are mixed improperly when returning
FP values and pushing FP values. Even then, AFAIK, gas does not support
3dnow instructions.
At this point I have not written 3dnow_intrinsics. Should be straight
forward.
Let me know if you have any problems. I am not in egcs or egcs-patches
(I just read the archives). Feel free to Cc me for MMX-related
discussions. Good luck guys.
Hasdi
http://www.bigfoot.com/~hasdi/mmx
diff -r -u egcs-orig/gcc/config/i386/i386.c egcs/gcc/config/i386/i386.c
[SNIP!]