Skip to content

Commit f3a6fc3

Browse files
committed
[Chapter 13] Fixed the MUL.4H and MLA.4H syntax
1 parent 2af3db9 commit f3a6fc3

3 files changed

Lines changed: 26 additions & 43 deletions

File tree

Chapter 13/debug.s

Lines changed: 0 additions & 31 deletions
This file was deleted.

Chapter 13/matrixmultneon.s

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ main:
3333
LDP D3, D4, [X0], #16
3434
LDR D5, [X0]
3535

36-
MUL V6().4H, V0.4H, V3().4H[0]
37-
MLA V6().4H, V1.4H, V3().4H[1]
38-
MLA V6().4H, V2.4H, V3().4H[2]
39-
MUL V7().4H, V0.4H, V4().4H
40-
MLA V7().4H, V1.4H, V4().4H
41-
MLA V7().4H, V2.4H, V4().4H
42-
MUL V8().4H, V0.4H, V5().4H
43-
MLA V8().4H, V1.4H, V5().4H
44-
MLA V8().4H, V2.4H, V5().4H
36+
.macro mulcol ccol bcol
37+
MUL.4H \ccol\(), V0, \bcol\()[0]
38+
MLA.4H \ccol\(), V1, \bcol\()[1]
39+
MLA.4H \ccol\(), V2, \bcol\()[2]
40+
.endm
41+
42+
mulcol V6, V3 // process first column
43+
mulcol V7, V4 // process second column
44+
mulcol V8, V5 // process third column
4545

4646
ADRP X1, C@PAGE // Address of C
4747
ADD X1, X1, C@PAGEOFF

README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ In this repository, I will code along with the book [Programming with 64-Bit ARM
77

88
## Latest News
99

10+
Pop the Champagne! 🍾 All the code is running!
11+
1012
Once you found the bug, you feel stupid for not noticing it before. Only after some debugging I realized that Darwin has a different value for `AT_FDCWD`. This means: Chapter 7 is ready!
1113

12-
Chapter 13 stil has an open issue, though.
14+
And after some disassembly and reading [Documentation](https://community.arm.com/developer/tools-software/oss-platforms/b/android-blog/posts/arm-neon-programming-quick-reference), Chapter 13 is ready as well.
1315

14-
I got a mention in Stephen Smith's [blog](https://smist08.wordpress.com/2020/07/31/is-apple-silicon-really-arm/)!
16+
Last but not least, I got a mention in Stephen Smith's [blog](https://smist08.wordpress.com/2020/07/31/is-apple-silicon-really-arm/)!
1517

1618
### Prerequisites
1719

@@ -283,7 +285,19 @@ Like in Chapter 11, all the chages have been introduced already. Nothing new her
283285

284286
## Chapter 13
285287

286-
This chapter is still in the works; it compiles, but the output is wrong. There is one [issue](https://github.com/below/HelloSilicon/issues/15) I'd like to fix
288+
Once again, the Clang assembler seems to want a slightly different syntax: Where gcc accepts
289+
290+
```
291+
MUL V6.4H, V0.4H, V3.4H[0]
292+
```
293+
294+
the Clang assembler expects
295+
296+
```
297+
MUL.4H V6, V0, V3[0]
298+
```
299+
300+
All other changes to the code should be trivial at this point.
287301

288302
## Chapter 14
289303

0 commit comments

Comments
 (0)