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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [funcspec-9.c] - Blame information for rev 704

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

Line No. Rev Author Line
1 691 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
 
5
extern void exit (int);
6
 
7
#ifdef __FMA4__
8
#warning "__FMA4__ should not be defined before #pragma GCC target."
9
#endif
10
 
11
#pragma GCC push_options
12
#pragma GCC target ("fma4")
13
 
14
#ifndef __FMA4__
15
#warning "__FMA4__ should have be defined after #pragma GCC target."
16
#endif
17
 
18
float
19
flt_mul_add (float a, float b, float c)
20
{
21
  return (a * b) + c;
22
}
23
 
24
#pragma GCC pop_options
25
#ifdef __FMA4__
26
#warning "__FMA4__ should not be defined after #pragma GCC pop target."
27
#endif
28
 
29
double
30
dbl_mul_add (double a, double b, double c)
31
{
32
  return (a * b) + c;
33
}
34
 
35
/* { dg-final { scan-assembler "vfmaddss" } } */
36
/* { 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.