src_regs.h
3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#ifndef _src_regs_h_
#define _src_regs_h_ 1
############################################################################
#
# Scalar Register Usage Conventions:
#
# Starting from $31 growing down, we allocate 'permanent' registers.
# These should only be re-used carefully, possibly saved/restored.
# (during development we might re-shuffle these so the more crucial
# or stable ones remain higher)
#
# Register $0 is always 0, as per the MIPS R4000 spec.
#
# Starting from $1 growing up, we use 'temporary' registers which
# are free to be used by procedures or small blocks of code. These
# registers are not named (or they are .name'd and .unname'd in small
# code blocks).
#
# Function parameters are passed and returned in $1, $2, $3, etc.
#
.name return, $31 # MIPS R4000 convention for JAL op
.name dmembase, $30 # base of DMEM (constant)
.name initPtr, $29 # ptr to init data
.name CPHptr, $28 # addr of current phase address vector
.name CAptr, $27 # addr of current data address vector
.name fCAptr, $26 # addr of frac CA vector
.name iCAptr, $25 # addr of int CA vector
.name PHptr, $24
.name iCOptr, $23 # addr of int CA vector
.name OutPtr, $22 # pointr to output data
.name loopctl, $21 # pointr to output data
.name tVol, $20 # address of target volume
.name temp, $19
.name zero, $0
###########################################################################
#
# Vector Register Usage Conventions:
#
# Similar to scalar registers, named registers start at $v31 and grow down.
# These should only be re-used carefully, possibly saved/restored.
# (during development we might re-shuffle these so the more crucial
# or stable ones remain higher)
#
# Register $v0 is NOT always 0, like in the MIPS R4000 spec.
#
# Starting from $v1 growing up, we use 'temporary' registers which
# are free to be used by procedures or small blocks of code. These
# registers are not named (or they are .name'd and .unname'd in small
# code blocks).
#
# Function parameters are passed and returned in $v1, $v2, $v3, etc.
#
.name vONE, $v31
.name vSHIFT, $v30 #
.name vZEROFOUR, $v29
.name vONEFIVE, $v28
.name vTWOSIX, $v27
.name vTHREESEVEN, $v26
.name vMULINC, $v25 #
.name vRAMP, $v24 # linear volume ramp
.name vfco, $v23 # fractional current offset
.name vico, $v22 # integer current offset
.name vica, $v21 # integer current base address
.name vfcvol, $v20
.name vicvol, $v19
.name vchparmz, $v18 # volume target, rate, sound base, coef base
# pitch increment, phase multiplier
.name vphaddr, $v17 # vector of phase addresses
.name vdata0, $v16 # data vector 0
.name vcoef0, $v15 # coef vector 0
.name vdata1, $v14 # data vector 1
.name vcoef1, $v13 # coef vector 1
.name vdata2, $v12 # data vector 2
.name vcoef2, $v11 # coef vector 2
.name vdata3, $v10 # data vector 3
.name vcoef3, $v9 # coef vector 3
.name vout0, $v8
.name vout1, $v7
.name vout2, $v6
.name vout3, $v5
.name vout, $v4
.name vtemp0, $v3
.name vtemp1, $v2
.name vtemp2, $v1
.name vtemp3, $v0
#endif /* _src_regs_h_ */