annotate run/a/asm_fiadd_01_B.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 03c97933de98
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
856
7b2c5a101190 meta data maintenance
thomask
parents: 699
diff changeset
1 // $HeadURL$
7b2c5a101190 meta data maintenance
thomask
parents: 699
diff changeset
2 // $Date$
7b2c5a101190 meta data maintenance
thomask
parents: 699
diff changeset
3 // $Author$
699
9b960ca15583 extended^ iasm tests (mostly FPU related)
thomask
parents:
diff changeset
4
9b960ca15583 extended^ iasm tests (mostly FPU related)
thomask
parents:
diff changeset
5 module dstress.run.a.asm_fiaddp_01_B;
9b960ca15583 extended^ iasm tests (mostly FPU related)
thomask
parents:
diff changeset
6
989
a468938b0160 inline ASM review
thomask
parents: 958
diff changeset
7 version(D_InlineAsm_X86){
a468938b0160 inline ASM review
thomask
parents: 958
diff changeset
8 version = runTest;
a468938b0160 inline ASM review
thomask
parents: 958
diff changeset
9 }else version(D_InlineAsm_X86_64){
a468938b0160 inline ASM review
thomask
parents: 958
diff changeset
10 version = runTest;
a468938b0160 inline ASM review
thomask
parents: 958
diff changeset
11 }
a468938b0160 inline ASM review
thomask
parents: 958
diff changeset
12
a468938b0160 inline ASM review
thomask
parents: 958
diff changeset
13 version(runTest){
a468938b0160 inline ASM review
thomask
parents: 958
diff changeset
14 import addon.cpuinfo;
a468938b0160 inline ASM review
thomask
parents: 958
diff changeset
15
a468938b0160 inline ASM review
thomask
parents: 958
diff changeset
16 int main(){
a468938b0160 inline ASM review
thomask
parents: 958
diff changeset
17 haveFPU!()();
a468938b0160 inline ASM review
thomask
parents: 958
diff changeset
18
a468938b0160 inline ASM review
thomask
parents: 958
diff changeset
19 double a = -1.2;
699
9b960ca15583 extended^ iasm tests (mostly FPU related)
thomask
parents:
diff changeset
20 short b = 34;
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
21
699
9b960ca15583 extended^ iasm tests (mostly FPU related)
thomask
parents:
diff changeset
22 asm{
9b960ca15583 extended^ iasm tests (mostly FPU related)
thomask
parents:
diff changeset
23 finit;
9b960ca15583 extended^ iasm tests (mostly FPU related)
thomask
parents:
diff changeset
24 fld a;
9b960ca15583 extended^ iasm tests (mostly FPU related)
thomask
parents:
diff changeset
25 fiadd b;
9b960ca15583 extended^ iasm tests (mostly FPU related)
thomask
parents:
diff changeset
26 fst a;
9b960ca15583 extended^ iasm tests (mostly FPU related)
thomask
parents:
diff changeset
27 }
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
28
989
a468938b0160 inline ASM review
thomask
parents: 958
diff changeset
29 a -= 32.8;
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
30
989
a468938b0160 inline ASM review
thomask
parents: 958
diff changeset
31 a = (a > 0.0) ? a : -a;
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
32
989
a468938b0160 inline ASM review
thomask
parents: 958
diff changeset
33 if(a >= a.epsilon * 16.0){
958
80e1b85295b3 DMD-0.154 review
thomask
parents: 856
diff changeset
34 assert(0);
80e1b85295b3 DMD-0.154 review
thomask
parents: 856
diff changeset
35 }
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
36
699
9b960ca15583 extended^ iasm tests (mostly FPU related)
thomask
parents:
diff changeset
37 return 0;
9b960ca15583 extended^ iasm tests (mostly FPU related)
thomask
parents:
diff changeset
38 }
989
a468938b0160 inline ASM review
thomask
parents: 958
diff changeset
39 }else{
a468938b0160 inline ASM review
thomask
parents: 958
diff changeset
40 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
a468938b0160 inline ASM review
thomask
parents: 958
diff changeset
41 static assert(0);
958
80e1b85295b3 DMD-0.154 review
thomask
parents: 856
diff changeset
42 }