annotate run/f/float_27_A.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 b8c0195059d9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
560
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
1 // $HeadURL$
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
2 // $Date$
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
3 // $Author$
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
4
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
5 // @author@ Nick <Nick_member@pathlink.com>
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
6 // @date@ 2005-05-25
1489
b8c0195059d9 changed nntp: URLs to http: URLs
thomask
parents: 560
diff changeset
7 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=4162
560
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
8
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
9 module dstress.run.f.float_27_A;
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
10
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
11 int main(){
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
12 static float[] params = [1,3,5];
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
13
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
14 float[] sums = new float[3];
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
15 sums[] = 0;
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
16
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
17 foreach(float d; params){
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
18 float prod = d;
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
19
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
20 for(int i; i<2; i++){
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
21 sums[i] += prod;
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
22 prod *= d;
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
23 }
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
24 sums[2] += prod;
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
25 }
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
26
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
27 assert(sums[0]==9);
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
28 assert(sums[1]==35);
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
29 assert(sums[2]==153);
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
30
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
31 return 0;
dc5ce97dab82 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
32 }