In ARMv8 assembly, the the compiler would send an error message if I do something like this:
mov w19, #16
mov x20, w19
How could I move a value from a w register to a x register, and how could I move a value from a x register to a w register?
In ARMv8 all you have are 32, 64 bit GPRs which are accessed as 'X' registers. Arm architecture provides instructions to access lower 32 bits of these registers using 'W' names i.e.'W' registers are 32 bit alias of 'X' registers. Architecture doesn't support instructions containing both 'X' and 'W' mnenomincs but either only 'X' or 'W'. When you write to 'W' register, upper 32 bits in 'X' are cleared to zero.
In above instruction upper 32 bits of W1 are cleared to zero and copies lower 32 bits of W2 into W1.
Mixed register sizes in the same instruction are generally not supported, so instructions like this wouldn't assemble.
There are other variants of Mov instruction like MOVZ, MVN, MOV immediate, MOVK etc. For details of these instruction please refer arm architecture reference manual.