LoongArch: Fixed the problem of incorrect judgment of the immediate field of...
LoongArch: Fixed the problem of incorrect judgment of the immediate field of the [x]vld/[x]vst instruction. The [x]vld/[x]vst directive is defined as follows: [x]vld/[x]vst {x/v}d, rj, si12 When not modified, the immediate field of [x]vld/[x]vst is between 10 and 14 bits depending on the type. However, in loongarch_valid_offset_p, the immediate field is restricted first, so there is no error. However, in some cases redundant instructions will be generated, see test cases. Now modify it according to the description in the instruction manual. gcc/ChangeLog: * config/loongarch/lasx.md (lasx_mxld_<lasxfmt_f>): Modify the method of determining the memory offset of [x]vld/[x]vst. (lasx_mxst_<lasxfmt_f>): Likewise. * config/loongarch/loongarch.cc (loongarch_valid_offset_p): Delete. (loongarch_address_insns): Likewise. * config/loongarch/lsx.md (lsx_ld_<lsxfmt_f>): Likewise. (lsx_st_<lsxfmt_f>): Likewise. * config/loongarch/predicates.md (aq10b_operand): Likewise. (aq10h_operand): Likewise. (aq10w_operand): Likewise. (aq10d_operand): Likewise. gcc/testsuite/ChangeLog: * gcc.target/loongarch/vect-ld-st-imm12.c: New test.
Showing
- gcc/config/loongarch/lasx.md 0 additions, 26 deletionsgcc/config/loongarch/lasx.md
- gcc/config/loongarch/loongarch.cc 4 additions, 15 deletionsgcc/config/loongarch/loongarch.cc
- gcc/config/loongarch/lsx.md 0 additions, 26 deletionsgcc/config/loongarch/lsx.md
- gcc/config/loongarch/predicates.md 0 additions, 16 deletionsgcc/config/loongarch/predicates.md
- gcc/testsuite/gcc.target/loongarch/vect-ld-st-imm12.c 15 additions, 0 deletionsgcc/testsuite/gcc.target/loongarch/vect-ld-st-imm12.c
Loading
Please register or sign in to comment