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

SCM Repository

[smlnj] Annotation of /sml/trunk/src/compiler/OldCGen/mips/endian.sml
ViewVC logotype

Annotation of /sml/trunk/src/compiler/OldCGen/mips/endian.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 114 - (view) (download)

1 : monnier 16 (* Copyright 1991 by AT&T Bell Laboratories
2 :     *
3 :     *)
4 :     structure LittleEndian : ENDIAN =
5 :     struct
6 :     val architecture = "mipsel"
7 :     val bigEndian = false
8 :     val >> = Word.>>
9 :     val & = Word.andb
10 :     infix >> &
11 :    
12 :     val order_real = implode o rev o explode
13 :     val low_order_offset = 0
14 :     fun wordLayout (hi,lo) =
15 :     (lo & 0w255, (lo >> 0w8) & 0w255, hi & 0w255, (hi >> 0w8) & 0w255)
16 :     end
17 :    
18 :     structure BigEndian : ENDIAN =
19 :     struct
20 :     val architecture = "mipseb"
21 :     val bigEndian = true
22 :     val >> = Word.>>
23 :     val & = Word.andb
24 :     infix >> &
25 :    
26 :     fun order_real x = x
27 :     val low_order_offset = 1
28 :     fun wordLayout (hi,lo) =
29 :     ((hi >> 0w8) & 0w255, hi & 0w255, (lo >> 0w8) & 0w255, lo & 0w255)
30 :     end
31 :    
32 :    
33 :     (*
34 : monnier 113 * $Log$
35 : monnier 16 *)

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