https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97417

--- Comment #14 from Jim Wilson <wilson at gcc dot gnu.org> ---
Actually, for the SImode to DImode conversion, zero extending is unlikely to be
correct in that case.  The rv64 'w' instructions require the input to be
sign-extended from 32-bits to 64-bits, so a sign-extend is probably required. 
There will be a similar consideration for rv128 when we get to that.  So maybe
we should only handle QImode and HImode here.

Or maybe we make the choice of zero-extend or sign-extend depend on the mode,
and use zero-extend for smaller than SImode and sign-extend for SImode and
larger.

For qimode, char is unsigned by default, so zero extension is likely the right
choice.  For himode, it isn't clear which is best, but the arm port does a zero
extend.  Also, the Huawei code size proposal says that zero exnteded byte and
short loads are more important than sign extended byte and short load, so that
is more evidence that zero extend is more useful in those cases.

Reply via email to