OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [i386/] [funcspec-1.c] - Blame information for rev 327

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 318 jeremybenn
/* Test whether using target specific options, we can generate SSE2 code on
2
   32-bit, which does not generate SSE2 by default, but still generate 387 code
3
   for a function that doesn't use attribute((option)).  */
4
/* { dg-do compile } */
5
/* { dg-require-effective-target ilp32 } */
6
/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=i386" } } */
7
/* { dg-options "-O3 -ftree-vectorize -march=i386" } */
8
/* { dg-final { scan-assembler "addps\[ \t\]" } } */
9
/* { dg-final { scan-assembler "fsubs\[ \t\]" } } */
10
 
11
#ifndef SIZE
12
#define SIZE 1024
13
#endif
14
 
15
static float a[SIZE] __attribute__((__aligned__(16)));
16
static float b[SIZE] __attribute__((__aligned__(16)));
17
static float c[SIZE] __attribute__((__aligned__(16)));
18
 
19
void sse_addnums (void) __attribute__ ((__target__ ("sse2")));
20
 
21
void
22
sse_addnums (void)
23
{
24
  int i = 0;
25
  for (; i < SIZE; ++i)
26
    a[i] = b[i] + c[i];
27
}
28
 
29
void
30
i387_subnums (void)
31
{
32
  int i = 0;
33
  for (; i < SIZE; ++i)
34
    a[i] = b[i] - c[i];
35
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.