Related articles |
---|
Compiler support for Intel-MMX? kyoung@newton.ruph.cornell.edu (1998-04-15) |
Compiler support for MMX instructions jacob@jacob.remcomp.fr (1998-04-29) |
From: | jacob@jacob.remcomp.fr (Jacob Navia) |
Newsgroups: | comp.compilers |
Date: | 29 Apr 1998 00:59:12 -0400 |
Organization: | Compilers Central |
References: | 98-04-068 |
Keywords: | arithmetic, optimize |
> Yong-Ke YOUNG Kenneth wrote:
> > Is there compiler that supports dissembling into MMX instructions?
> > More precisely, if I have e.g. a vector dot product that I think will
> > reap significant benefit if I utilize the MMX instruction set, do I
> > have to code by hand or is there a compiler who will do it for me?
>
> From 1996, Intel tried to persuade compiler vendors to start using
> the "intrinsics" approach for MMX. The intrinsics are something
> between the direct C support and inlined assembly: you have a set of C
> "functions" that can be inlined into MMX (or other processor
> extravaganza) instructions. You can ask Koby Gottlieb from Intel
> Israel (gottlieb@iil.intel.com) what are the compilers that use
> intrinsics for MMX. As far as I know, the only compiler that uses MMX
> intrinsics is Intel's own icl (a plug-in for MSVC), look at
> http://developer.intel.com/design/perftool/icl24/.
>
The lcc-win32 compiler will generate an inline dot product using 16 bit data.
This one, and all other MMX instructions are implemented in lcc-win32 as
intrinsics. Source code for the compiler and the intrinsics is available
in the lcc-win32 distribution:
http://www.virginia.edu/~lcc-win32.
The algorithm used for the MMX dot prod is the one recommended by Intel. The
syntax is:
_mmxDdotrPprodiuct(mmxdata *vect1,mmxdata *vect2,int n);
where:
vect1 and vect2 point to 16 bit data. Both vectors should be of equal length.
n is the number of 64 bit numbers to process, i.e. length(vect1)/4
I have added recently, an MMX register display to the debugger, so that you
can follow the MMX instructions. As far as I know lcc-win32's debugger is
the only one to do this.
All other MMX instructions are implemented: padd, psub etc etc. The
documentation can be found at the same URL in the file mmx.doc.
lcc-win32 is a full blown C compiler system for windows 95/NT.
--
Jacob Navia Logiciels/Informatique
41 rue Maurice Ravel Tel 01 48.23.51.44
93430 Villetaneuse Fax 01 48.23.95.39
France
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.