/[gxemul]/trunk/src/cpus/cpu_alpha_instr_alu.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/cpus/cpu_alpha_instr_alu.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 23 by dpavlin, Mon Oct 8 16:19:37 2007 UTC revision 24 by dpavlin, Mon Oct 8 16:19:56 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: cpu_alpha_instr_alu.c,v 1.2 2006/01/01 16:08:25 debug Exp $   *  $Id: cpu_alpha_instr_alu.c,v 1.3 2006/06/03 06:46:44 debug Exp $
29   *   *
30   *  Alpha ALU instructions.  (Included from tmp_alpha_misc.c.)   *  Alpha ALU instructions.  (Included from tmp_alpha_misc.c.)
31   *   *
# Line 45  Line 45 
45   *      ALU_MSK                         masks   *      ALU_MSK                         masks
46   *      ALU_CMOV                        conditional moves   *      ALU_CMOV                        conditional moves
47   *      ALU_CMP                         compares   *      ALU_CMP                         compares
48     *      ALU_CMPBGE                      byte compare
49   *      none of the above               everything else (add, sub, ...)   *      none of the above               everything else (add, sub, ...)
50   */   */
51    
# Line 192  void ALU_N(struct cpu *cpu, struct alpha Line 193  void ALU_N(struct cpu *cpu, struct alpha
193    
194  #else   /*  ! CMOV  */  #else   /*  ! CMOV  */
195    
196    #ifdef ALU_CMPBGE
197    
198            uint64_t ra = *((uint64_t *)ic->arg[1]), rc = 0, rb =
199    #ifdef ALU_IMM
200                        (uint64_t)ic->arg[2]
201    #else
202                        (*((uint64_t *)ic->arg[2]))
203    #endif
204                        ;
205            int i;
206            for (i=7; i>=0; i--) {
207                    if ((uint8_t)ra >= (uint8_t)rb)
208                            rc |= (1 << i);
209                    rb >>= 8; ra >>= 8;
210            }
211    
212            *((uint64_t *)ic->arg[0]) = rc;
213    
214    #else   /*  ! CMPBGE  */
215    
216  #ifdef ALU_CMP  #ifdef ALU_CMP
217    
218          uint64_t x;          uint64_t x;
# Line 329  void ALU_N(struct cpu *cpu, struct alpha Line 350  void ALU_N(struct cpu *cpu, struct alpha
350  #endif  /*  !ALU_CMP  */  #endif  /*  !ALU_CMP  */
351    
352          *((uint64_t *)ic->arg[0]) = x;          *((uint64_t *)ic->arg[0]) = x;
353    #endif  /*  ! CMPBGE  */
354  #endif  /*  ! CMOV  */  #endif  /*  ! CMOV  */
355  #endif  /*  ! MSK  */  #endif  /*  ! MSK  */
356  #endif  /*  ! EXT  */  #endif  /*  ! EXT  */

Legend:
Removed from v.23  
changed lines
  Added in v.24

  ViewVC Help
Powered by ViewVC 1.1.26