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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [fma3-builtin-2.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
/* { dg-do compile } */
2
/* { dg-options "-O3 -mfma -mno-fma4 -mtune=generic" } */
3
 
4
#ifndef SIZE
5
#define SIZE 1024
6
#endif
7
 
8
double vda[SIZE] __attribute__((__aligned__(32)));
9
double vdb[SIZE] __attribute__((__aligned__(32)));
10
double vdc[SIZE] __attribute__((__aligned__(32)));
11
double vdd[SIZE] __attribute__((__aligned__(32)));
12
 
13
float vfa[SIZE] __attribute__((__aligned__(32)));
14
float vfb[SIZE] __attribute__((__aligned__(32)));
15
float vfc[SIZE] __attribute__((__aligned__(32)));
16
float vfd[SIZE] __attribute__((__aligned__(32)));
17
 
18
void
19
vector_fma (void)
20
{
21
  int i;
22
 
23
  for (i = 0; i < SIZE; i++)
24
    vda[i] = __builtin_fma (vdb[i], vdc[i], vdd[i]);
25
}
26
 
27
void
28
vector_fms (void)
29
{
30
  int i;
31
 
32
  for (i = 0; i < SIZE; i++)
33
    vda[i] = __builtin_fma (vdb[i], vdc[i], -vdd[i]);
34
}
35
 
36
void
37
vector_fnma (void)
38
{
39
  int i;
40
 
41
  for (i = 0; i < SIZE; i++)
42
    vda[i] = __builtin_fma (-vdb[i], vdc[i], vdd[i]);
43
}
44
 
45
void
46
vector_fnms (void)
47
{
48
  int i;
49
 
50
  for (i = 0; i < SIZE; i++)
51
    vda[i] = __builtin_fma (-vdb[i], vdc[i], -vdd[i]);
52
}
53
 
54
void
55
vector_fmaf (void)
56
{
57
  int i;
58
 
59
  for (i = 0; i < SIZE; i++)
60
    vfa[i] = __builtin_fmaf (vfb[i], vfc[i], vfd[i]);
61
}
62
 
63
void
64
vector_fmsf (void)
65
{
66
  int i;
67
 
68
  for (i = 0; i < SIZE; i++)
69
    vfa[i] = __builtin_fmaf (vfb[i], vfc[i], -vfd[i]);
70
}
71
 
72
void
73
vector_fnmaf (void)
74
{
75
  int i;
76
 
77
  for (i = 0; i < SIZE; i++)
78
    vfa[i] = __builtin_fmaf (-vfb[i], vfc[i], vfd[i]);
79
}
80
 
81
void
82
vector_fnmsf (void)
83
{
84
  int i;
85
 
86
  for (i = 0; i < SIZE; i++)
87
    vfa[i] = __builtin_fmaf (-vfb[i], vfc[i], -vfd[i]);
88
}
89
 
90
/* { dg-final { scan-assembler-times "vfmadd...ps" 1 } } */
91
/* { dg-final { scan-assembler-times "vfmadd...pd" 1 } } */
92
/* { dg-final { scan-assembler-times "vfmsub...ps" 1 } } */
93
/* { dg-final { scan-assembler-times "vfmsub...pd" 1 } } */
94
/* { dg-final { scan-assembler-times "vfnmadd...ps" 1 } } */
95
/* { dg-final { scan-assembler-times "vfnmadd...pd" 1 } } */
96
/* { dg-final { scan-assembler-times "vfnmsub...ps" 1 } } */
97
/* { dg-final { scan-assembler-times "vfnmsub...pd" 1 } } */

powered by: WebSVN 2.1.0

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