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 /MLRISC/trunk/amd64/instructions/amd64InstrExt.sml
ViewVC logotype

Annotation of /MLRISC/trunk/amd64/instructions/amd64InstrExt.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2811 - (view) (download)

1 : jhr 2771 (* amd64InstrExt.sml
2 :     *
3 :     * COPYRIGHT (c) 2007 The Fellowship of SML/NJ (http://smlnj.org)
4 :     *
5 :     * emit code for extensions to the amd64 instruction set.
6 :     *)
7 :    
8 : mrainey 2619 structure AMD64InstrExt =
9 :     struct
10 :    
11 :     datatype fsz = SINGLE | DOUBLE
12 :    
13 :     datatype ('s, 'r, 'f, 'c) sext
14 :     = PUSHQ of 'r
15 :     | POP of 'r
16 :     | LEAVE
17 :     | RET of 'r
18 : mrainey 2805 (* atomic fetch and add operations
19 :     * XADD (src, dst) tmp = src + dst
20 :     * src = dst
21 :     * dst := tmp
22 :     *)
23 :     | LOCK_XADDL of ('r * 'r) (* 32-bit atomic fetch and add *)
24 :     | LOCK_XADDQ of ('r * 'r) (* 64-bit atomic fetch and add *)
25 : jhr 2771 (* atomic compare and exchange instructions.
26 :     * CMPXCHG(src, dst) compares dst with %eax (or %rax) register.
27 :     * if they are equal, then the ZF flag is set and
28 :     * src is stored in dst; otherwise dst is loaded
29 :     * into %eax (or %rax) and ZF is cleared.
30 :     *)
31 :     | LOCK_CMPXCHGL of ('r * 'r) (* 32-bit compare and exchange *)
32 :     | LOCK_CMPXCHGQ of ('r * 'r) (* 64-bit compare and exchange *)
33 : mrainey 2811 (* atomic exchange instructions.
34 :     * XCHG(src, dst) tmp = *dst
35 :     * *dst := src
36 :     * src := tmp
37 :     *)
38 :     | LOCK_XCHGL of ('r * 'r) (* 32-bit exchange *)
39 :     | LOCK_XCHGQ of ('r * 'r) (* 64-bit exchange *)
40 : mrainey 2619
41 : jhr 2771 end (* AMD64InstrExt *)

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