changeset 373:a9bc85fe6702

*** empty log message ***
author kono
date Sun, 11 Jul 2004 13:31:52 +0900
parents 81345636387d
children 9bc42f69f653
files Changes test/const.c test/offset.c
diffstat 3 files changed, 159 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Changes	Sat Jul 10 21:46:21 2004 +0900
+++ b/Changes	Sun Jul 11 13:31:52 2004 +0900
@@ -5700,3 +5700,17 @@
 
 ぐらいでした。
 
+Sun Jul 11 12:54:26 JST 2004
+
+やっぱりlarge offset はうまく動いてないみたいね。
+
+local global table は、12bit offset(+sign 1bit) だから4096/4
+で1000命令毎には出力する必要がある。しかも、既に出力されてい
+るものは、前のを使う必要がある。なるほどね。っていうことは、
+テーブルにそういうフラグをつけないとだめか。(それぐらい
+アセンブラでやってよ〜)
+
+ARMには short ってないのか。short を多用しているプログラムは
+だめなのね。
+
+(でも、どっちかって言うとテスト環境を作る方が難しそう)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/const.c	Sun Jul 11 13:31:52 2004 +0900
@@ -0,0 +1,75 @@
+main()
+{
+    int i;
+    i = 0x0f0f0ff;
+    printf("%x\n",i);
+    i = 0x0f0f0ff<<1;
+    printf("%x\n",i);
+
+i = 0x555<<0; printf("%x\n",i);
+i = 0x555<<1; printf("%x\n",i);
+i = 0x555<<2; printf("%x\n",i);
+i = 0x555<<3; printf("%x\n",i);
+i = 0x555<<4; printf("%x\n",i);
+i = 0x555<<5; printf("%x\n",i);
+i = 0x555<<6; printf("%x\n",i);
+i = 0x555<<7; printf("%x\n",i);
+i = 0x555<<8; printf("%x\n",i);
+i = 0x555<<9; printf("%x\n",i);
+i = 0x555<<10; printf("%x\n",i);
+i = 0x555<<11; printf("%x\n",i);
+i = 0x555<<12; printf("%x\n",i);
+i = 0x555<<13; printf("%x\n",i);
+i = 0x555<<14; printf("%x\n",i);
+i = 0x555<<15; printf("%x\n",i);
+i = 0x555<<16; printf("%x\n",i);
+i = 0x555<<17; printf("%x\n",i);
+i = 0x555<<18; printf("%x\n",i);
+i = 0x555<<19; printf("%x\n",i);
+i = 0x555<<20; printf("%x\n",i);
+i = 0x555<<21; printf("%x\n",i);
+i = 0x555<<22; printf("%x\n",i);
+i = 0x555<<23; printf("%x\n",i);
+i = 0x555<<24; printf("%x\n",i);
+i = 0x555<<25; printf("%x\n",i);
+i = 0x555<<26; printf("%x\n",i);
+i = 0x555<<27; printf("%x\n",i);
+i = 0x555<<28; printf("%x\n",i);
+i = 0x555<<29; printf("%x\n",i);
+i = 0x555<<30; printf("%x\n",i);
+i = 0x555<<31; printf("%x\n",i);
+
+i = 1; printf("%x\n",i);
+i = 3; printf("%x\n",i);
+i = 7; printf("%x\n",i);
+i = 15; printf("%x\n",i);
+i = 31; printf("%x\n",i);
+i = 63; printf("%x\n",i);
+i = 127; printf("%x\n",i);
+i = 255; printf("%x\n",i);
+i = 511; printf("%x\n",i);
+i = 1023; printf("%x\n",i);
+i = 2047; printf("%x\n",i);
+i = 4095; printf("%x\n",i);
+i = 8191; printf("%x\n",i);
+i = 16383; printf("%x\n",i);
+i = 32767; printf("%x\n",i);
+i = 65535; printf("%x\n",i);
+i = 131071; printf("%x\n",i);
+i = 262143; printf("%x\n",i);
+i = 524287; printf("%x\n",i);
+i = 1048575; printf("%x\n",i);
+i = 2097151; printf("%x\n",i);
+i = 4194303; printf("%x\n",i);
+i = 8388607; printf("%x\n",i);
+i = 16777215; printf("%x\n",i);
+i = 33554431; printf("%x\n",i);
+i = 67108863; printf("%x\n",i);
+i = 134217727; printf("%x\n",i);
+i = 268435455; printf("%x\n",i);
+i = 536870911; printf("%x\n",i);
+i = 1073741823; printf("%x\n",i);
+i = 2147483647; printf("%x\n",i);
+i = 4294967295; printf("%x\n",i);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/offset.c	Sun Jul 11 13:31:52 2004 +0900
@@ -0,0 +1,70 @@
+
+#define BIT8 260
+#define BIT10 1030
+#define BIT12 5000
+#define BIT16 (65536*2)
+
+int midium[BIT12];
+int large[BIT16];
+
+main()
+{
+int *p;
+int local_midium[BIT12];
+int local_large[BIT16];
+
+  midium[0]=0x55;
+  large[0]=0x55;
+  local_midium[0]=0x55;
+  local_large[0]=0x55;
+
+  midium[BIT8]=0x50;
+  large[BIT8]=0x50;
+  local_midium[BIT8]=0x50;
+  local_large[BIT8]=0x50;
+
+  midium[BIT10]=0xa0;
+  large[BIT10]=0xa0;
+  local_midium[BIT10]=0xa0;
+  local_large[BIT10]=0xa0;
+
+  midium[BIT12-1]=0xaa;
+  large[BIT16-1]=0xaa;
+  local_midium[BIT12-1]=0xaa;
+  local_large[BIT16-1]=0xaa;
+
+   printf("%x\n", midium[0]);
+   printf("%x\n", large[0]);
+   printf("%x\n", local_midium[0]);
+   printf("%x\n", local_large[0]);
+
+   printf("%x\n", midium[BIT8]);
+   printf("%x\n", large[BIT8]);
+   printf("%x\n", local_midium[BIT8]);
+   printf("%x\n", local_large[BIT8]);
+
+   printf("%x\n", midium[BIT10]);
+   printf("%x\n", large[BIT10]);
+   printf("%x\n", local_midium[BIT10]);
+   printf("%x\n", local_large[BIT10]);
+
+   printf("%x\n", midium[BIT12-1]);
+   printf("%x\n", large[BIT16-1]);
+   printf("%x\n", local_midium[BIT12-1]);
+   printf("%x\n", local_large[BIT16-1]);
+
+   p = local_large+BIT16;
+
+   p[-1] = 0xaa;
+   p[-BIT8] = 0xbb;
+   p[-BIT10] = 0xcc;
+   p[-(BIT12-1)] = 0xdd;
+   p[-(BIT16-1)] = 0xee;
+
+   printf("%x\n", p[-1]);
+   printf("%x\n", p[-BIT8]);
+   printf("%x\n", p[-BIT10]);
+   printf("%x\n", p[BIT12-1]);
+   printf("%x\n", p[BIT16-1]);
+
+}