ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/uae_cpu/compiler/gencomp.c
(Generate patch)

Comparing BasiliskII/src/uae_cpu/compiler/gencomp.c (file contents):
Revision 1.3 by gbeauche, 2002-10-03T16:13:46Z vs.
Revision 1.4 by gbeauche, 2003-03-13T15:57:01Z

# Line 41 | Line 41
41   #define uses_cmov               global_cmov=1
42   #define mayfail                 global_mayfail=1
43   #define uses_fpu                global_fpu=1
44 + #define uses_setzflg    global_setzflg=1
45  
46   int hack_opcode;
47  
# Line 52 | Line 53 | static int global_cmov;
53   static int long_opcode;
54   static int global_mayfail;
55   static int global_fpu;
56 + static int global_setzflg;
57  
58   static char endstr[1000];
59   static char lines[100000];
# Line 1086 | Line 1088 | genflags (flagtypes type, wordsizes size
1088        
1089       case flag_addx:
1090       case flag_subx:
1091 +        uses_setzflg;
1092          uses_cmov;
1093          comprintf("\tdont_care_flags();\n");
1094          {
# Line 1122 | Line 1125 | genflags (flagtypes type, wordsizes size
1125              }
1126              comprintf("\tif (needed_flags&FLAG_Z) {\n"
1127                        "\tcmov_l_rr(zero,one,5);\n"
1128 <                      "\tbsf_l_rr(zero,zero);\n"
1128 >                      "\tsetzflg_l(zero);\n"
1129                        "\t}\n");
1130              comprintf("\tlive_flags();\n");
1131              comprintf("\tend_needflags();\n");
# Line 1381 | Line 1384 | gen_opcode (unsigned long int opcode)
1384               case i_BTST: op="bt"; need_write=0; break;
1385              }
1386              comprintf("\t%s_l_rr(dst,s);\n"  /* Answer now in C */
1387 <                      "\tsbb_l(s,s);\n" /* s is 0 if bit was 0,
1388 <                                           -1 otherwise */
1389 <                      "\tmake_flags_live();\n" /* Get the flags back */
1390 <                      "\tdont_care_flags();\n"
1391 <                      "\tstart_needflags();\n"
1392 <                      "\tbsf_l_rr(s,s);\n"
1393 <                      "\tlive_flags();\n"
1394 <                      "\tend_needflags();\n",op);
1387 >                                  "\tsbb_l(s,s);\n" /* s is 0 if bit was 0, -1 otherwise */
1388 >                                  "\tmake_flags_live();\n" /* Get the flags back */
1389 >                                  "\tdont_care_flags();\n",op);
1390 >                if (!noflags) {
1391 >                  uses_setzflg;
1392 >                  comprintf("\tstart_needflags();\n"
1393 >                                        "\tsetzflg_l(s);\n"
1394 >                                        "\tlive_flags();\n"
1395 >                                        "\tend_needflags();\n");
1396 >                }
1397              if (need_write)
1398                  genastore ("dst", curi->dmode, "dstreg", curi->size, "dst");
1399          }
# Line 2941 | Line 2946 | generate_one_opcode (int rp, int noflags
2946          if (global_isaddx)      flags|=8;
2947          if (global_iscjump)     flags|=16;
2948          if (global_fpu)         flags|=32;
2949 +        if (global_setzflg)     flags|=64;
2950          
2951          comprintf ("}\n");
2952      

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines