Jun 14, 2006

AMD64 FreeBSD/amd64 [computer]

ためしに入れてみた。コメントなしで結果だけ書いてみるか。

  • 変数のサイズ
  • #include 
    main()
    {
        printf("size of short %d\n",sizeof(short));
        printf("size of int %d\n",sizeof(int));
        printf("size of long %d\n",sizeof(long));
        printf("size of long long %d\n",sizeof(long long));
        printf("size of int* %d\n",sizeof(int *));
    }
    
    実行結果(gcc 3.4.4)
    size of short 2
    size of int 4
    size of long 8
    size of long long 8
    size of int* 8
    

    AMD64のアーキテクチャに沿ったサイズになっている(アドレス/レジスタ幅64bit, オペランドの「標準」は32bit)。ちなみにFreeBSD/i386の場合は

    size of short 2
    size of int 4
    size of long 4
    size of long long 8
    size of int* 4
    

  • ベンチマーク (on Athlon64 3000+)
    1. BYTEmark* Native Mode Benchmark ver. 2
    2. OS:amd64
      
      NUMERIC SORT        :          1458.9  :      37.41  :      12.29
      STRING SORT         :          139.92  :      62.52  :       9.68
      BITFIELD            :      2.9492e+08  :      50.59  :      10.57
      FP EMULATION        :          103.81  :      49.81  :      11.49
      FOURIER             :           13508  :      15.36  :       8.63
      ASSIGNMENT          :          16.862  :      64.16  :      16.64
      IDEA                :          2727.2  :      41.71  :      12.38
      HUFFMAN             :          1219.5  :      33.82  :      10.80
      NEURAL NET          :          21.224  :      34.09  :      14.34
      LU DECOMPOSITION    :          885.04  :      45.85  :      33.11
      
      OS:i386
      
      NUMERIC SORT        :          944.34  :      24.22  :       7.95
      STRING SORT         :          107.37  :      47.98  :       7.43
      BITFIELD            :      2.7574e+08  :      47.30  :       9.88
      FP EMULATION        :          65.393  :      31.38  :       7.24
      FOURIER             :           11638  :      13.24  :       7.43
      ASSIGNMENT          :          15.945  :      60.67  :      15.74
      IDEA                :          1934.5  :      29.59  :       8.78
      HUFFMAN             :          986.52  :      27.36  :       8.74
      NEURAL NET          :          21.945  :      35.25  :      14.83
      LU DECOMPOSITION    :          633.44  :      32.82  :      23.70
      

    3. Byte Magazine Unix Benchmark v4.1
    4. Execl Throughputのテストで計測できていない原因は未調査。

      OS:amd64
      TEST                                        BASELINE     RESULT      INDEX
      Dhrystone 2 using register variables        116700.0  8744247.9      749.3
      Double-Precision Whetstone                      55.0     1545.9      281.1
      Execl Throughput                                43.0        0.0        0.0
      File Copy 1024 bufsize 2000 maxblocks         3960.0    44676.0      112.8
      File Copy 256 bufsize 500 maxblocks           1655.0    57829.0      349.4
      File Copy 4096 bufsize 8000 maxblocks         5800.0    51758.0       89.2
      Pipe Throughput                              12440.0  1074387.4      863.7
      Pipe-based Context Switching                  4000.0    98492.8      246.2
      Process Creation                               126.0     6147.5      487.9
      Shell Scripts (8 concurrent)                     6.0      413.0      688.3
      System Call Overhead                         15000.0   762604.4      508.4
      
      OS:i386
      TEST                                        BASELINE     RESULT      INDEX
      Dhrystone 2 using register variables        116700.0  4953397.6      424.5
      Double-Precision Whetstone                      55.0     1152.3      209.5
      Execl Throughput                                43.0     1705.5      396.6
      File Copy 1024 bufsize 2000 maxblocks         3960.0    35398.0       89.4
      File Copy 256 bufsize 500 maxblocks           1655.0    44593.0      269.4
      File Copy 4096 bufsize 8000 maxblocks         5800.0    33957.0       58.5
      Pipe Throughput                              12440.0   905198.1      727.7
      Pipe-based Context Switching                  4000.0   119026.8      297.6
      Process Creation                               126.0     7162.6      568.5
      Shell Scripts (8 concurrent)                     6.0      301.0      501.7
      System Call Overhead                         15000.0   632584.6      421.7
      

    5. pari/gp(2.3.0)の make dobench
    6. ついでに計ってみた。amd64の方ではスタティックライブラリを使用した場合の 結果は出ていない

      Making dobench in Ofreebsd-amd64
      * Testing objets        for gp-dyn..TIME=2
      * Testing analyz        for gp-dyn..TIME=48
      * Testing number        for gp-dyn..TIME=50
      * Testing polyser       for gp-dyn..TIME=12
      * Testing linear        for gp-dyn..TIME=7
      * Testing elliptic      for gp-dyn..TIME=23
      * Testing sumiter       for gp-dyn..TIME=56
      * Testing graph         for gp-dyn..TIME=15
      * Testing program       for gp-dyn..TIME=22
      * Testing trans         for gp-dyn..TIME=85
      * Testing nfields       for gp-dyn..TIME=250
      +++ Total bench for gp-dyn is 370
      
      Making dobench in Ofreebsd-i386
      * Testing objets        for gp-sta..TIME=2      for gp-dyn..TIME=3
      * Testing analyz        for gp-sta..TIME=65     for gp-dyn..TIME=66
      * Testing number        for gp-sta..TIME=44     for gp-dyn..TIME=46
      * Testing polyser       for gp-sta..TIME=12     for gp-dyn..TIME=15
      * Testing linear        for gp-sta..TIME=22     for gp-dyn..TIME=24
      * Testing elliptic      for gp-sta..TIME=33     for gp-dyn..TIME=37
      * Testing sumiter       for gp-sta..TIME=34     for gp-dyn..TIME=35
      * Testing graph         for gp-sta..TIME=16     for gp-dyn..TIME=18
      * Testing program       for gp-sta..TIME=37     for gp-dyn..TIME=39
      * Testing trans         for gp-sta..TIME=125    for gp-dyn..TIME=121
      * Testing nfields       for gp-sta..TIME=326    for gp-dyn..TIME=345
      +++ Total bench for gp-sta is 455
      +++ Total bench for gp-dyn is 473
      

    AMD64の64bitモードではレジスタの構成が変わること、浮動小数点演算のデータ長さ、命令セットがSSE系に変わること等大きなアーキテクチャ上の違いがあるので簡単には比較できない。

    レジスタ退避を伴う処理では遅くなることもある。動かなくなるプログラムもある。

Posted at 02:10 in computer

Archives
Powered by
blosxom 2.0
and
modified by
blosxom starter kit