OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [dfp/] [fe-binop.c] - Blame information for rev 378

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

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-skip-if "test is for emulation" { hard_dfp } { "*" } { "" } } */
2
 
3
/* Touch tests that check for raising appropriate exceptions for binary
4
   arithmetic operations on decimal float values.  */
5
 
6
#include "fe-check.h"
7
 
8
volatile _Decimal32 a32, b32, c32;
9
volatile _Decimal64 a64, b64, c64;
10
volatile _Decimal128 a128, b128, c128;
11
_Decimal32 inf32;
12
_Decimal64 inf64;
13
_Decimal128 inf128;
14
 
15
BINOP (100, /, a32, 2.0df, b32, 0.df, c32, FE_DIVBYZERO)
16
BINOP (101, /, a64, 2.0dd, b64, 0.dd, c64, FE_DIVBYZERO)
17
BINOP (102, /, a128, 2.0dl, b128, 0.dl, c128, FE_DIVBYZERO)
18
 
19
BINOP (200, /, a32, 0.df, b32, 0.df, c32, FE_INVALID)
20
BINOP (201, /, a64, 0.dd, b64, 0.dd, c64, FE_INVALID)
21
BINOP (202, /, a128, 0.dl, b128, 0.dl, c128, FE_INVALID)
22
BINOP (203, /, a32, inf32, b32, inf32, c32, FE_INVALID)
23
BINOP (204, /, a64, inf64, b64, inf64, c64, FE_INVALID)
24
BINOP (205, /, a128, inf128, b128, inf128, c128, FE_INVALID)
25
BINOP (206, *, a32, 0.df, b32, __builtin_infd32(), c32, FE_INVALID)
26
BINOP (207, *, a32, __builtin_infd32(), b32, 0.df, c32, FE_INVALID)
27
BINOP (208, *, a64, 0.df, b64, __builtin_infd64(), c64, FE_INVALID)
28
BINOP (209, *, a64, __builtin_infd64(), b64, 0.df, c64, FE_INVALID)
29
BINOP (210, *, a128, 0.df, b128, __builtin_infd128(), c128, FE_INVALID)
30
BINOP (211, *, a128, __builtin_infd128(), b128, 0.df, c128, FE_INVALID)
31
BINOP (212, +, a32, inf32, b32, -inf32, c32, FE_INVALID)
32
BINOP (213, +, a64, inf64, b64, -inf64, c64, FE_INVALID)
33
BINOP (214, +, a128, inf128, b128, -inf128, c128, FE_INVALID)
34
BINOP (215, -, a32, inf32, b32, inf32, c32, FE_INVALID)
35
BINOP (216, -, a64, inf64, b64, inf64, c64, FE_INVALID)
36
BINOP (217, -, a128, inf128, b128, inf128, c128, FE_INVALID)
37
 
38
BINOP (300, /, a32, 9.9e94df, b32, 1.e-3df, c32, FE_OVERFLOW|FE_INEXACT)
39
BINOP (301, /, a64, 9.9e382dd, b64, 1.e-3dd, c64, FE_OVERFLOW|FE_INEXACT)
40
BINOP (302, /, a128, 9.9e6142dl, b128, 1.e-3dl, c128, FE_OVERFLOW|FE_INEXACT)
41
BINOP (303, +, a32, 9.9e96df, b32, 1.e96df, c32, FE_OVERFLOW|FE_INEXACT)
42
BINOP (304, +, a64, 9.9e384dd, b64, 1.e384dd, c64, FE_OVERFLOW|FE_INEXACT)
43
BINOP (305, +, a128, 9.9e6144dl, b128, 1.e6144dl, c128, FE_OVERFLOW|FE_INEXACT)
44
 
45
BINOP (400, /, a32, 1.e-3df, b32, 9.9e94df, c32, FE_UNDERFLOW|FE_INEXACT)
46
BINOP (401, /, a64, 1.e-3dd, b64, 9.9e382dd, c64, FE_UNDERFLOW|FE_INEXACT)
47
BINOP (402, /, a128, 1.e-3dl, b128, 9.9e6142dl, c128, FE_UNDERFLOW|FE_INEXACT)
48
BINOP (403, *, a32, 1.e-95df, b32, 1.e-7df, c32, FE_UNDERFLOW|FE_INEXACT)
49
BINOP (404, *, a64, 1.e-383dd, b64, 1.e-16dd, c64, FE_UNDERFLOW|FE_INEXACT)
50
BINOP (405, *, a128, 1.e-6143dl, b128, 1.e-34dl, c128, FE_UNDERFLOW|FE_INEXACT)
51
 
52
BINOP (500, /, a32, 1.df, b32, 3.df, c32, FE_INEXACT)
53
BINOP (501, /, a64, 1.dd, b64, 3.dd, c64, FE_INEXACT)
54
BINOP (502, /, a128, 1.dl, b128, 3.dl, c128, FE_INEXACT)
55
 
56
int
57
main ()
58
{
59
  inf32 = __builtin_infd32();
60
  inf64 = __builtin_infd64();
61
  inf128 = __builtin_infd128();
62
 
63
  binop_100 ();
64
  binop_101 ();
65
  binop_102 ();
66
 
67
  binop_200 ();
68
  binop_201 ();
69
  binop_202 ();
70
  binop_203 ();
71
  binop_204 ();
72
  binop_205 ();
73
  binop_206 ();
74
  binop_207 ();
75
  binop_208 ();
76
  binop_209 ();
77
  binop_210 ();
78
  binop_211 ();
79
  binop_212 ();
80
  binop_213 ();
81
  binop_214 ();
82
  binop_215 ();
83
  binop_216 ();
84
  binop_217 ();
85
 
86
  binop_300 ();
87
  binop_301 ();
88
  binop_302 ();
89
  binop_303 ();
90
  binop_304 ();
91
  binop_305 ();
92
 
93
  binop_400 ();
94
  binop_401 ();
95
  binop_402 ();
96
  binop_403 ();
97
  binop_404 ();
98
  binop_405 ();
99
 
100
  binop_500 ();
101
  binop_501 ();
102
  binop_502 ();
103
 
104
  FINISH
105
}

powered by: WebSVN 2.1.0

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