MIPS: R6: load/store can process unaligned address
authorYunQiang Su <yunqiang.su@cipunited.com>
Mon, 11 Oct 2021 10:42:39 +0000 (06:42 -0400)
committerYunQiang Su <syq@debian.org>
Tue, 7 Dec 2021 02:01:23 +0000 (10:01 +0800)
commit30a08286e67e3aee17347f8d02e8f868a995beb9
tree3f72d4fda38abcffce68860861bfaa6040892f36
parent3d9e6767939e9658260e2506e81ec32b37cba041
MIPS: R6: load/store can process unaligned address

MIPS release 6 requires the lw/ld/sw/sd can work with
unaligned address, while it can be implemented by
full hardware or trap&emulate.

Since it doesn't have to be fully done by hardware, we add a
pair of options -m(no-)unaligned-access. Kernels may need them.

gcc/ChangeLog:

* config/mips/mips.h (ISA_HAS_UNALIGNED_ACCESS, STRICT_ALIGNMENT):
R6 can unaligned access.
* config/mips/mips.md (movmisalign<mode>): Likewise.
* config/mips/mips.opt: add -m(no-)unaligned-access
* doc/invoke.texi: Likewise.

gcc/testsuite/ChangeLog:

* gcc.target/mips/mips.exp: add unaligned-access
* gcc.target/mips/unaligned-2.c: New test.
* gcc.target/mips/unaligned-3.c: New test.
gcc/config/mips/mips.h
gcc/config/mips/mips.md
gcc/config/mips/mips.opt
gcc/doc/invoke.texi
gcc/testsuite/gcc.target/mips/mips.exp
gcc/testsuite/gcc.target/mips/unaligned-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/mips/unaligned-3.c [new file with mode: 0644]