diff --git a/Chapter 13/debug.s b/Chapter 13/debug.s deleted file mode 100644 index cecbd52..0000000 --- a/Chapter 13/debug.s +++ /dev/null @@ -1,31 +0,0 @@ -@ Various macros to help with debugging - -@ These macros preseve all registers. -@ Beware they will change cpsr. - -.macro printReg reg - push {r0-r4, lr} @ save regs - mov r2, R\reg @ for the %d - mov r3, R\reg @ for the %x - mov r1, #\reg - add r1, #'0' @ for %c - ldr r0, =ptfStr @ printf format str - bl _printf @ call printf - pop {r0-r4, lr} @ restore regs -.endm - -.macro printStr str - push {r0-r4, lr} @ save regs - ldr r0, =1f @ load print str - bl _printf @ call printf - pop {r0-r4, lr} @ restore regs - b 2f @ branch around str -1: .asciz "\str\n" - .align 4 -2: -.endm - -.data -ptfStr: .asciz "R%c = %16d, 0x%08x\n" -.align 4 -.text diff --git a/Chapter 13/matrixmultneon.s b/Chapter 13/matrixmultneon.s index 48e2e58..fca6bb0 100644 --- a/Chapter 13/matrixmultneon.s +++ b/Chapter 13/matrixmultneon.s @@ -34,9 +34,9 @@ main: LDR D5, [X0] .macro mulcol ccol bcol - MUL \ccol\().4H, V0.4H, \bcol\().4H - MLA \ccol\().4H, V1.4H, \bcol\().4H - MLA \ccol\().4H, V2.4H, \bcol\().4H + MUL.4H \ccol\(), V0, \bcol\()[0] + MLA.4H \ccol\(), V1, \bcol\()[1] + MLA.4H \ccol\(), V2, \bcol\()[2] .endm mulcol V6, V3 // process first column diff --git a/README.md b/README.md index 058e351..d500c3d 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,13 @@ In this repository, I will code along with the book [Programming with 64-Bit ARM ## Latest News +Pop the Champagne! 🍾 All the code is running! + 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! -Chapter 13 stil has an open issue, though. +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. -I got a mention in Stephen Smith's [blog](https://smist08.wordpress.com/2020/07/31/is-apple-silicon-really-arm/)! +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/)! ### Prerequisites @@ -283,7 +285,19 @@ Like in Chapter 11, all the chages have been introduced already. Nothing new her ## Chapter 13 -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 +Once again, the Clang assembler seems to want a slightly different syntax: Where gcc accepts + +``` +MUL V6.4H, V0.4H, V3.4H[0] +``` + +the Clang assembler expects + +``` +MUL.4H V6, V0, V3[0] +``` + +All other changes to the code should be trivial at this point. ## Chapter 14