1
%%% -*- erlang-indent-level: 2 -*-
6
%%% temp ::= {ppc_temp, reg, type, allocatable}
7
%%% reg ::= <token from hipe_ppc_registers>
8
%%% type ::= tagged | untagged
9
%%% allocatable ::= true | false
11
%%% sdesc ::= {ppc_sdesc, exnlab, fsize, arity, live}
12
%%% exnlab ::= [] | label
13
%%% fsize ::= int32 (frame size in words)
14
%%% live ::= <tuple of int32> (word offsets)
17
%%% mfa ::= {ppc_mfa, atom, atom, arity}
18
%%% prim ::= {ppc_prim, atom}
20
-record(ppc_mfa, {m, f, a}).
21
-record(ppc_prim, {prim}).
22
-record(ppc_sdesc, {exnlab, fsize, arity, live}).
23
-record(ppc_simm16, {value}).
24
-record(ppc_temp, {reg, type, allocatable}).
25
-record(ppc_uimm16, {value}).
27
%%% Instruction Operands:
29
%%% aluop ::= add | add. | addi | addic. | addis | addo. | subf | subf. | subfo.
30
%%% | and | and. | andi. | or | or. | ori | xor | xor. | xori
31
%%% | slw | slw. | slwi | slwi. | srw | srw. | srwi | srwi.
32
%%% | sraw | sraw. | srawi | srawi.
33
%%% bcond ::= eq | ne | gt | ge | lt | le | so | ns
34
%%% cmpop ::= cmp | cmpi | cmpl | cmpli
35
%%% ldop ::= lbz | lha | lhz | lwz
36
%%% ldxop ::= lbzx | lhax | lhzx | lwzx | lhbrx | lwbrx
37
%%% stop ::= stb | stw (HW has sth, but we don't use it)
38
%%% stxop ::= stbx | stwx (HW has sthx/sthbrx/stwbrx, but we don't use them)
39
%%% unop ::= extsb | extsh | {rlwinm,SH,MB,ME} | {rlwinm.,SH,MB,ME}
41
%%% immediate ::= int32 | atom | {label, label_type}
42
%%% label_type ::= constant | closure | c_const
46
%%% | simm16 | uimm16 (only in alu.src2, cmp.src2)
48
%%% disp ::= sint16 (untagged simm16)
50
%%% fun ::= mfa | prim
51
%%% func ::= mfa | prim | 'ctr'
57
-record(alu, {aluop, dst, src1, src2}).
58
-record(b_fun, {'fun', linkage}). % known tailcall
59
-record(b_label, {label}). % local jump, unconditional
60
-record(bc, {bcond, label, pred}). % local jump, conditional
61
-record(bctr, {labels}). % computed tailcall or switch
62
-record(bctrl, {sdesc}). % computed recursive call
63
-record(bl, {'fun', sdesc, linkage}). % known recursive call
64
-record(blr, {}). % unconditional bclr (return)
65
-record(cmp, {cmpop, src1, src2}).
66
-record(comment, {term}).
67
-record(label, {label}).
68
-record(load, {ldop, dst, disp, base}). % non-indexed, non-update form
69
-record(loadx, {ldxop, dst, base1, base2}). % indexed, non-update form
70
-record(mcrxr, {}). % for clearing OV and SO in XER
71
-record(mfspr, {dst, spr}). % for reading LR
72
-record(mtspr, {spr, src}). % for writing LR and CTR
73
-record(pseudo_bc, {bcond, true_label, false_label, pred}).
74
-record(pseudo_call, {func, sdesc, contlab, linkage}).
75
-record(pseudo_call_prepare, {nrstkargs}).
76
-record(pseudo_li, {dst, imm}).
77
-record(pseudo_move, {dst, src}).
78
-record(pseudo_tailcall, {func, arity, stkargs, linkage}).
79
-record(pseudo_tailcall_prepare, {}).
80
-record(store, {stop, src, disp, base}). % non-indexed, non-update form
81
-record(storex, {stxop, src, base1, base2}).% indexed, non-update form
82
-record(unary, {unop, dst, src}).
83
-record(lfd, {dst, disp, base}).
84
-record(lfdx, {dst, base1, base2}).
85
-record(stfd, {src, disp, base}).
86
-record(stfdx, {src, base1, base2}).
87
-record(fp_binary, {fp_binop, dst, src1, src2}).
88
-record(fp_unary, {fp_unop, dst, src}).
89
-record(pseudo_fmove, {dst, src}).
91
%%% Function definitions.
93
-record(defun, {mfa, formals, code, data, isclosure, isleaf,
94
var_range, label_range}).