Debian Codegraph @

lib/mlrisc-lib/MLRISC/backpatch/noDelaySlots.sml

raw
1 (*
2 * This is a default description for architectures without *any* delay slots.
3 * By using this dummy module the architecture can use the spanDep.sml
4 * module for span dependency resolution.
5 *
6 * -- Allen
7 *)
8
9 functor NoDelaySlots(I : INSTRUCTIONS) : DELAY_SLOT_PROPERTIES =
10 struct
11 structure I = I
12
13 datatype delay_slot =
14 D_NONE (* no delay slot *)
15 | D_ERROR (* an error *)
16 | D_ALWAYS (* one delay slot *)
17 | D_TAKEN (* delay slot is only active when branch is taken *)
18 | D_FALLTHRU (* delay slot is only active when branch is not taken *)
19
20 (* size of delay slot in bytes *)
21 val delaySlotSize = 0
22
23 (* Return the delay slot properties of an instruction *)
24 fun delaySlot{instr,backward} =
25 { n = false, (* is the nullified bit on? *)
26 nOn = D_ERROR, (* delay type when nullified *)
27 nOff= D_NONE, (* delay type when not nullified *)
28 nop = false (* is there a nop padded? *)
29 }
30
31 (* Change the delay slot properties of an instruction *)
32 fun enableDelaySlot{instr,n,nop} = instr
33
34 (* is there any dependency conflict? *)
35 fun conflict{src,dst} = true
36
37 (* can delaySlot fit within the delay slot of jmp? *)
38 fun delaySlotCandidate{jmp, delaySlot} = false
39
40 (* change the branch target of an instruction *)
41 fun setTarget(instr,label) = instr
42
43 end