annotate run/ieee_754_zerosdq_04.d @ 1630:d0efa3ae5522 default tip

run/mini/naked_asm5: New x86_64 ABI passes the arguments in reverse order.
author David Nadlinger <code@klickverbot.at>
date Sat, 23 Apr 2011 22:57:32 +0200
parents 660f9196b52a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
496
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
1 // $HeadURL$
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
2 // $Date$
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
3 // $Author$
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
4
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
5 module dstress.run.ieee_754_zerosdq_04;
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
6
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
7 // Check whether IEEE 754 signed zero is correctly supported.
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
8
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
9 union S{
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
10 idouble f;
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
11 uint[2] i;
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
12 }
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
13
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
14 int main(){
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
15 S s;
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
16 s.f=1.0i;
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
17 int top = (s.i[0]==0) ? 1 : 0;
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
18
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
19
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
20 s.f = 0.0i;
1086
7e8e5013a030 gdc-0.19 review
thomask
parents: 496
diff changeset
21 if(s.i[top] != 0x00000000){
7e8e5013a030 gdc-0.19 review
thomask
parents: 496
diff changeset
22 assert(0);
7e8e5013a030 gdc-0.19 review
thomask
parents: 496
diff changeset
23 }
496
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
24
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
25 s.f = -0.0i;
1086
7e8e5013a030 gdc-0.19 review
thomask
parents: 496
diff changeset
26 if(s.i[top] != 0x80000000){
7e8e5013a030 gdc-0.19 review
thomask
parents: 496
diff changeset
27 assert(0);
7e8e5013a030 gdc-0.19 review
thomask
parents: 496
diff changeset
28 }
496
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
29
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
30 s.f = 0.0i - 0.0i;
1086
7e8e5013a030 gdc-0.19 review
thomask
parents: 496
diff changeset
31 if(s.i[top] != 0x00000000){
7e8e5013a030 gdc-0.19 review
thomask
parents: 496
diff changeset
32 assert(0);
7e8e5013a030 gdc-0.19 review
thomask
parents: 496
diff changeset
33 }
496
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
34
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
35 s.f = (-0.0i) - 0.0i;
1086
7e8e5013a030 gdc-0.19 review
thomask
parents: 496
diff changeset
36 if(s.i[top] != 0x80000000){
7e8e5013a030 gdc-0.19 review
thomask
parents: 496
diff changeset
37 assert(0);
7e8e5013a030 gdc-0.19 review
thomask
parents: 496
diff changeset
38 }
496
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
39
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
40 s.f = 0.0i;
1270
660f9196b52a partial review
thomask
parents: 1086
diff changeset
41 s.f *= 1.0;
1086
7e8e5013a030 gdc-0.19 review
thomask
parents: 496
diff changeset
42 if(s.i[top] != 0x00000000){
7e8e5013a030 gdc-0.19 review
thomask
parents: 496
diff changeset
43 assert(0);
7e8e5013a030 gdc-0.19 review
thomask
parents: 496
diff changeset
44 }
496
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
45
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
46 s.f = 0.0i;
1270
660f9196b52a partial review
thomask
parents: 1086
diff changeset
47 s.f *= -1.0;
1086
7e8e5013a030 gdc-0.19 review
thomask
parents: 496
diff changeset
48 if(s.i[top] != 0x80000000){
7e8e5013a030 gdc-0.19 review
thomask
parents: 496
diff changeset
49 assert(0);
7e8e5013a030 gdc-0.19 review
thomask
parents: 496
diff changeset
50 }
496
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
51
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
52 return 0;
e720ce827c1c added IEEE 754 tests for 0-handing
thomask
parents:
diff changeset
53 }