annotate tools/regs.pl @ 894:989bdd85e8af

a little better zfill
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 06 Apr 2014 16:02:30 +0900
parents e60c3d8dadd6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
466
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
1 # mips .mask pattern
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
2
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
3 @regs = (28,31,16);
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
4 @regs = (31,28,23,22,21,20,19,18,17,16);
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
5 @regs = (21,20);
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
6
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
7 @regs = (31,28);
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
8 @fregs = (20..31);
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
9
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
10 $mask = 0;
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
11 $count = 1;
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
12 grep($mask |= (1<<($_)),@regs);
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
13 grep($count += $_?1:0 ,@regs);
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
14
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
15 $fmask = 0;
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
16 $fcount = 1;
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
17 grep($fmask |= (1<<($_)),@fregs);
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
18 grep($fcount += $_?1:0 ,@fregs);
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
19
724
e60c3d8dadd6 convert to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 466
diff changeset
20 # count のルールは良く分からないね。カウントじゃないみたいだな。
e60c3d8dadd6 convert to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 466
diff changeset
21 # やっぱりregister saveのoffsetみたいだね (gcc によると)
466
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
22 #
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
23
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
24 printf(".mask\t%x,%d\n",$mask,-$count*4);
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
25 printf(".fmask\t%x,%d\n",$fmask,-$fcount*4);
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
26
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
27 # cprestore
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
28 # input variable?
724
e60c3d8dadd6 convert to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 466
diff changeset
29 # call するサブルーチンの整数の引数の数か?
466
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
30
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
31