LoongArch: Fix some macro that cannot be expanded properly
authorLulu Cai <cailulu@loongson.cn>
Wed, 27 Dec 2023 11:42:01 +0000 (19:42 +0800)
committerliuzhensong <liuzhensong@loongson.cn>
Thu, 4 Jan 2024 08:44:12 +0000 (16:44 +0800)
commit1c729b7cd77ca69f0f41d6a92ccf67348f08e007
treeda6e8cafa9b52c7778888871a3b35fd00a6943b0
parent3fc4f11e0bf30abfcf0abe803c38eddc8da9e301
LoongArch: Fix some macro that cannot be expanded properly

Suppose we want to use la.got to generate 32 pcrel and
32 abs instruction sequences respectively. According to
the existing conditions, to generate 32 pcrel sequences
use -mabi=ilp32*, and to generate 32 abs use -mabi=ilp32*
and -mla-global-with-abs.

Due to the fact that the conditions for generating 32 abs
also satisfy 32 pcrel, using -mabi=ilp32* and -mla-global-with-abs
will result in only generating instruction sequences of 32 pcrel.

By modifying the conditions for macro expansion and adjusting
the matching order of macro instructions, it is ensured that
the correct sequence of instructions can be generated.
gas/testsuite/gas/loongarch/macro_op_extreme_abs.d [new file with mode: 0644]
gas/testsuite/gas/loongarch/macro_op_extreme_abs.s [new file with mode: 0644]
gas/testsuite/gas/loongarch/macro_op_extreme_pc.d [moved from gas/testsuite/gas/loongarch/macro_op_large_abs.d with 93% similarity]
gas/testsuite/gas/loongarch/macro_op_extreme_pc.s [new file with mode: 0644]
gas/testsuite/gas/loongarch/macro_op_large_abs.s [deleted file]
gas/testsuite/gas/loongarch/macro_op_large_pc.d [deleted file]
gas/testsuite/gas/loongarch/macro_op_large_pc.s [deleted file]
opcodes/loongarch-opc.c