You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently
var a int32
var b int8
a = int32(b) is built to MOVBS, which actually is
tmp = SLL b, 24
a = SRA tmp, 24
That is quite inefficient.
I suggest use single instruction SXTB which was introduced in ARMv6.
"Signed Extend Byte extracts an 8-bit value from a register, sign-extends it to 32 bits, and writes the result to the destination register."
So do int16->int32(SXTH), uint8->uint32(UXTB), uint16->uint32(UXTH)
It can be done in go1.10 and assigned to me.
The text was updated successfully, but these errors were encountered:
As Cherry @cherrymui suggeusts in https://go-review.googlesource.com/c/53690, more work is needed to introduce XTB/XTBU/XTH/XTHU to golang. Adding a new field in []optab for selecting different instructions for different GOARM version is a good way.
Currently
var a int32
var b int8
a = int32(b) is built to MOVBS, which actually is
tmp = SLL b, 24
a = SRA tmp, 24
That is quite inefficient.
I suggest use single instruction SXTB which was introduced in ARMv6.
"Signed Extend Byte extracts an 8-bit value from a register, sign-extends it to 32 bits, and writes the result to the destination register."
So do int16->int32(SXTH), uint8->uint32(UXTB), uint16->uint32(UXTH)
It can be done in go1.10 and assigned to me.
The text was updated successfully, but these errors were encountered: