Compiler support for MMX instructions (Jacob Navia)
29 Apr 1998 00:59:12 -0400

          From comp.compilers

Related articles
Compiler support for Intel-MMX? (1998-04-15)
Compiler support for MMX instructions (1998-04-29)
| List of all articles for this month |

From: (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 ( 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

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:

The algorithm used for the MMX dot prod is the one recommended by Intel. The
syntax is:
_mmxDdotrPprodiuct(mmxdata *vect1,mmxdata *vect2,int n);
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
93430 Villetaneuse Fax 01

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.