diff options
author | Kyrylo Tkachov <kyrylo.tkachov@arm.com> | 2022-10-06 12:09:28 +0100 |
---|---|---|
committer | Kyrylo Tkachov <kyrylo.tkachov@arm.com> | 2022-10-06 12:09:28 +0100 |
commit | 33b93ac3f2fb68a2da0d42fd692fe59533f7a84f (patch) | |
tree | 3fa7370fdc7bf579f8f7c1869cd52a9636e08cbf /gcc/expr.cc | |
parent | badd1ac23d24664b2258b1db4d49f37a3f60ccca (diff) | |
download | gcc-33b93ac3f2fb68a2da0d42fd692fe59533f7a84f.zip gcc-33b93ac3f2fb68a2da0d42fd692fe59533f7a84f.tar.gz gcc-33b93ac3f2fb68a2da0d42fd692fe59533f7a84f.tar.bz2 |
aarch64: Remove redundant zero-extends with LDAR
Like other loads in AArch64, the LDARB,LDARH,LDAR instructions clear out the top part of their
destination register and we can thus avoid having to explicitly zero-extend it.
We were missing a combine pattern that this patch adds.
For one of the examples in the testcase we generated:
load_uint8_t_ext_uint16_t:
adrp x0, .LANCHOR0
add x0, x0, :lo12:.LANCHOR0
ldarb w0, [x0]
and w0, w0, 255
ret
but now generate:
load_uint8_t_ext_uint16_t:
adrp x0, .LANCHOR0
add x0, x0, :lo12:.LANCHOR0
ldarb w0, [x0]
ret
Bootstrapped and tested on aarch64-none-linux-gnu.
gcc/ChangeLog:
* config/aarch64/atomics.md (*atomic_load<ALLX:mode>_zext<SD_HSDI:mode>):
New pattern.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/ldar_2.c: New test.
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions