-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolumn_major_mult.txt
70 lines (68 loc) · 1.56 KB
/
column_major_mult.txt
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
lui s0, 0x0000 //vector
andi s0 s0 0x0010
lui s1 0x0000 //matrix
andi s0 s0 0x0024
lui s2 0x0000 //vector product
andi s2 s2 0x00F0
lui t0 0x0000 //t0 used to place values and mult vector
andi t0 t0 0x0017
lui t1 0xFFFF //t1 is used by matrix 4x2
andi t1 t1 0xFF10
sw t0 0x0(s0) //1
sw t1 0x0(s1) //1x1
addi t0 t0 0x0005
addi t1 t1 0x008B
sw t0 0x4(s0) //2
sw t1 0x4(s1) //2x1
addi t0 t0 0x32
addi t1 t1 0x22
sw t0 0x8(s0) //3
sw t1 0x8(s1) //1x2
addi t0 t0 0x03
addi t1 t1 0x1a
sw t0 0xC(s0) //4
sw t1 0x8(s0) //2x2
addi t0 t0 0x13
addi t1 t1 0x03
sw t0 0x10(s1) //1x3
sw t1 0x14(s1) //2x3
addi t0 t0 0x09
addi t1 t1 0x0F
sw t0 0x18(s1) //1x4
sw t0 0x1C(s1) //2x4
lw t0 0x0(s0) //loading initial mult 1x1
lw t1 0x0(s1)
mult t1 t0
lw t1 0x4(s1) //loading next mult 2x1
mflo t2 //first prod stored in t2
mult t1 t0
mflo t3 //second prod stored in t3
add t2 t2 t3
sw t2 0x0(s2) //completed first term mult
lw t0 0x4(s0) //loading 1x2
lw t1 0x8(s1)
mult t1 t0
lw t1 0xC(s1) //loading 2x2
mflo t2 //first prod stored in t2
mult t1 t0
mflo t3 //second prod stored in t3
add t2 t2 t3
sw t2 0x4(s2) //completed 2nd term mult
lw t0 0x8(s0) //loading 1x3
lw t1 0x10(s1)
mult t1 t0
lw t1 0x14(s1) //loading 2x3
mflo t2 //first prod stored in t2
mult t1 t0
mflo t3 //second prod stored in t3
add t2 t2 t3
sw t2 0x8(s2) //completed 3rd term mult
lw t0 0xC(s0) //loading 1x4
lw t1 0x18(s1)
mult t1 t0
lw t1 0x1C(s1) //loading 2x4
mflo t2 //first prod stored in t2
mult t1 t0
mflo t3 //second prod stored in t3
add t2 t2 t3
sw t2 0xC(s2) //completed 4th term mult, stored at addr in mem contained by s2