Skip to content

Commit 498f108

Browse files
authored
[SPARC][IAS] Add setuw alias for set
Reviewers: s-barannikov, brad0, rorth Reviewed By: s-barannikov Pull Request: #125149
1 parent db43dd7 commit 498f108

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

llvm/lib/Target/Sparc/SparcInstrAliases.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,8 @@ def : InstAlias<"unimp", (UNIMP 0), 0>;
605605
// interchangeable with `unimp` all the time.
606606
def : MnemonicAlias<"illtrap", "unimp">;
607607

608+
def : MnemonicAlias<"setuw", "set">, Requires<[HasV9]>;
609+
608610
def : MnemonicAlias<"iflush", "flush">;
609611

610612
def : MnemonicAlias<"stub", "stb">;

llvm/test/MC/Sparc/sparcv9-synthetic-instructions.s

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,11 @@ setx (0x0123456700000000+0x0000000089abcdef), %g1, %o0
7878
! V9: sllx %g1, 32, %g1 ! encoding: [0x83,0x28,0x70,0x20]
7979
! V9: or %g1, %o0, %o0 ! encoding: [0x90,0x10,0x40,0x08]
8080
setx (.BB1-.BB0), %g1, %o0
81+
82+
!! In V9, setuw is a mnemonic alias for set.
83+
! V8: error: invalid instruction mnemonic
84+
! V9: sethi %hi(32768), %g1 ! encoding: [0x03,0b00AAAAAA,A,A]
85+
! V9: ! fixup A - offset: 0, value: %hi(32768), kind: fixup_sparc_hi22
86+
setuw 32768, %g1
87+
! V9: mov 1, %g1 ! encoding: [0x82,0x10,0x20,0x01]
88+
setuw 1, %g1

0 commit comments

Comments
 (0)