https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97417
Levy <admin at levyhsu dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #49534|0 |1
is obsolete| |
--- Comment #29 from Levy <admin at levyhsu dot com> ---
Created attachment 49536
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49536&action=edit
QI/HI/SImode auto Zero/Sign-extend
Finally, make gen_extend_insn() seems to work with auto-extension based on Jim
and Kito's idea.
Just 10 lines of code at the beginning of riscv_legitimize_move() in
riscv-gcc/gcc/config/riscv.c
if (GET_MODE_CLASS (mode) == MODE_INT
&& GET_MODE_SIZE (mode) < UNITS_PER_WORD
&& can_create_pseudo_p()
&& MEM_P (src))
{
rtx temp_reg = gen_reg_rtx (word_mode);
int zero_sign_extend = (LOAD_EXTEND_OP (mode) == ZERO_EXTEND);
emit_insn(gen_extend_insn(temp_reg, src, word_mode, mode,
zero_sign_extend));
riscv_emit_move(dest, gen_lowpart(mode, temp_reg));
return true;
}
Haven't make report-gcc, but already passed 2-stage make.
I'll have a test later.