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-9.c] - Blame information for rev 318

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 318 jeremybenn
/* Test whether using target specific options, we can generate FMA4 code.  */
2
/* { dg-do compile } */
3
/* { dg-options "-O2 -march=k8 -mfpmath=sse -msse2" } */
4
/* { dg-require-effective-target sse2 } */
5
 
6
extern void exit (int);
7
 
8
#ifdef __FMA4__
9
#warning "__FMA4__ should not be defined before #pragma GCC target."
10
#endif
11
 
12
#pragma GCC push_options
13
#pragma GCC target ("fma4")
14
 
15
#ifndef __FMA4__
16
#warning "__FMA4__ should have be defined after #pragma GCC target."
17
#endif
18
 
19
float
20
flt_mul_add (float a, float b, float c)
21
{
22
  return (a * b) + c;
23
}
24
 
25
#pragma GCC pop_options
26
#ifdef __FMA4__
27
#warning "__FMA4__ should not be defined after #pragma GCC pop target."
28
#endif
29
 
30
double
31
dbl_mul_add (double a, double b, double c)
32
{
33
  return (a * b) + c;
34
}
35
 
36
/* { dg-final { scan-assembler "vfmaddss" } } */
37
/* { dg-final { scan-assembler "addsd" } } */

powered by: WebSVN 2.1.0

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