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/hppaJumps.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/hppa/hppaJumps.sml

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

revision 17, Wed Mar 11 21:00:18 1998 UTC revision 167, Sat Nov 7 20:11:41 1998 UTC
# Line 19  Line 19 
19    
20    fun minSize(I.COPY _)  = 0    fun minSize(I.COPY _)  = 0
21      | minSize(I.FCOPY _) = 0      | minSize(I.FCOPY _) = 0
22        | minSize(I.FBRANCH _) = 12 (* FCMP/FTEST/B *)
23        | minSize(I.BLR{labs,...}) = 8 + 8 * length labs (* FCMP/FTEST/B *)
24      | minSize _          = 4      | minSize _          = 4
25    
26    fun maxSize (I.BCOND _)  = 20    fun maxSize (I.BCOND _)  = 20
27      | maxSize (I.BCONDI _) = 20      | maxSize (I.BCONDI _) = 20
28      | maxSize (I.B _)      = 16      | maxSize (I.B _)      = 16
29      | maxSize (I.FBCC _)   = 16      | maxSize (I.FBRANCH _)= 24
30      | maxSize (I.COPY _)   = error "maxSize:COPY"      | maxSize (I.COPY _)   = error "maxSize:COPY"
31      | maxSize (I.FCOPY _)  = error "maxSize:FCOPY"      | maxSize (I.FCOPY _)  = error "maxSize:FCOPY"
32      | maxSize _            = 4      | maxSize _            = 4
# Line 41  Line 43 
43      of I.BCOND _                => true      of I.BCOND _                => true
44       | I.BCONDI _               => true       | I.BCONDI _               => true
45       | I.B _                    => true       | I.B _                    => true
46       | I.FBCC _                 => true       | I.FBRANCH _              => true
47         | I.BLR _                  => true
48       | I.LDO{i, ...}            => opnd i       | I.LDO{i, ...}            => opnd i
49       | I.STORE{d, ...}          => opnd d       | I.STORE{d, ...}          => opnd d
50       | I.ARITHI{i, ...}         => opnd i       | I.ARITHI{i, ...}         => opnd i
# Line 97  Line 100 
100        | I.BCOND{t, ...}  => branch t        | I.BCOND{t, ...}  => branch t
101        | I.BCONDI{t, ...} => branch t        | I.BCONDI{t, ...} => branch t
102        | I.B{lab, ...}    => if im17 (branchOffset lab) then 4 else 16        | I.B{lab, ...}    => if im17 (branchOffset lab) then 4 else 16
103        | I.FBCC{t, ...}   => if im17 (branchOffset t) then 4 else 16        | I.FBRANCH{t, ...}   => if im17 (branchOffset t) then 12 else 24
104          | I.BLR{labs,...} => let
105              val l = length labs * 8
106              fun badOffsets(t::ts,n) =
107                    not(im17(branchOffset t + n)) orelse badOffsets(ts,n+2)
108                | badOffsets([],n) = false
109            in l + (if badOffsets(labs,2) then 20 else 8)
110            end
111        | I.COPY{impl=ref(SOME l), ...} => 4 * length l        | I.COPY{impl=ref(SOME l), ...} => 4 * length l
112        | I.FCOPY{impl=ref(SOME l), ...} => 4 * length l        | I.FCOPY{impl=ref(SOME l), ...} => 4 * length l
113        | I.COPY{dst, src, impl, tmp} => let        | I.COPY{dst, src, impl, tmp} => let
# Line 252  Line 262 
262          of 4 => [instr]          of 4 => [instr]
263           | 16 => longJump{lab=lab, n=n}           | 16 => longJump{lab=lab, n=n}
264        (*esac*))        (*esac*))
265      | expand(instr as I.FBCC{t, f, n}, size) =      | expand(instr as I.FBRANCH{t, f, n, ...}, size) =
266        (case size        (case size
267          of 4 => [I.B{lab=t, n=n}]          of 12 => [instr]
268           | 16 =>           | 24 =>
269               (* lets hope this sequence never gets generated sequence:               (* lets hope this sequence never gets generated sequence:
270                          FTEST                          FTEST
271                          allways trapping instruction                          allways trapping instruction
272                          B (f)                          B (f)
273                          longJmp                          longJmp
274                *)                *)
275                  error "FBCC"                  error "FBRANCH"
276        (*esac*))        (*esac*))
277        | expand(I.BLR{labs,n,t,x,...},size) =
278           (if size = 8 + 8 * length labs then
279               I.BLR{labs=[],n=n,t=t,x=x}::
280               I.NOP::
281               foldr (fn (l,is) => I.B{lab=l,n=true}::I.NOP::is) [] labs
282            else error "BLR"
283           )
284      | expand(I.COPY{impl=ref(SOME instrs),...}, _) = instrs      | expand(I.COPY{impl=ref(SOME instrs),...}, _) = instrs
285      | expand(I.FCOPY{impl=ref(SOME instrs),...}, _) = instrs      | expand(I.FCOPY{impl=ref(SOME instrs),...}, _) = instrs
286      | expand _ = error "expand"      | expand _ = error "expand"
# Line 272  Line 289 
289    
290  (*  (*
291   * $Log: hppaJumps.sml,v $   * $Log: hppaJumps.sml,v $
292   * Revision 1.9  1998/02/17 02:51:05  george   * Revision 1.1.1.1  1998/04/08 18:39:01  george
293   *   Added the nullify bit to all branch instructions -- leunga   * Version 110.5
  *  
  * Revision 1.8  1998/02/16 13:58:14  george  
  *   A register allocated temp is now associated with parallel COPYs  
  *   instead of a dedicated register. The temp is used to break cycles.  
  *  
  * Revision 1.7  1998/01/30 14:21:47  george  
  *   missing case for expansion of span dependent loads  
  *  
  * Revision 1.6  1997/09/29 20:58:33  george  
  *   Propagate region information through instruction set  
294   *   *
 # Revision 1.4  1997/07/17  12:27:35  george  
 #   The regmap is now represented as an int map rather than using arrays.  
 #  
 # Revision 1.3  1997/07/03  13:54:29  george  
 #   Added support for FCOPY.  
 #  
 # Revision 1.2  1997/04/19  18:39:10  george  
 # Version 109.27  
 #  
 # Revision 1.1.1.1  1997/04/19  18:14:22  george  
 #   Version 109.27  
 #  
295   *)   *)

Legend:
Removed from v.17  
changed lines
  Added in v.167

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