SCM Repository
[smlnj] Diff of /sml/branches/SMLNJ/src/MLRISC/alpha/alpha.md
Diff of /sml/branches/SMLNJ/src/MLRISC/alpha/alpha.md
Parent Directory
|
Revision Log
|
Patch
236 |
fun disp lab = itow(Label.addrOf lab - !loc - 4) ~>> 0w2 |
fun disp lab = itow(Label.addrOf lab - !loc - 4) ~>> 0w2 |
237 |
end |
end |
238 |
|
|
239 |
|
structure Assembly = |
240 |
|
struct |
241 |
|
fun isZero(I.CONSTop c) = Constant.valueOf c = 0 |
242 |
|
| isZero _ = false |
243 |
|
end |
244 |
|
|
245 |
(* |
(* |
246 |
* The main instruction set definition consists of the following: |
* The main instruction set definition consists of the following: |
247 |
* 1) constructor-like declaration defines the view of the instruction, |
* 1) constructor-like declaration defines the view of the instruction, |
259 |
|
|
260 |
(* Load/Store *) |
(* Load/Store *) |
261 |
| LDA of {r: $GP, b: $GP, d:operand} (* use of REGop is illegal *) |
| LDA of {r: $GP, b: $GP, d:operand} (* use of REGop is illegal *) |
262 |
``<(emit "lda\t"; emit_GP r; emit ", "; emit_operand d; |
``<(if isZero d andalso r = b then () |
263 |
if b=31 then () else (emit "("; emit_GP b; emit ")")) |
else (emit "lda\t"; emit_GP r; emit ", "; emit_operand d; |
264 |
|
if b=31 then () else (emit "("; emit_GP b; emit ")"))) |
265 |
>'' |
>'' |
266 |
ILoadStore{opc=0w08,r,b,d} |
ILoadStore{opc=0w08,r,b,d} |
267 |
|
|
|
Legend:
Removed from v.468 |
|
changed lines |
|
Added in v.469 |
|
|