Commit 4199cfa
committed
arm: Fix wrong code generated for mve scatter store with writeback intrinsics with -O2 (PR97271).
This patch fixes (PR97271) the wrong code-gen for mve scatter store with writeback intrinsics with -O2.
$cat bug.c
void
foo (uint32x4_t * addr, const int offset, int32x4_t value)
{
vstrwq_scatter_base_wb_s32 (addr, 8, value);
}
$ arm-none-eabi-gcc bug.c -S -O2 -march=armv8.1-m.main+mve -mfloat-abi=hard -o -
Without this patch:
...
foo:
vldrw.32 q3, [r0]
vstrw.u32 q0, [q3, gcc-mirror#8]! ---> (A)
vldr.64 d4, .L3
vldr.64 d5, .L3+8
vldrw.32 q3, [r0]
vstrw.u32 q2, [q3, gcc-mirror#8]! ---> (B)
bx lr
...
With this patch:
...
foo:
vldrw.32 q3, [r0]
vstrw.u32 q0, [q3, gcc-mirror#8]! --> (C)
vstrw.32 q3, [r0]
bx lr
...
Without this patch 2 vstrw assembly instructions (A and B) are generated for vstrwq_scatter_base_wb_s32
intrinsic where as fix generates only one vstrw assembly instruction (C).
gcc/ChangeLog:
2020-10-06 Srinath Parvathaneni <srinath.parvathaneni@arm.com>
PR target/97291
* config/arm/arm-builtins.c (arm_strsbwbs_qualifiers): Modify array.
(arm_strsbwbu_qualifiers): Likewise.
(arm_strsbwbs_p_qualifiers): Likewise.
(arm_strsbwbu_p_qualifiers): Likewise.
* config/arm/arm_mve.h (__arm_vstrdq_scatter_base_wb_s64): Modify
function definition.
(__arm_vstrdq_scatter_base_wb_u64): Likewise.
(__arm_vstrdq_scatter_base_wb_p_s64): Likewise.
(__arm_vstrdq_scatter_base_wb_p_u64): Likewise.
(__arm_vstrwq_scatter_base_wb_p_s32): Likewise.
(__arm_vstrwq_scatter_base_wb_p_u32): Likewise.
(__arm_vstrwq_scatter_base_wb_s32): Likewise.
(__arm_vstrwq_scatter_base_wb_u32): Likewise.
(__arm_vstrwq_scatter_base_wb_f32): Likewise.
(__arm_vstrwq_scatter_base_wb_p_f32): Likewise.
* config/arm/arm_mve_builtins.def (vstrwq_scatter_base_wb_add_u): Remove
expansion for the builtin.
(vstrwq_scatter_base_wb_add_s): Likewise.
(vstrwq_scatter_base_wb_add_f): Likewise.
(vstrdq_scatter_base_wb_add_u): Likewise.
(vstrdq_scatter_base_wb_add_s): Likewise.
(vstrwq_scatter_base_wb_p_add_u): Likewise.
(vstrwq_scatter_base_wb_p_add_s): Likewise.
(vstrwq_scatter_base_wb_p_add_f): Likewise.
(vstrdq_scatter_base_wb_p_add_u): Likewise.
(vstrdq_scatter_base_wb_p_add_s): Likewise.
* config/arm/mve.md (mve_vstrwq_scatter_base_wb_<supf>v4si): Remove
expand.
(mve_vstrwq_scatter_base_wb_add_<supf>v4si): Likewise.
(mve_vstrwq_scatter_base_wb_<supf>v4si_insn): Rename pattern to ...
(mve_vstrwq_scatter_base_wb_<supf>v4si): This.
(mve_vstrwq_scatter_base_wb_p_<supf>v4si): Remove expand.
(mve_vstrwq_scatter_base_wb_p_add_<supf>v4si): Likewise.
(mve_vstrwq_scatter_base_wb_p_<supf>v4si_insn): Rename pattern to ...
(mve_vstrwq_scatter_base_wb_p_<supf>v4si): This.
(mve_vstrwq_scatter_base_wb_fv4sf): Remove expand.
(mve_vstrwq_scatter_base_wb_add_fv4sf): Likewise.
(mve_vstrwq_scatter_base_wb_fv4sf_insn): Rename pattern to ...
(mve_vstrwq_scatter_base_wb_fv4sf): This.
(mve_vstrwq_scatter_base_wb_p_fv4sf): Remove expand.
(mve_vstrwq_scatter_base_wb_p_add_fv4sf): Likewise.
(mve_vstrwq_scatter_base_wb_p_fv4sf_insn): Rename pattern to ...
(mve_vstrwq_scatter_base_wb_p_fv4sf): This.
(mve_vstrdq_scatter_base_wb_<supf>v2di): Remove expand.
(mve_vstrdq_scatter_base_wb_add_<supf>v2di): Likewise.
(mve_vstrdq_scatter_base_wb_<supf>v2di_insn): Rename pattern to ...
(mve_vstrdq_scatter_base_wb_<supf>v2di): This.
(mve_vstrdq_scatter_base_wb_p_<supf>v2di): Remove expand.
(mve_vstrdq_scatter_base_wb_p_add_<supf>v2di): Likewise.
(mve_vstrdq_scatter_base_wb_p_<supf>v2di_insn): Rename pattern to ...
(mve_vstrdq_scatter_base_wb_p_<supf>v2di): This.
gcc/testsuite/ChangeLog:
PR target/97291
* gcc.target/arm/mve/intrinsics/vstrdq_scatter_base_wb_p_s64.c: Modify.
* gcc.target/arm/mve/intrinsics/vstrdq_scatter_base_wb_p_u64.c:
Likewise.
* gcc.target/arm/mve/intrinsics/vstrdq_scatter_base_wb_s64.c: Likewise.
* gcc.target/arm/mve/intrinsics/vstrdq_scatter_base_wb_u64.c: Likewise.
* gcc.target/arm/mve/intrinsics/vstrwq_scatter_base_wb_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vstrwq_scatter_base_wb_p_f32.c:
Likewise.
* gcc.target/arm/mve/intrinsics/vstrwq_scatter_base_wb_p_s32.c:
Likewise.
* gcc.target/arm/mve/intrinsics/vstrwq_scatter_base_wb_p_u32.c:
Likewise.
* gcc.target/arm/mve/intrinsics/vstrwq_scatter_base_wb_s32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vstrwq_scatter_base_wb_u32.c: Likewise.
(cherry picked from commit 3775358)1 parent b3bfb38 commit 4199cfa
File tree
14 files changed
+32
-252
lines changed- gcc
- config/arm
- testsuite/gcc.target/arm/mve/intrinsics
14 files changed
+32
-252
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
811 | 811 | | |
812 | 812 | | |
813 | 813 | | |
814 | | - | |
| 814 | + | |
815 | 815 | | |
816 | 816 | | |
817 | 817 | | |
818 | 818 | | |
819 | | - | |
| 819 | + | |
820 | 820 | | |
821 | 821 | | |
822 | 822 | | |
823 | 823 | | |
824 | | - | |
| 824 | + | |
825 | 825 | | |
826 | 826 | | |
827 | 827 | | |
828 | 828 | | |
829 | 829 | | |
830 | | - | |
| 830 | + | |
831 | 831 | | |
832 | 832 | | |
833 | 833 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13993 | 13993 | | |
13994 | 13994 | | |
13995 | 13995 | | |
13996 | | - | |
13997 | | - | |
| 13996 | + | |
13998 | 13997 | | |
13999 | 13998 | | |
14000 | 13999 | | |
14001 | 14000 | | |
14002 | 14001 | | |
14003 | 14002 | | |
14004 | | - | |
14005 | | - | |
| 14003 | + | |
14006 | 14004 | | |
14007 | 14005 | | |
14008 | 14006 | | |
14009 | 14007 | | |
14010 | 14008 | | |
14011 | 14009 | | |
14012 | | - | |
14013 | | - | |
| 14010 | + | |
14014 | 14011 | | |
14015 | 14012 | | |
14016 | 14013 | | |
14017 | 14014 | | |
14018 | 14015 | | |
14019 | 14016 | | |
14020 | | - | |
14021 | | - | |
| 14017 | + | |
14022 | 14018 | | |
14023 | 14019 | | |
14024 | 14020 | | |
14025 | 14021 | | |
14026 | 14022 | | |
14027 | 14023 | | |
14028 | | - | |
14029 | | - | |
| 14024 | + | |
14030 | 14025 | | |
14031 | 14026 | | |
14032 | 14027 | | |
14033 | 14028 | | |
14034 | 14029 | | |
14035 | 14030 | | |
14036 | | - | |
14037 | | - | |
| 14031 | + | |
14038 | 14032 | | |
14039 | 14033 | | |
14040 | 14034 | | |
14041 | 14035 | | |
14042 | 14036 | | |
14043 | 14037 | | |
14044 | | - | |
14045 | | - | |
| 14038 | + | |
14046 | 14039 | | |
14047 | 14040 | | |
14048 | 14041 | | |
14049 | 14042 | | |
14050 | 14043 | | |
14051 | 14044 | | |
14052 | | - | |
14053 | | - | |
| 14045 | + | |
14054 | 14046 | | |
14055 | 14047 | | |
14056 | 14048 | | |
| |||
19158 | 19150 | | |
19159 | 19151 | | |
19160 | 19152 | | |
19161 | | - | |
19162 | | - | |
| 19153 | + | |
19163 | 19154 | | |
19164 | 19155 | | |
19165 | 19156 | | |
19166 | 19157 | | |
19167 | 19158 | | |
19168 | 19159 | | |
19169 | | - | |
19170 | | - | |
| 19160 | + | |
19171 | 19161 | | |
19172 | 19162 | | |
19173 | 19163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
828 | 828 | | |
829 | 829 | | |
830 | 830 | | |
831 | | - | |
832 | | - | |
833 | | - | |
834 | 831 | | |
835 | | - | |
836 | | - | |
837 | 832 | | |
838 | | - | |
839 | | - | |
840 | | - | |
841 | 833 | | |
842 | | - | |
843 | | - | |
844 | 834 | | |
845 | 835 | | |
846 | 836 | | |
| |||
0 commit comments