Hacker News new | past | comments | ask | show | jobs | submit login
The ALU of the armv1 – the first ARM microprocessor (2015) (daveshacks.blogspot.com)
46 points by userbinator on March 23, 2023 | hide | past | favorite | 1 comment



The barrel shifter was one of the things I loved about writing assembly code for the ARM. Shift anything, any amount for free!

There is a nice writeup about what it could do for you here:

https://www.davespace.co.uk/arm/introduction-to-arm/barrel-s...

Back in the ARM2 days (I never coded for ARM1 - they made very few of them) you knew exactly how long each instruction would take to execute (1 cycle for arithmetic, 4 cycles for load/save single value and 4 cycles + 1 for each location for load/save multiple if I remember correctly).

You could use the barrel shifter to shift/rotate arguments as part of those 1 cycle instructions, using up a whole zero extra cycles!

Nowadays with superscalar ARMs with branch prediction and onboard caches things aren't nearly so straight forward.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: