questions about MOVB/MOVBS/MOVBU of arm

103 weergaven
Naar het eerste ongelezen bericht

Ben Shi

ongelezen,
13 jun 2017, 05:45:2413-06-2017
aan golan...@googlegroups.com
1. MOVB R3, R4 is assembled the same code to MOVW R3, R4, why?

2. What is difference between MOVBU and MOVB


Ben Shi

Russ Cox

ongelezen,
13 jun 2017, 09:49:0913-06-2017
aan Ben Shi, golang-dev
On Tue, Jun 13, 2017 at 5:44 AM, Ben Shi <power...@163.com> wrote:
1. MOVB R3, R4 is assembled the same code to MOVW R3, R4, why?

Because there are no byte registers on ARM, so if both args are registers it's fine to move the whole word.
 
2. What is difference between MOVBU and MOVB

The sign-extension behavior when reading from memory into a register: MOVBU zero-extends (treats the byte as unsigned) into the full-width register, while MOVB sign-extends (treats the byte as signed).

Russ

Ben Shi

ongelezen,
13 jun 2017, 10:08:3413-06-2017
aan Russ Cox, golang-dev
There are thrree MOVB:

MOVB MOVBS MOVBU,

if MOVB imply sign extention
what is the difference between MOVB and MOVBS?

Ben Shi

cherry

ongelezen,
13 jun 2017, 10:11:5213-06-2017
aan Ben Shi, Russ Cox, golang-dev
It looks like MOVB does a sign extension for load (you have to extend one way or the other), but not for register move; MOVBS does a sign extension for both load and register move.


--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ben Shi

ongelezen,
13 jun 2017, 10:28:5713-06-2017
aan cherry, Russ Cox, golang-dev
Shall we delete the movb reg, reg 

and movh reg, reg

They are quite confusing.

Ben Shi

cherry

ongelezen,
13 jun 2017, 10:39:1513-06-2017
aan Ben Shi, Russ Cox, golang-dev
No, don't delete instructions. It may break user code.

They are less confusing when you think it as "move a byte, I don't care what the high bits are"...

Allen beantwoorden
Auteur beantwoorden
Doorsturen
0 nieuwe berichten