Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
------------------------------------------------------------------------ r217432 | tomatabacu | 2014-09-09 11:15:38 +0100 (Tue, 09 Sep 2014) | 12 lines [mips] Add assembler support for .set push/pop directive. Summary: These directives are used to save the current assembler options (in the case of ".set push") and restore the previously saved options (in the case of ".set pop"). Contains work done by Matheus Almeida. Reviewers: dsanders Reviewed By: dsanders Differential Revision: http://reviews.llvm.org/D4821 ------------------------------------------------------------------------ llvm-svn: 232082
- Loading branch information
1 parent
fedffd7
commit af61ee8
Showing
5 changed files
with
155 additions
and
17 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
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 @@ | ||
# RUN: not llvm-mc %s -triple=mipsel-unknown-linux -mcpu=mips32r2 2>%t1 | ||
# RUN: FileCheck %s < %t1 | ||
|
||
.text | ||
.set pop | ||
# CHECK: :[[@LINE-1]]:14: error: .set pop with no .set push | ||
.set push | ||
.set pop | ||
.set pop | ||
# CHECK: :[[@LINE-1]]:14: error: .set pop with no .set push | ||
.set push foo | ||
# CHECK: :[[@LINE-1]]:19: error: unexpected token, expected end of statement | ||
.set pop bar | ||
# CHECK: :[[@LINE-1]]:18: error: unexpected token, expected end of statement |
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,47 @@ | ||
# RUN: llvm-mc %s -triple=mipsel-unknown-linux -mcpu=mips32r2 -mattr=+msa | \ | ||
# RUN: FileCheck %s | ||
# .set push creates a copy of the current environment. | ||
# .set pop restores the previous environment. | ||
# FIXME: Also test resetting of .set macro/nomacro option. | ||
|
||
.text | ||
# The first environment on the stack (with initial values). | ||
lw $1, 65536($1) | ||
b 1336 | ||
addvi.b $w15, $w13, 18 | ||
|
||
# Create a new environment. | ||
.set push | ||
.set at=$ra # Test the ATReg option. | ||
lw $1, 65536($1) | ||
.set noreorder # Test the Reorder option. | ||
b 1336 | ||
|
||
# Switch back to the first environment. | ||
.set pop | ||
lw $1, 65536($1) | ||
b 1336 | ||
addvi.b $w15, $w13, 18 | ||
|
||
# CHECK: lui $1, 1 | ||
# CHECK: addu $1, $1, $1 | ||
# CHECK: lw $1, 0($1) | ||
# CHECK: b 1336 | ||
# CHECK: nop | ||
# CHECK: addvi.b $w15, $w13, 18 | ||
|
||
# CHECK: .set push | ||
# CHECK: lui $ra, 1 | ||
# CHECK: addu $ra, $ra, $1 | ||
# CHECK: lw $1, 0($ra) | ||
# CHECK: .set noreorder | ||
# CHECK: b 1336 | ||
# CHECK-NOT: nop | ||
|
||
# CHECK: .set pop | ||
# CHECK: lui $1, 1 | ||
# CHECK: addu $1, $1, $1 | ||
# CHECK: lw $1, 0($1) | ||
# CHECK: b 1336 | ||
# CHECK: nop | ||
# CHECK: addvi.b $w15, $w13, 18 |