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/] [m256-check.h] - Blame information for rev 328

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

Line No. Rev Author Line
1 318 jeremybenn
#include <immintrin.h>
2
#include "m128-check.h"
3
 
4
#ifndef max
5
#define max(a, b) (((a) > (b)) ? (a):(b))
6
#endif
7
#ifndef min
8
#define min(a, b) (((a) < (b)) ? (a):(b))
9
#endif
10
 
11
typedef union
12
{
13
  __m256i x;
14
  char a[32];
15
} union256i_b;
16
 
17
typedef union
18
{
19
  __m256i x;
20
  short a[16];
21
} union256i_w;
22
 
23
typedef union
24
{
25
  __m256i x;
26
  int a[8];
27
} union256i_d;
28
 
29
typedef union
30
{
31
  __m256i x;
32
  long long a[4];
33
} union256i_q;
34
 
35
typedef union
36
{
37
  __m256 x;
38
  float a[8];
39
} union256;
40
 
41
typedef union
42
{
43
  __m256d x;
44
  double a[4];
45
} union256d;
46
 
47
CHECK_EXP (union256i_b, char, "%d")
48
CHECK_EXP (union256i_w, short, "%d")
49
CHECK_EXP (union256i_d, int, "0x%x")
50
CHECK_EXP (union256i_q, long long, "0x%llx")
51
CHECK_EXP (union256, float, "%f")
52
CHECK_EXP (union256d, double, "%f")
53
 
54
#define CHECK_FP_EXP(UINON_TYPE, VALUE_TYPE, ESP, FMT)          \
55
static int                                                      \
56
__attribute__((noinline, unused))                               \
57
check_fp_##UINON_TYPE (UINON_TYPE u, const VALUE_TYPE *v)       \
58
{                                                               \
59
  int i;                                                        \
60
  int err = 0;                                                   \
61
                                                                \
62
  for (i = 0; i < ARRAY_SIZE (u.a); i++)                 \
63
    if (u.a[i] > (v[i] + (ESP)) || u.a[i] < (v[i] - (ESP)))     \
64
      {                                                         \
65
        err++;                                                  \
66
        PRINTF ("%i: " FMT " != " FMT "\n",                     \
67
                i, v[i], u.a[i]);                               \
68
      }                                                         \
69
  return err;                                                   \
70
}
71
 
72
CHECK_FP_EXP (union256, float, ESP_FLOAT, "%f")
73
CHECK_FP_EXP (union256d, double, ESP_DOUBLE, "%f")

powered by: WebSVN 2.1.0

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