URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 318 |
Rev 338 |
/* Test whether using target specific options, we can generate SSE2 code on
|
/* Test whether using target specific options, we can generate SSE2 code on
|
32-bit, which does not generate SSE2 by default, but still generate 387 code
|
32-bit, which does not generate SSE2 by default, but still generate 387 code
|
for a function that doesn't use attribute((option)). */
|
for a function that doesn't use attribute((option)). */
|
/* { dg-do compile } */
|
/* { dg-do compile } */
|
/* { dg-require-effective-target ilp32 } */
|
/* { dg-require-effective-target ilp32 } */
|
/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=i386" } } */
|
/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=i386" } } */
|
/* { dg-options "-O3 -ftree-vectorize -march=i386" } */
|
/* { dg-options "-O3 -ftree-vectorize -march=i386" } */
|
/* { dg-final { scan-assembler "addps\[ \t\]" } } */
|
/* { dg-final { scan-assembler "addps\[ \t\]" } } */
|
/* { dg-final { scan-assembler "fsubs\[ \t\]" } } */
|
/* { dg-final { scan-assembler "fsubs\[ \t\]" } } */
|
|
|
#ifndef SIZE
|
#ifndef SIZE
|
#define SIZE 1024
|
#define SIZE 1024
|
#endif
|
#endif
|
|
|
static float a[SIZE] __attribute__((__aligned__(16)));
|
static float a[SIZE] __attribute__((__aligned__(16)));
|
static float b[SIZE] __attribute__((__aligned__(16)));
|
static float b[SIZE] __attribute__((__aligned__(16)));
|
static float c[SIZE] __attribute__((__aligned__(16)));
|
static float c[SIZE] __attribute__((__aligned__(16)));
|
|
|
void sse_addnums (void) __attribute__ ((__target__ ("sse2")));
|
void sse_addnums (void) __attribute__ ((__target__ ("sse2")));
|
|
|
void
|
void
|
sse_addnums (void)
|
sse_addnums (void)
|
{
|
{
|
int i = 0;
|
int i = 0;
|
for (; i < SIZE; ++i)
|
for (; i < SIZE; ++i)
|
a[i] = b[i] + c[i];
|
a[i] = b[i] + c[i];
|
}
|
}
|
|
|
void
|
void
|
i387_subnums (void)
|
i387_subnums (void)
|
{
|
{
|
int i = 0;
|
int i = 0;
|
for (; i < SIZE; ++i)
|
for (; i < SIZE; ++i)
|
a[i] = b[i] - c[i];
|
a[i] = b[i] - c[i];
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.