Back to index

cell-binutils  2.17cvs20070401
score-datadep.h
Go to the documentation of this file.
00001 /* score-datadep.h -- Score Instructions data dependency table
00002    Copyright 2006 Free Software Foundation, Inc.
00003    Contributed by: 
00004    Mei Ligang (ligang@sunnorth.com.cn)
00005    Pei-Lin Tsai (pltsai@sunplus.com)
00006 
00007    This file is part of GAS, the GNU Assembler.
00008 
00009    GAS is free software; you can redistribute it and/or modify
00010    it under the terms of the GNU General Public License as published by
00011    the Free Software Foundation; either version 2, or (at your option)
00012    any later version.
00013 
00014    GAS is distributed in the hope that it will be useful,
00015    but WITHOUT ANY WARRANTY; without even the implied warranty of
00016    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017    GNU General Public License for more details.
00018 
00019    You should have received a copy of the GNU General Public License
00020    along with GAS; see the file COPYING.  If not, write to the Free
00021    Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
00022    Boston, MA 02110-1301, USA.  */
00023 
00024 #ifndef SCORE_DATA_DEPENDENCY_H
00025 #define SCORE_DATA_DEPENDENCY_H
00026 
00027 #define INSN_NAME_LEN 16
00028 
00029 enum insn_type_for_dependency
00030 {
00031   D_pce,
00032   D_cond_br,
00033   D_cond_mv,
00034   D_cached,
00035   D_cachei,
00036   D_ldst,
00037   D_ldcombine,
00038   D_mtcr,
00039   D_mfcr,
00040   D_mfsr,
00041   D_mftlb,
00042   D_mtptlb,
00043   D_mtrtlb,
00044   D_stlb,
00045   D_all_insn
00046 };
00047 
00048 struct insn_to_dependency
00049 {
00050   char *insn_name;
00051   enum insn_type_for_dependency type;
00052 };
00053 
00054 struct data_dependency
00055 {
00056   enum insn_type_for_dependency pre_insn_type;
00057   char pre_reg[6];
00058   enum insn_type_for_dependency cur_insn_type;
00059   char cur_reg[6];
00060   int bubblenum_7;
00061   int bubblenum_5;
00062   int warn_or_error;           /* warning - 0; error - 1  */
00063 };
00064 
00065 static const struct insn_to_dependency insn_to_dependency_table[] =
00066 {
00067   /* pce instruction.  */
00068   {"pce",       D_pce},
00069   /* conditional branch instruction.  */
00070   {"bcs",       D_cond_br},
00071   {"bcc",       D_cond_br},
00072   {"bgtu",      D_cond_br},
00073   {"bleu",      D_cond_br},
00074   {"beq",       D_cond_br},
00075   {"bne",       D_cond_br},
00076   {"bgt",       D_cond_br},
00077   {"ble",       D_cond_br},
00078   {"bge",       D_cond_br},
00079   {"blt",       D_cond_br},
00080   {"bmi",       D_cond_br},
00081   {"bpl",       D_cond_br},
00082   {"bvs",       D_cond_br},
00083   {"bvc",       D_cond_br},
00084   {"bcsl",      D_cond_br},
00085   {"bccl",      D_cond_br},
00086   {"bgtul",     D_cond_br},
00087   {"bleul",     D_cond_br},
00088   {"beql",      D_cond_br},
00089   {"bnel",      D_cond_br},
00090   {"bgtl",      D_cond_br},
00091   {"blel",      D_cond_br},
00092   {"bgel",      D_cond_br},
00093   {"bltl",      D_cond_br},
00094   {"bmil",      D_cond_br},
00095   {"bpll",      D_cond_br},
00096   {"bvsl",      D_cond_br},
00097   {"bvcl",      D_cond_br},
00098   {"bcs!",      D_cond_br},
00099   {"bcc!",      D_cond_br},
00100   {"bgtu!",     D_cond_br},
00101   {"bleu!",     D_cond_br},
00102   {"beq!",      D_cond_br},
00103   {"bne!",      D_cond_br},
00104   {"bgt!",      D_cond_br},
00105   {"ble!",      D_cond_br},
00106   {"bge!",      D_cond_br},
00107   {"blt!",      D_cond_br},
00108   {"bmi!",      D_cond_br},
00109   {"bpl!",      D_cond_br},
00110   {"bvs!",      D_cond_br},
00111   {"bvc!",      D_cond_br},
00112   {"brcs",      D_cond_br},
00113   {"brcc",      D_cond_br},
00114   {"brgtu",     D_cond_br},
00115   {"brleu",     D_cond_br},
00116   {"breq",      D_cond_br},
00117   {"brne",      D_cond_br},
00118   {"brgt",      D_cond_br},
00119   {"brle",      D_cond_br},
00120   {"brge",      D_cond_br},
00121   {"brlt",      D_cond_br},
00122   {"brmi",      D_cond_br},
00123   {"brpl",      D_cond_br},
00124   {"brvs",      D_cond_br},
00125   {"brvc",      D_cond_br},
00126   {"brcsl",     D_cond_br},
00127   {"brccl",     D_cond_br},
00128   {"brgtul",    D_cond_br},
00129   {"brleul",    D_cond_br},
00130   {"breql",     D_cond_br},
00131   {"brnel",     D_cond_br},
00132   {"brgtl",     D_cond_br},
00133   {"brlel",     D_cond_br},
00134   {"brgel",     D_cond_br},
00135   {"brltl",     D_cond_br},
00136   {"brmil",     D_cond_br},
00137   {"brpll",     D_cond_br},
00138   {"brvsl",     D_cond_br},
00139   {"brvcl",     D_cond_br},
00140   {"brcs!",     D_cond_br},
00141   {"brcc!",     D_cond_br},
00142   {"brgtu!",    D_cond_br},
00143   {"brleu!",    D_cond_br},
00144   {"breq!",     D_cond_br},
00145   {"brne!",     D_cond_br},
00146   {"brgt!",     D_cond_br},
00147   {"brle!",     D_cond_br},
00148   {"brge!",     D_cond_br},
00149   {"brlt!",     D_cond_br},
00150   {"brmi!",     D_cond_br},
00151   {"brpl!",     D_cond_br},
00152   {"brvs!",     D_cond_br},
00153   {"brvc!",     D_cond_br},
00154   {"brcsl!",    D_cond_br},
00155   {"brccl!",    D_cond_br},
00156   {"brgtul!",   D_cond_br},
00157   {"brleul!",   D_cond_br},
00158   {"breql!",    D_cond_br},
00159   {"brnel!",    D_cond_br},
00160   {"brgtl!",    D_cond_br},
00161   {"brlel!",    D_cond_br},
00162   {"brgel!",    D_cond_br},
00163   {"brltl!",    D_cond_br},
00164   {"brmil!",    D_cond_br},
00165   {"brpll!",    D_cond_br},
00166   {"brvsl!",    D_cond_br},
00167   {"brvcl!",    D_cond_br},
00168   /* conditional move instruction.  */
00169   {"mvcs",      D_cond_mv},
00170   {"mvcc",      D_cond_mv},
00171   {"mvgtu",     D_cond_mv},
00172   {"mvleu",     D_cond_mv},
00173   {"mveq",      D_cond_mv},
00174   {"mvne",      D_cond_mv},
00175   {"mvgt",      D_cond_mv},
00176   {"mvle",      D_cond_mv},
00177   {"mvge",      D_cond_mv},
00178   {"mvlt",      D_cond_mv},
00179   {"mvmi",      D_cond_mv},
00180   {"mvpl",      D_cond_mv},
00181   {"mvvs",      D_cond_mv},
00182   {"mvvc",      D_cond_mv},
00183   /* move spectial instruction.  */
00184   {"mtcr",      D_mtcr},
00185   {"mftlb",     D_mftlb},
00186   {"mtptlb",    D_mtptlb},
00187   {"mtrtlb",    D_mtrtlb},
00188   {"stlb",      D_stlb},
00189   {"mfcr",      D_mfcr},
00190   {"mfsr",      D_mfsr},
00191   /* cache instruction.  */
00192   {"cache 8",   D_cached},
00193   {"cache 9",   D_cached},
00194   {"cache 10",  D_cached},
00195   {"cache 11",  D_cached},
00196   {"cache 12",  D_cached},
00197   {"cache 13",  D_cached},
00198   {"cache 14",  D_cached},
00199   {"cache 24",  D_cached},
00200   {"cache 26",  D_cached},
00201   {"cache 27",  D_cached},
00202   {"cache 29",  D_cached},
00203   {"cache 30",  D_cached},
00204   {"cache 31",  D_cached},
00205   {"cache 0",   D_cachei},
00206   {"cache 1",   D_cachei},
00207   {"cache 2",   D_cachei},
00208   {"cache 3",   D_cachei},
00209   {"cache 4",   D_cachei},
00210   {"cache 16",  D_cachei},
00211   {"cache 17",  D_cachei},
00212   /* load/store instruction.  */
00213   {"lb",        D_ldst},
00214   {"lbu",       D_ldst},
00215   {"lbu!",      D_ldst},
00216   {"lbup!",     D_ldst},
00217   {"lh",        D_ldst},
00218   {"lhu",       D_ldst},
00219   {"lh!",       D_ldst},
00220   {"lhp!",      D_ldst},
00221   {"lw",        D_ldst},
00222   {"lw!",       D_ldst},
00223   {"lwp!",      D_ldst},
00224   {"sb",        D_ldst},
00225   {"sb!",       D_ldst},
00226   {"sbp!",      D_ldst},
00227   {"sh",        D_ldst},
00228   {"sh!",       D_ldst},
00229   {"shp!",      D_ldst},
00230   {"sw",        D_ldst},
00231   {"sw!",       D_ldst},
00232   {"swp!",      D_ldst},
00233   {"alw",       D_ldst},
00234   {"asw",       D_ldst},
00235   {"push!",     D_ldst},
00236   {"pushhi!",   D_ldst},
00237   {"pop!",      D_ldst},
00238   {"pophi!",    D_ldst},
00239   {"ldc1",      D_ldst},
00240   {"ldc2",      D_ldst},
00241   {"ldc3",      D_ldst},
00242   {"stc1",      D_ldst},
00243   {"stc2",      D_ldst},
00244   {"stc3",      D_ldst},
00245   {"scb",       D_ldst},
00246   {"scw",       D_ldst},
00247   {"sce",       D_ldst},
00248   /* load combine instruction.  */
00249   {"lcb",       D_ldcombine},
00250   {"lcw",       D_ldcombine},
00251   {"lce",       D_ldcombine},
00252 };
00253 
00254 static const struct data_dependency data_dependency_table[] =
00255 {
00256   /* Condition register.  */
00257   {D_mtcr, "cr1", D_pce, "", 2, 1, 1},
00258   {D_mtcr, "cr1", D_cond_br, "", 1, 0, 1},
00259   {D_mtcr, "cr1", D_cond_mv, "", 1, 0, 1},
00260   /* Status regiser.  */
00261   {D_mtcr, "cr0", D_all_insn, "", 5, 4, 0},
00262   /* CCR regiser.  */
00263   {D_mtcr, "cr4", D_all_insn, "", 6, 5, 0},
00264   /* EntryHi/EntryLo register.  */
00265   {D_mftlb, "", D_mtptlb, "", 1, 1, 1},
00266   {D_mftlb, "", D_mtrtlb, "", 1, 1, 1},
00267   {D_mftlb, "", D_stlb, "", 1, 1,1},
00268   {D_mftlb, "", D_mfcr, "cr11", 1, 1, 1},
00269   {D_mftlb, "", D_mfcr, "cr12", 1, 1, 1},
00270   /* Index register.  */
00271   {D_stlb, "", D_mtptlb, "", 1, 1, 1},
00272   {D_stlb, "", D_mftlb, "", 1, 1, 1},
00273   {D_stlb, "", D_mfcr, "cr8", 2, 2, 1},
00274   /* Cache.  */
00275   {D_cached, "", D_ldst, "", 1, 1, 0},
00276   {D_cached, "", D_ldcombine, "", 1, 1, 0},
00277   {D_cachei, "", D_all_insn, "", 5, 4, 0},
00278   /* Load combine.  */
00279   {D_ldcombine, "", D_mfsr, "sr1", 3, 3, 1},
00280 };
00281 
00282 #endif