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

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [gcc.target/] [i386/] [ssefn-4.c] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
/* Execution test for argument passing with SSE2 and local functions
2
   Written by Paolo Bonzini, 25 January 2005 */
3
 
4
/* { dg-do run { target i?86-*-* x86_64-*-* } } */
5
/* { dg-options "-O2 -msse2 -mfpmath=sse" } */
6
#include <assert.h>
7
#include "../../gcc.dg/i386-cpuid.h"
8
 
9
static float xs (void)
10
{
11
  return 3.14159265;
12
}
13
 
14
float ys (float a)
15
{
16
  return xs () * a;
17
}
18
 
19
static double xd (void)
20
{
21
  return 3.1415926535;
22
}
23
 
24
double yd (double a)
25
{
26
  return xd () * a;
27
}
28
 
29
int main()
30
{
31
  unsigned long cpu_facilities;
32
 
33
  cpu_facilities = i386_cpuid ();
34
 
35
  if (cpu_facilities & bit_SSE2)
36
    {
37
      assert (ys (1) == xs ());
38
      assert (ys (2) == xs () * 2);
39
      assert (yd (1) == xd ());
40
      assert (yd (2) == xd () * 2);
41
    }
42
  return 0;
43
}

powered by: WebSVN 2.1.0

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