forked from bminor/binutils-gdb
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LoongArch: gas: add support using variable for li.w/d
Macro instruction li.w/d support using variable like ".equ var, 123 li.w/d resgister, var". Add two testcases. gas/ * config/loongarch-parse.y * testsuite/gas/loongarch/li.d * testsuite/gas/loongarch/li.s * testsuite/gas/loongarch/li2.d * testsuite/gas/loongarch/li2.s
- Loading branch information
tangxiaolin
committed
Aug 12, 2022
1 parent
fcbfb25
commit 2ea5ece
Showing
5 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#as: | ||
#objdump: -dr | ||
|
||
.*:[ ]+file format .* | ||
|
||
|
||
Disassembly of section .text: | ||
|
||
00000000.* <.text>: | ||
[ ]+0:[ ]+03848c0c[ ]+ori[ ]+\$t0,[ ]+\$zero,[ ]+0x123 | ||
[ ]+4:[ ]+15ffe00d[ ]+lu12i.w[ ]+\$t1,[ ]+-256\(0xfff00\) | ||
[ ]+8:[ ]+16001fed[ ]+lu32i.d[ ]+\$t1,[ ]+255\(0xff\) | ||
[ ]+c:[ ]+02bffc0e[ ]+addi.w[ ]+\$t2,[ ]+\$zero,[ ]+-1\(0xfff\) | ||
[ ]+10:[ ]+1601ffee[ ]+lu32i.d[ ]+\$t2,[ ]+4095\(0xfff\) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.equ a, 0x123 | ||
.equ b, 0xfffff00000 | ||
.equ c, 0xfffffffffff | ||
|
||
li.w $r12, a | ||
li.d $r13, b | ||
li.d $r14, c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#as: | ||
#objdump: -dr | ||
|
||
.*:[ ]+file format .* | ||
|
||
|
||
Disassembly of section .text: | ||
|
||
00000000.* <_start>: | ||
[ ]+0:[ ]+03803c06[ ]+ori[ ]+\$a2,[ ]+\$zero,[ ]+0xf | ||
[ ]+4:[ ]+1a000005[ ]+pcalau12i[ ]+\$a1,[ ]+0 | ||
[ ]+4:[ ]+R_LARCH_PCALA_HI20[ ]+.rodata | ||
[ ]+8:[ ]+02c000a5[ ]+addi.d[ ]+\$a1,[ ]+\$a1,[ ]+0 | ||
[ ]+8:[ ]+R_LARCH_PCALA_LO12[ ]+.rodata | ||
[ ]+c:[ ]+03800404[ ]+ori[ ]+\$a0,[ ]+\$zero,[ ]+0x1 | ||
[ ]+10:[ ]+0381000b[ ]+ori[ ]+\$a7,[ ]+\$zero,[ ]+0x40 | ||
[ ]+14:[ ]+002b0000[ ]+syscall[ ]+0x0 | ||
[ ]+18:[ ]+00150004[ ]+move[ ]+\$a0,[ ]+\$zero | ||
[ ]+1c:[ ]+0381740b[ ]+ori[ ]+\$a7,[ ]+\$zero,[ ]+0x5d | ||
[ ]+20:[ ]+002b0000[ ]+syscall[ ]+0x0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.equ EXIT_SUCCESS, 0 | ||
.equ STDOUT, 1 | ||
.equ SYS_exit, 93 | ||
.equ SYS_write, 64 | ||
|
||
.section .rodata | ||
msg: | ||
.string "hello, world!\n" | ||
len = . - msg | ||
|
||
.text | ||
.globl _start | ||
_start: | ||
li.w $a2, len | ||
la.local $a1, msg | ||
li.w $a0, STDOUT | ||
li.w $a7, SYS_write | ||
syscall 0x0 | ||
|
||
li.w $a0, EXIT_SUCCESS | ||
li.w $a7, SYS_exit | ||
syscall 0x0 |