〔図1〕 コマンドライン・オプションの説明
$ gcc --target-help

:
  -mno-red-zone             Do not use red-zone in the x86-64 code
  -mred-zone                Use red-zone in the x86-64 code
  -m32                      Generate 32bit i386 code
  -m64                      Generate 64bit x86-64 code
  -m96bit-long-double       sizeof(long double) is 12
  -m128bit-long-double      sizeof(long double) is 16
  -mno-sse3                 Do not support MMX, SSE, SSE2 and SSE3 built-in functions and code generation
  -msse3                    Support MMX, SSE, SSE2 and SSE3 built-in functions and code generation
  -mno-sse2                 Do not support MMX, SSE and SSE2 built-in functions and code generation
  -msse2                    Support MMX, SSE and SSE2 built-in functions and code generation
  -mno-sse                  Do not support MMX and SSE built-in functions and code generation
  -msse                     Support MMX and SSE built-in functions and code generation
  -mno-3dnow                Do not support 3DNow! built-in functions
  -m3dnow                   Support 3DNow! built-in functions
  -mno-mmx                  Do not support MMX built-in functions
  -mmmx                     Support MMX built-in functions
  -mno-accumulate-outgoing-  push 
  -maccumulate-outgoing-arg  push 
  -mno-push-args             push 
  -mpush-args                push 
  -mno-inline-all-stringops  inline 
  -minline-all-stringops     inline 
  -mno-align-stringops      
  -malign-stringops         
  -mstack-arg-probe         o
  -momit-leaf-frame-pointer u
  -mfancy-math-387          FPU  sin, cos, sqrt 
  -mno-fancy-math-387       FPU  sin, cos, sqrt 
  -mno-fp-ret-in-387        FPU 
  -mfp-ret-in-387           FPU 
  -mno-ieee-fp               IEEE 
  -mieee-fp                  IEEE 
  -mno-align-double         double  word 
  -malign-double            double  dword 
  -mno-rtd                  
  -mrtd                     
  -mno-soft-float           
  -msoft-float              
  -mhard-float              
  -mno-80387                
  -m80387                   
  -mtls-dialect=            Use given thread-local storage dialect
  -masm=                    Use given assembler dialect
  -mcmodel=                 Use given x86-64 code model
  -mbranch-cost=             (1-5, )
  -mpreferred-stack-boundar 
  -malign-functions=        
  -malign-jumps=            
  -malign-loops=            
  -mregparm=                
  -march=                    CPU 
  -mfpmath=                 Generate floating point mathematics using given instruction set
  -mcpu=                     CPU 


  -Q                      ignored
  -V                      print assembler version number
  -k                      ignored
  -n                      Do not optimize code alignment
  -q                      quieten some warnings
  -s                      ignored
elf_i386: 
  -Bgroup               Selects group name lookup rules for DSO
  --disable-new-dtags   Disable new dynamic tags
  --enable-new-dtags    Enable new dynamic tags
  --eh-frame-hdr        Create .eh_frame_hdr section
  -z combreloc          Merge dynamic relocs into one section and sort
  -z defs               Report unresolved symbols in object files.
  -z execstack          Mark executable as requiring executable stack
  -z initfirst          Mark DSO to be initialized first at runtime
  -z interpose          Mark object to interpose all DSOs but executable
  -z loadfltr           Mark object requiring immediate process
  -z muldefs            Allow multiple definitions
  -z nocombreloc        Don't merge dynamic relocs into one section
  -z nocopyreloc        Don't create copy relocs
  -z nodefaultlib       Mark object not to use default search paths
  -z nodelete           Mark DSO non-deletable at runtime
  -z nodlopen           Mark DSO not available to dlopen
  -z nodump             Mark DSO not available to dldump
  -z noexecstack        Mark executable as not requiring executable stack
  -z norelro            Don't create RELRO program header
  -z now                Mark object non-lazy runtime binding
  -z origin             Mark object requiring immediate $ORIGIN processing
                          at runtime
  -z relro              Create RELRO program header
  -z KEYWORD            Ignored for Solaris compatibility
$ 

$ gcc --target-help

:
  -mno-red-zone             Do not use red-zone in the x86-64 code
  -mred-zone                Use red-zone in the x86-64 code
  -m32                      Generate 32bit i386 code
  -m64                      Generate 64bit x86-64 code
  -m96bit-long-double       sizeof(long double) is 12
  -m128bit-long-double      sizeof(long double) is 16
  -mno-sse3                 Do not support MMX, SSE, SSE2 and SSE3 built-in functions and code generation
  -msse3                    Support MMX, SSE, SSE2 and SSE3 built-in functions and code generation
  -mno-sse2                 Do not support MMX, SSE and SSE2 built-in functions and code generation
  -msse2                    Support MMX, SSE and SSE2 built-in functions and code generation
  -mno-sse                  Do not support MMX and SSE built-in functions and code generation
  -msse                     Support MMX and SSE built-in functions and code generation
  -mno-3dnow                Do not support 3DNow! built-in functions
  -m3dnow                   Support 3DNow! built-in functions
  -mno-mmx                  Do not support MMX built-in functions
  -mmmx                     Support MMX built-in functions
  -mno-accumulate-outgoing-  push 
  -maccumulate-outgoing-arg  push 
  -mno-push-args             push 
  -mpush-args                push 
  -mno-inline-all-stringops  inline 
  -minline-all-stringops     inline 
  -mno-align-stringops      
  -malign-stringops         
  -mstack-arg-probe         o
  -momit-leaf-frame-pointer u
  -mfancy-math-387          FPU  sin, cos, sqrt 
  -mno-fancy-math-387       FPU  sin, cos, sqrt 
  -mno-fp-ret-in-387        FPU 
  -mfp-ret-in-387           FPU 
  -mno-ieee-fp               IEEE 
  -mieee-fp                  IEEE 
  -mno-align-double         double  word 
  -malign-double            double  dword 
  -mno-rtd                  
  -mrtd                     
  -mno-soft-float           
  -msoft-float              
  -mhard-float              
  -mno-80387                
  -m80387                   
  -mtls-dialect=            Use given thread-local storage dialect
  -masm=                    Use given assembler dialect
  -mcmodel=                 Use given x86-64 code model
  -mbranch-cost=             (1-5, )
  -mpreferred-stack-boundar 
  -malign-functions=        
  -malign-jumps=            
  -malign-loops=            
  -mregparm=                
  -march=                    CPU 
  -mfpmath=                 Generate floating point mathematics using given instruction set
  -mcpu=                     CPU 


  -Q                      ignored
  -V                      print assembler version number
  -k                      ignored
  -n                      Do not optimize code alignment
  -q                      quieten some warnings
  -s                      ignored
elf_i386: 
  -Bgroup               Selects group name lookup rules for DSO
  --disable-new-dtags   Disable new dynamic tags
  --enable-new-dtags    Enable new dynamic tags
  --eh-frame-hdr        Create .eh_frame_hdr section
  -z combreloc          Merge dynamic relocs into one section and sort
  -z defs               Report unresolved symbols in object files.
  -z execstack          Mark executable as requiring executable stack
  -z initfirst          Mark DSO to be initialized first at runtime
  -z interpose          Mark object to interpose all DSOs but executable
  -z loadfltr           Mark object requiring immediate process
  -z muldefs            Allow multiple definitions
  -z nocombreloc        Don't merge dynamic relocs into one section
  -z nocopyreloc        Don't create copy relocs
  -z nodefaultlib       Mark object not to use default search paths
  -z nodelete           Mark DSO non-deletable at runtime
  -z nodlopen           Mark DSO not available to dlopen
  -z nodump             Mark DSO not available to dldump
  -z noexecstack        Mark executable as not requiring executable stack
  -z norelro            Don't create RELRO program header
  -z now                Mark object non-lazy runtime binding
  -z origin             Mark object requiring immediate $ORIGIN processing
                          at runtime
  -z relro              Create RELRO program header
  -z KEYWORD            Ignored for Solaris compatibility
$ 


〔図2〕 GCCのヘルプ
$ gcc --help
使い方: gcc [オプション] ファイル...
オプション:
  -pass-exit-codes         フェーズからのエラーコードの最大値を exitコードとして返す
  --help                   このヘルプ情報を表示
  --target-help            ターゲット固有のコマンドラインオプションを表示
('-v --help' を使うと,子プロセスのコマンドラインオプションを表示)
  -dumpspecs               組み込まれた spec 文字列を全て表示
  -dumpversion             コンパイラのバージョンを表示
  -dumpmachine             コンパイラのターゲットプロセッサを表示
  -print-search-dirs       コンパイラのサーチパスにあるディレクトリを表示
  -print-libgcc-file-name  コンパイラのコンパニオンライブラリ名を表示
  -print-file-name=<lib>   ライブラリ <lib> へのフルパスを表示
  -print-prog-name=<prog>  コンパイラの部品 <prog> へのフルパスを表示
  -print-multi-directory   libgcc のバージョンディレクトリルートを表示
  -print-multi-lib         コマンドラインオプションと複数のライブラリ探索ディレクトリとの対応を表示
  -print-multi-os-directory Display the relative path to OS libraries
  -Wa,<options>            カンマ区切りの <options> をアセンブラに渡す
  -Wp,<options>            カンマ区切りの <options> をプリプロセッサに渡す
  -Wl,<options>            カンマ区切りの <options> をリンカに渡す
  -Xlinker <arg>           <arg> をリンカに渡す
  -save-temps              中間ファイルを削除しない
  -pipe                    中間ファイルではなくパイプを使う
  -time                    子プロセスごとの実行時間を計測する
  -specs=<file>            Override built-in specs with the contents of <file>
  -std=<standard>          入力ソースを <standard> と見なす
  -B <directory>           <directory> をコンパイラの探索パスに追加する
  -b <machine>             インストールされていればターゲット <machine> としてgcc を実行する
  -V <version>             インストールされていれば <version> バージョン番号のgcc として実行する
  -v                       コンパイラによって起動されるプログラムを表示
  -###                     Like -v but options quoted and commands not executed
  -E                       プリプロセスのみ -- コンパイル,アセンブル,リンクを行なわない
  -S                       コンパイルのみ -- アセンブル,リンクを行なわない
  -c                       コンパイル,アセンブルするが,リンクを行なわない
  -o <file>                <file> に出力を行なう
  -x <language>            Specify the language of the following input files
                           Permissible languages include: c c++ assembler none
                           'none' means revert to the default behavior of
                           guessing the language based on the file's extension

-g, -f, -m, -O, -W で始まるオプションや,--param は gcc が起動するあらゆる
子プロセスに自動的に渡されます.こういったプロセスにその他のオプションを渡す
には -W<letter> オプションを使わなければなりません.

バグレポートの手順は,以下を参照
<URL:http://bugzilla.redhat.com/bugzilla>.
$ 

〔図3〕 CPUごとにコンパイルし,差分をとる
gcc -S libmng_pixels.c
cp libmng_pixels.s libmng_pixels_def.s
gcc -S -mcpu=i386 libmng_pixels.c
cp libmng_pixels.s libmng_pixels_i386.s
gcc -S -mcpu=i486 libmng_pixels.c
cp libmng_pixels.s libmng_pixels_i486.s
gcc -S -mcpu=i586 libmng_pixels.c
cp libmng_pixels.s libmng_pixels_i586.s
gcc -S -mcpu=i686 libmng_pixels.c
cp libmng_pixels.s libmng_pixels_i686.s
gcc -S -mcpu=pentium libmng_pixels.c
cp libmng_pixels.s libmng_pixels_pentium.s
gcc -S -mcpu=pentium-mmx libmng_pixels.c
cp libmng_pixels.s libmng_pixels_pentium-mmx.s
gcc -S -mcpu=pentiumpro libmng_pixels.c
cp libmng_pixels.s libmng_pixels_pentiumpro.s
gcc -S -mcpu=pentium2 libmng_pixels.c
cp libmng_pixels.s libmng_pixels_pentium2.s
gcc -S -mcpu=pentium3 libmng_pixels.c
cp libmng_pixels.s libmng_pixels_pentium3.s
gcc -S -mcpu=pentium4 libmng_pixels.c
cp libmng_pixels.s libmng_pixels_pentium4.s
gcc -S -mcpu=prescott libmng_pixels.c
cp libmng_pixels.s libmng_pixels_prescott.s
gcc -S -mcpu=nocona libmng_pixels.c
cp libmng_pixels.s libmng_pixels_nocona.s
gcc -S -mcpu=k6 libmng_pixels.c
cp libmng_pixels.s libmng_pixels_k6.s
gcc -S -mcpu=k6-2 libmng_pixels.c
cp libmng_pixels.s libmng_pixels_k6-2.s
gcc -S -mcpu=k6-3 libmng_pixels.c
cp libmng_pixels.s libmng_pixels_k6-3.s
gcc -S -mcpu=athlon libmng_pixels.c
cp libmng_pixels.s libmng_pixels_athlon.s
gcc -S -mcpu=athlon-tbird libmng_pixels.c
cp libmng_pixels.s libmng_pixels_athlon-tbird.s
gcc -S -mcpu=athlon-4 libmng_pixels.c
cp libmng_pixels.s libmng_pixels_athlon-4.s
gcc -S -mcpu=athlon-xp libmng_pixels.c
cp libmng_pixels.s libmng_pixels_athlon-xp.s
gcc -S -mcpu=athlon-mp libmng_pixels.c
cp libmng_pixels.s libmng_pixels_athlon-mp.s
gcc -S -mcpu=winchip-c6 libmng_pixels.c
cp libmng_pixels.s libmng_pixels_winchip-c6.s
gcc -S -mcpu=winchip2 libmng_pixels.c
cp libmng_pixels.s libmng_pixels_winchip2.s
gcc -S -mcpu=c3 libmng_pixels.c
cp libmng_pixels.s libmng_pixels_c3.s
diff libmng_pixels_def.s libmng_pixels_i386.s > 
                                   libmng_pixels_i386.txt
diff libmng_pixels_def.s libmng_pixels_i486.s > 
                                   libmng_pixels_i486.txt
diff libmng_pixels_def.s libmng_pixels_i586.s > 
                                   libmng_pixels_i586.txt
diff libmng_pixels_def.s libmng_pixels_i686.s > 
                                   libmng_pixels_i686.txt
diff libmng_pixels_def.s libmng_pixels_pentium.s > 
                                libmng_pixels_pentium.txt
diff libmng_pixels_def.s libmng_pixels_pentium-mmx.s > 
                            libmng_pixels_pentium-mmx.txt
diff libmng_pixels_def.s libmng_pixels_pentiumpro.s > 
                             libmng_pixels_pentiumpro.txt
diff libmng_pixels_def.s libmng_pixels_pentium2.s > 
                               libmng_pixels_pentium2.txt
diff libmng_pixels_def.s libmng_pixels_pentium3.s > 
                               libmng_pixels_pentium3.txt
diff libmng_pixels_def.s libmng_pixels_pentium4.s > 
                               libmng_pixels_pentium4.txt
diff libmng_pixels_def.s libmng_pixels_prescott.s > 
                               libmng_pixels_prescott.txt
diff libmng_pixels_def.s libmng_pixels_nocona.s > 
                                 libmng_pixels_nocona.txt
diff libmng_pixels_def.s libmng_pixels_k6.s > 
                                     libmng_pixels_k6.txt
diff libmng_pixels_def.s libmng_pixels_k6-2.s > 
                                   libmng_pixels_k6-2.txt
diff libmng_pixels_def.s libmng_pixels_k6-3.s > 
                                   libmng_pixels_k6-3.txt
diff libmng_pixels_def.s libmng_pixels_athlon.s > 
                                 libmng_pixels_athlon.txt
diff libmng_pixels_def.s libmng_pixels_athlon-tbird.s > 
                           libmng_pixels_athlon-tbird.txt
diff libmng_pixels_def.s libmng_pixels_athlon-4.s > 
                               libmng_pixels_athlon-4.txt
diff libmng_pixels_def.s libmng_pixels_athlon-xp.s > 
                              libmng_pixels_athlon-xp.txt
diff libmng_pixels_def.s libmng_pixels_athlon-mp.s > 
                              libmng_pixels_athlon-mp.txt
diff libmng_pixels_def.s libmng_pixels_winchip-c6.s > 
                             libmng_pixels_winchip-c6.txt
diff libmng_pixels_def.s libmng_pixels_winchip2.s > 
                               libmng_pixels_winchip2.txt
diff libmng_pixels_def.s libmng_pixels_c3.s > 
                                     libmng_pixels_c3.txt
NEW記事内インデックス    連載インデックスはこちら   Interfaceのトップ
これまでの補足とIntel386
◆図
◆リスト

Copyright 2005 岸 哲夫

Copyright 1997-2005 CQ Publishing Co.,Ltd.