Skip to content

Commit cd0f37c

Browse files
authored
Merge pull request below#56 from mstorsjo/neon-fix
Avoid using nonstandard assembly syntax for NEON
2 parents b8dbac1 + 11ab7e3 commit cd0f37c

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

Chapter 13/matrixmultneon.s

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ main:
3434
LDR D5, [X0]
3535

3636
.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]
37+
MUL \ccol\().4H, V0.4H, \bcol\().H[0]
38+
MLA \ccol\().4H, V1.4H, \bcol\().H[1]
39+
MLA \ccol\().4H, V2.4H, \bcol\().H[2]
4040
.endm
4141

4242
mulcol V6, V3 // process first column

README.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -335,17 +335,11 @@ Like in Chapter 11, all the chages have been introduced already. Nothing new her
335335

336336
## Chapter 13: Neon Coprocessor
337337

338-
Once again, the Clang assembler wants a slightly different syntax: Where gcc accepts
339-
340-
```
341-
MUL V6.4H, V0.4H, V3.4H[0]
342-
```
343-
344-
the Clang assembler expects
345-
346-
```
347-
MUL.4H V6, V0, V3[0]
348-
```
338+
The example used a nonstandard syntax for referencing a single vector element,
339+
which GNU assembler accepts, but Clang doesn't.
340+
Where the example used `V3.4H[0]` for referencing the first 16 bit element,
341+
the correct, standard syntax is `V3.H[0]`, which is accepted both by GNU
342+
assembler and Clang.
349343

350344
All other changes to the code should be trivial at this point.
351345

0 commit comments

Comments
 (0)