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.4 by gbeauche, 2003-03-13T15:57:01Z vs.
Revision 1.7 by gbeauche, 2004-11-08T21:10:46Z

# Line 4 | Line 4
4   *  Based on work Copyright 1995, 1996 Bernd Schmidt
5   *  Changes for UAE-JIT Copyright 2000 Bernd Meyer
6   *
7 < *  Adaptation for Basilisk II and improvements, copyright 2000-2002
7 > *  Adaptation for Basilisk II and improvements, copyright 2000-2004
8   *    Gwenole Beauchesne
9   *
10 < *  Basilisk II (C) 1997-2002 Christian Bauer
10 > *  Basilisk II (C) 1997-2004 Christian Bauer
11   *  
12   *  This program is free software; you can redistribute it and/or modify
13   *  it under the terms of the GNU General Public License as published by
# 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
44  
45   int hack_opcode;
46  
# Line 53 | Line 52 | static int global_cmov;
52   static int long_opcode;
53   static int global_mayfail;
54   static int global_fpu;
56 static int global_setzflg;
55  
56   static char endstr[1000];
57   static char lines[100000];
# Line 1088 | Line 1086 | genflags (flagtypes type, wordsizes size
1086        
1087       case flag_addx:
1088       case flag_subx:
1091        uses_setzflg;
1089          uses_cmov;
1090          comprintf("\tdont_care_flags();\n");
1091          {
# Line 1103 | Line 1100 | genflags (flagtypes type, wordsizes size
1100                        "\tint one=scratchie++;\n"
1101                        "\tif (needed_flags&FLAG_Z) {\n"
1102                        "\tmov_l_ri(zero,0);\n"
1103 <                      "\tmov_l_ri(one,1);\n"
1103 >                      "\tmov_l_ri(one,-1);\n"
1104                        "\tmake_flags_live();\n"
1105                        "\tcmov_l_rr(zero,one,5);\n"
1106                        "\t}\n");
# Line 1123 | Line 1120 | genflags (flagtypes type, wordsizes size
1120                            "\t%s_l(%s,%s);\n",op,dst,src);
1121                  break;
1122              }
1123 +            comprintf("\tlive_flags();\n");
1124              comprintf("\tif (needed_flags&FLAG_Z) {\n"
1125                        "\tcmov_l_rr(zero,one,5);\n"
1126 <                      "\tsetzflg_l(zero);\n"
1126 >                      "\tset_zero(zero, one);\n" /* No longer need one */
1127 >                      "\tlive_flags();\n"
1128                        "\t}\n");
1130            comprintf("\tlive_flags();\n");
1129              comprintf("\tend_needflags();\n");
1130              duplicate_carry();
1131              comprintf("if (!(needed_flags & FLAG_CZNV)) dont_care_flags();\n");
# Line 1367 | Line 1365 | gen_opcode (unsigned long int opcode)
1365          genamode (curi->dmode, "dstreg", curi->size, "dst", 1, 0);
1366          start_brace();
1367          comprintf("\tint s=scratchie++;\n"
1368 +                  "\tint tmp=scratchie++;\n"
1369                    "\tmov_l_rr(s,src);\n");
1370          if (curi->size == sz_byte)
1371              comprintf("\tand_l_ri(s,7);\n");
# Line 1382 | Line 1381 | gen_opcode (unsigned long int opcode)
1381               case i_BCLR: op="btr"; break;
1382               case i_BSET: op="bts"; break;
1383               case i_BTST: op="bt"; need_write=0; break;
1384 +            default: abort();
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, -1 otherwise */
1388                                    "\tmake_flags_live();\n" /* Get the flags back */
1389                                    "\tdont_care_flags();\n",op);
1390                  if (!noflags) {
1391                  uses_setzflg;
1391                    comprintf("\tstart_needflags();\n"
1392 <                                        "\tsetzflg_l(s);\n"
1392 >                                        "\tset_zero(s,tmp);\n"
1393                                          "\tlive_flags();\n"
1394                                          "\tend_needflags();\n");
1395                  }
# Line 2946 | Line 2945 | generate_one_opcode (int rp, int noflags
2945          if (global_isaddx)      flags|=8;
2946          if (global_iscjump)     flags|=16;
2947          if (global_fpu)         flags|=32;
2949        if (global_setzflg)     flags|=64;
2948          
2949          comprintf ("}\n");
2950      

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines