annotate run/i/ieee_754_int2flt_G.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 9dcac8d4e97f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
883
e6e610efdba8 added basic float2int and int2float tests
thomask
parents:
diff changeset
1 // $HeadURL$
e6e610efdba8 added basic float2int and int2float tests
thomask
parents:
diff changeset
2 // $Date$
e6e610efdba8 added basic float2int and int2float tests
thomask
parents:
diff changeset
3 // $Author$
e6e610efdba8 added basic float2int and int2float tests
thomask
parents:
diff changeset
4
e6e610efdba8 added basic float2int and int2float tests
thomask
parents:
diff changeset
5 module dstress.run.i.ieee_754_int2flt_G;
e6e610efdba8 added basic float2int and int2float tests
thomask
parents:
diff changeset
6
e6e610efdba8 added basic float2int and int2float tests
thomask
parents:
diff changeset
7 int main(){
e6e610efdba8 added basic float2int and int2float tests
thomask
parents:
diff changeset
8 size_t border;
1091
9dcac8d4e97f post DMD-0.163 review
thomask
parents: 884
diff changeset
9
883
e6e610efdba8 added basic float2int and int2float tests
thomask
parents:
diff changeset
10 if((ulong.sizeof * 8) < real.dig * 3){
e6e610efdba8 added basic float2int and int2float tests
thomask
parents:
diff changeset
11 border = ulong.sizeof * 8;
e6e610efdba8 added basic float2int and int2float tests
thomask
parents:
diff changeset
12 }else{
e6e610efdba8 added basic float2int and int2float tests
thomask
parents:
diff changeset
13 border = real.dig * 3;
e6e610efdba8 added basic float2int and int2float tests
thomask
parents:
diff changeset
14 }
e6e610efdba8 added basic float2int and int2float tests
thomask
parents:
diff changeset
15
e6e610efdba8 added basic float2int and int2float tests
thomask
parents:
diff changeset
16 for(ulong i = 0; i < border; i++){
884
32f8ee5796a1 fixed type safety
thomask
parents: 883
diff changeset
17 ulong test = 1;
32f8ee5796a1 fixed type safety
thomask
parents: 883
diff changeset
18 test <<= i;
883
e6e610efdba8 added basic float2int and int2float tests
thomask
parents:
diff changeset
19 real r = test;
e6e610efdba8 added basic float2int and int2float tests
thomask
parents:
diff changeset
20 ulong result = cast(ulong)r;
e6e610efdba8 added basic float2int and int2float tests
thomask
parents:
diff changeset
21
e6e610efdba8 added basic float2int and int2float tests
thomask
parents:
diff changeset
22 if(result != test){
e6e610efdba8 added basic float2int and int2float tests
thomask
parents:
diff changeset
23 assert(0);
e6e610efdba8 added basic float2int and int2float tests
thomask
parents:
diff changeset
24 }
e6e610efdba8 added basic float2int and int2float tests
thomask
parents:
diff changeset
25 }
e6e610efdba8 added basic float2int and int2float tests
thomask
parents:
diff changeset
26
e6e610efdba8 added basic float2int and int2float tests
thomask
parents:
diff changeset
27 return 0;
e6e610efdba8 added basic float2int and int2float tests
thomask
parents:
diff changeset
28 }