https://godbolt.org/z/jxbMMs3dP
uint64_t u8(uint8_t x) { return x << 1; }
uint64_t u16(uint16_t x) { return x << 1; }
clang output:
u8:
and x8, x0, #0xff
lsl x0, x8, #1
ret
u16:
and x8, x0, #0xffff
lsl x0, x8, #1
ret
GCC output:
u8:
ubfiz x0, x0, 1, 8
ret
u16:
ubfiz x0, x0, 1, 16
ret