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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [fma4-builtin.c] - Blame information for rev 695

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

Line No. Rev Author Line
1 691 jeremybenn
/* Test that the compiler properly generates floating point multiply
2
   and add instructions FMA4 systems.  */
3
 
4
/* { dg-do compile { target { ! { ia32 } } } } */
5
/* { dg-options "-O2 -mfma4" } */
6
 
7
#ifndef __FP_FAST_FMAF
8
# error "__FP_FAST_FMAF should be defined"
9
#endif
10
#ifndef __FP_FAST_FMA
11
# error "__FP_FAST_FMA should be defined"
12
#endif
13
 
14
float
15
flt_mul_add (float a, float b, float c)
16
{
17
  return __builtin_fmaf (a, b, c);
18
}
19
 
20
double
21
dbl_mul_add (double a, double b, double c)
22
{
23
  return __builtin_fma (a, b, c);
24
}
25
 
26
float
27
flt_mul_sub (float a, float b, float c)
28
{
29
  return __builtin_fmaf (a, b, -c);
30
}
31
 
32
double
33
dbl_mul_sub (double a, double b, double c)
34
{
35
  return __builtin_fma (a, b, -c);
36
}
37
 
38
float
39
flt_neg_mul_add_1 (float a, float b, float c)
40
{
41
  return __builtin_fmaf (-a, b, c);
42
}
43
 
44
double
45
dbl_neg_mul_add_1 (double a, double b, double c)
46
{
47
  return __builtin_fma (-a, b, c);
48
}
49
 
50
float
51
flt_neg_mul_add_2 (float a, float b, float c)
52
{
53
  return __builtin_fmaf (a, -b, c);
54
}
55
 
56
double
57
dbl_neg_mul_add_2 (double a, double b, double c)
58
{
59
  return __builtin_fma (a, -b, c);
60
}
61
 
62
float
63
flt_neg_mul_sub (float a, float b, float c)
64
{
65
  return __builtin_fmaf (-a, b, -c);
66
}
67
 
68
double
69
dbl_neg_mul_sub (double a, double b, double c)
70
{
71
  return __builtin_fma (-a, b, -c);
72
}
73
 
74
/* { dg-final { scan-assembler-times "vfmaddss" 1 } } */
75
/* { dg-final { scan-assembler-times "vfmaddsd" 1 } } */
76
/* { dg-final { scan-assembler-times "vfmsubss" 1 } } */
77
/* { dg-final { scan-assembler-times "vfmsubsd" 1 } } */
78
/* { dg-final { scan-assembler-times "vfnmaddss" 2 } } */
79
/* { dg-final { scan-assembler-times "vfnmaddsd" 2 } } */
80
/* { dg-final { scan-assembler-times "vfnmsubss" 1 } } */
81
/* { dg-final { scan-assembler-times "vfnmsubsd" 1 } } */

powered by: WebSVN 2.1.0

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