Re: compilers using MMX instructions in the generated code

lindahl@pbm.com (Greg Lindahl)
12 Jan 2000 03:40:08 -0500

          From comp.compilers

Related articles
compilers using MMX instructions in the generated code ramkik@sasi.com (Ramkishor) (2000-01-06)
Re: compilers using MMX instructions in the generated code bcombee@metrowerks.com (2000-01-09)
Re: compilers using MMX instructions in the generated code jkahrs@castor.atlas.de (Juergen Kahrs) (2000-01-09)
Re: compilers using MMX instructions in the generated code Milind.Girkar@intel.com (Milind Girkar) (2000-01-09)
Re: compilers using MMX instructions in the generated code plakal@cs.wisc.edu (2000-01-09)
Re: compilers using MMX instructions in the generated code lindahl@pbm.com (2000-01-12)
Re: compilers using MMX instructions in the generated code olefevre@my-deja.com (2000-01-12)
Re: compilers using MMX instructions in the generated code mlross@jf.intel.com (2000-01-12)
Re: compilers using MMX instructions in the generated code andi@complang.tuwien.ac.at (2000-01-15)
Re: compilers using MMX instructions in the generated code bcombee@metrowerks.com (2000-01-19)
Re: compilers using MMX instructions in the generated code lindahl@pbm.com (2000-01-19)
Re: compilers using MMX instructions in the generated code a.richards@computer.org (Andrew Richards) (2000-01-23)
[2 later articles]
| List of all articles for this month |
From: lindahl@pbm.com (Greg Lindahl)
Newsgroups: comp.compilers
Date: 12 Jan 2000 03:40:08 -0500
Organization: a guest of Shadow Island Games
References: 00-01-017
Keywords: architecture, optimize

bcombee@metrowerks.com (Ben Combee) writes:


> There are limitations... I used global arrays on purpose here -- we do
> not yet support the ISO C 1999 keyword "restrict" that would let you
> give the compiler enough information to know that the b and c arrays
> did not alias with array a, so if you passed the arrays in as
> parameters, we would not attempt the vectorization.


You also didn't mention the alignment restrictions. Isn't it the case
that the inputs need to be 128-bit aligned? So if you don't know the
alignment at compile-time, or the alignment happens to be unfortunate,
you're out of luck. Consider:


short int a1[50], a2[50], b[50], c[50];


void foo(void)
{
        int i;
        for (i = 0; i < 50; i++) a1[i] = b[i] + c[i];
        for (i = 0; i < 49; i++) a2[i] = b[i+1] + c[i];
}


In this example, I don't think you can vectorize both loops.


-- g


Post a followup to this message

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