From: | Milind Girkar <Milind.Girkar@intel.com> |
Newsgroups: | comp.compilers |
Date: | 9 Jan 2000 22:50:08 -0500 |
Organization: | Intel |
References: | 00-01-011 |
Keywords: | code |
Check out Intel C/C++ Compiler 4.0 and the upcoming, currently in
beta, Intel C/C++/Fortran Compilers 4.5 (automatic vectorization for
MMX technology instructions and the SIMD single precision floating
point instructions available from Pentium III onwards). The C/C++
compilers are also currently bundled with Intel's VTune, a very good
performance analysis tool to find and optimize hotspots. In addition
to automatic vectorization, the compilers also support vectorization
using directives, intrinsics and inline assembly.
As an example, for the following C loop:
float x; float a[100];
for (i=0; i<100; i++) {
x += a[i];
}
the Intel 4.5 beta compiler will automatically generate with the -QxK
(code for Pentium III) option (only the vectorized part is shown):
xorps xmm0, xmm0
ALIGN 4
$B1$4:
prefetchnta BYTE PTR _a[0+eax*4+64]
addps xmm0, XMMWORD PTR _a[0+eax*4]
addps xmm0, XMMWORD PTR _a[0+eax*4+16]
add eax, 8
cmp eax, 96
jl $B1$4 ; Prob 99%
$B1$5:
movaps xmm1, xmm0
shufps xmm0, xmm0, 14
addps xmm1, xmm0
movaps xmm0, xmm1
shufps xmm1, xmm1, 1
addps xmm0, xmm1
movss DWORD PTR [esp+28], xmm0
- Milind Girkar (working for but not speaking for Intel)
Ramkishor wrote:
> Hai,
> Are there any compilers, which can use MMX instructions(Any SIMD
> instructions like 3DNow from AMD or VIS from SUN etc.) in the code
> generated by them?
Return to the
comp.compilers page.
Search the
comp.compilers archives again.