Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/MLRISC/hppa/instructions/hppaProps.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/hppa/instructions/hppaProps.sml

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

revision 1081, Thu Feb 21 15:28:03 2002 UTC revision 1082, Thu Feb 21 18:50:56 2002 UTC
# Line 121  Line 121 
121            I.ANNOTATION{i=setTargets(i,labels),a=a}            I.ANNOTATION{i=setTargets(i,labels),a=a}
122      | setTargets(i,_) = i      | setTargets(i,_) = i
123    
124    fun negateConditional br = let    (* negate the branch.  Since the HPPA instruction representation tracks both
125       * the true and false target labels, we set the false label to be the
126       * old true label and set the true label to be the argument label.
127       *)
128      fun negateConditional (br, lab) = let
129      fun revFcond I.?    = I.!?      fun revFcond I.?    = I.!?
130        | revFcond I.!<=> = I.<=>        | revFcond I.!<=> = I.<=>
131        | revFcond I.==   = I.!=        | revFcond I.==   = I.!=
# Line 149  Line 153 
153        | revFcond I.!?   = I.?        | revFcond I.!?   = I.?
154        | revFcond I.<=>  = I.!<=>        | revFcond I.<=>  = I.!<=>
155        | revFcond _      = error "revFcond"        | revFcond _      = error "revFcond"
156        fun negate (I.INSTR(I.BCOND{cmp,bc,r1,r2,t,f,n,nop})) = I.bcond{
157                bc=bc, r1=r1, r2=r2, t=lab, f=t, n=n, nop=nop,
158                cmp=case cmp of I.COMBT => I.COMBF | I.COMBF => I.COMBT
159              }
160        | negate (I.INSTR(I.BCONDI{cmpi,bc,i,r2,t,f,n,nop})) = I.bcondi{
161                bc=bc, i=i, r2=r2, t=lab, f=t, n=n, nop=nop,
162                cmpi=case cmpi of I.COMIBT => I.COMIBF | I.COMIBF => I.COMIBT
163              }
164        | negate (I.INSTR(I.BB{bc,r,p,t,f,n,nop})) = I.bb{
165                bc=case bc of I.BSET => I.BCLR | I.BCLR => I.BSET,
166                r=r,p=p,t=lab,f=t,n=n,nop=nop
167              }
168        | negate (I.INSTR(I.FBRANCH{cc,fmt,f1,f2,t,f,n,long})) =
169            I.fbranch{cc=revFcond cc,fmt=fmt,f1=f1,f2=f2,t=lab,f=t,n=n,long=long}
170        | negate (I.ANNOTATION{i,a}) = I.ANNOTATION{i=negate i,a=a}
171        | negate _ = raise NegateConditional
172    in    in
173      case br of        negate br
       I.INSTR(I.BCOND{cmp,bc,r1,r2,t,f,n,nop}) =>  
          I.bcond{bc=bc, r1=r1, r2=r2, t=t, f=f, n=n, nop=nop,  
                  cmp=case cmp of I.COMBT => I.COMBF | I.COMBF => I.COMBT}  
     | I.INSTR(I.BCONDI{cmpi,bc,i,r2,t,f,n,nop}) =>  
         I.bcondi{bc=bc, i=i, r2=r2, t=t, f=f, n=n, nop=nop,  
                  cmpi=case cmpi of I.COMIBT => I.COMIBF | I.COMIBF => I.COMIBT}  
     | I.INSTR(I.BB{bc,r,p,t,f,n,nop}) =>  
          I.bb{bc=case bc of I.BSET => I.BCLR | I.BCLR => I.BSET,  
               r=r,p=p,t=t,f=f,n=n,nop=nop}  
     | I.INSTR(I.FBRANCH{cc,fmt,f1,f2,t,f,n,long}) =>  
         I.fbranch{cc=revFcond cc,fmt=fmt,f1=f1,f2=f2,t=t,f=f,n=n,long=long}  
     | I.ANNOTATION{i,a} => I.ANNOTATION{i=negateConditional i,a=a}  
     | _ => raise NegateConditional  
174    end    end
175    
176    (*========================================================================    (*========================================================================

Legend:
Removed from v.1081  
changed lines
  Added in v.1082

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0