Replacing 'sb' Instruction with 'sw' for Word Alignment in GCC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am in the process of adapting a chip with the RV32I architecture.
Due to some issues with SRAM, I cannot use the "sb" instruction and must
use the "sw" instruction with word alignment. I attempted to replace the
"store byte" with "store word" in the "riscv_output_move" function in
"gcc/config/riscv/riscv.c",

switch (GET_MODE_SIZE (mode))
 case 1: return "sb\t%z1,%0";
 case 2: return "sh\t%z1,%0";
 case 4: return "sw\t%z1,%0";
case 8: return "sd\t%z1,%0";

but encountered some difficulties. For example, in "case 1: return
"sb\t%z1,%0";", "%0" can only be of type "mem", making it difficult to
align the address using instructions. Is there any feasible method to
achieve the conversion of "sb" to "sw"?

Thanks
Ricky



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux