LoongArch: gas: add support using constant variable in instructions.
authortangxiaolin <tangxiaolin@loongson.cn>
Wed, 17 Aug 2022 07:12:43 +0000 (15:12 +0800)
committerliuzhensong <liuzhensong@loongson.cn>
Mon, 22 Aug 2022 02:20:01 +0000 (10:20 +0800)
commit7ec249249cd4d1a31bdb9318dba7510f33d866df
tree52f455ad01e0edd5bb1cb2cc71572bbd1bcd0334
parent1034d824d8981cd02f0961153acf5121dcc3d55a
LoongArch: gas: add support using constant variable in instructions.

        Instructions that can load immediate support using constant
        variable like ".equ var, 123    li.w/d resgister, var".

gas/
        * config/loongarch-parse.y
        * config/tc-loongarch.c

        Add four testcases.One is a program using constant variable,
        one test using label is unsupported, and another two test
        almost instructions that can load immediate.

gas/
        * testsuite/gas/loongarch/li.d
        * testsuite/gas/loongarch/li.s
        * testsuite/gas/loongarch/imm_ins_label-fail.d
        * testsuite/gas/loongarch/imm_ins_label-fail.l
        * testsuite/gas/loongarch/imm_ins_label-fail.s
        * testsuite/gas/loongarch/imm_ins.d
        * testsuite/gas/loongarch/imm_ins.s
        * testsuite/gas/loongarch/imm_ins_32.d
        * testsuite/gas/loongarch/imm_ins_32.s
gas/config/loongarch-parse.y
gas/config/tc-loongarch.c
gas/testsuite/gas/loongarch/imm_ins.d [new file with mode: 0644]
gas/testsuite/gas/loongarch/imm_ins.s [new file with mode: 0644]
gas/testsuite/gas/loongarch/imm_ins_32.d [new file with mode: 0644]
gas/testsuite/gas/loongarch/imm_ins_32.s [new file with mode: 0644]
gas/testsuite/gas/loongarch/imm_ins_label-fail.d [new file with mode: 0644]
gas/testsuite/gas/loongarch/imm_ins_label-fail.l [new file with mode: 0644]
gas/testsuite/gas/loongarch/imm_ins_label-fail.s [new file with mode: 0644]
gas/testsuite/gas/loongarch/li.d [new file with mode: 0644]
gas/testsuite/gas/loongarch/li.s [new file with mode: 0644]