Skip to content

Commit 715a5d8

Browse files
authored
[SPARC][IAS] Add aliases for %asr20-21 as defined in JPS1
This adds %set_softint and %clear_softint alias for %asr20 and %asr21 as defined in JPS1. Reviewers: jrtc27, brad0, s-barannikov, rorth Reviewed By: s-barannikov Pull Request: #94247
1 parent 44f9357 commit 715a5d8

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,12 +1384,11 @@ MCRegister SparcAsmParser::matchRegisterName(const AsmToken &Tok,
13841384
}
13851385

13861386
// JPS1 extension - aliases for ASRs
1387-
// Section A.51 - Read State Register
1387+
// Section 5.2.11 - Ancillary State Registers (ASRs)
13881388
if (Name == "pcr") {
13891389
RegKind = SparcOperand::rk_Special;
13901390
return SP::ASR16;
13911391
}
1392-
13931392
if (Name == "pic") {
13941393
RegKind = SparcOperand::rk_Special;
13951394
return SP::ASR17;
@@ -1402,6 +1401,14 @@ MCRegister SparcAsmParser::matchRegisterName(const AsmToken &Tok,
14021401
RegKind = SparcOperand::rk_Special;
14031402
return SP::ASR19;
14041403
}
1404+
if (Name == "set_softint") {
1405+
RegKind = SparcOperand::rk_Special;
1406+
return SP::ASR20;
1407+
}
1408+
if (Name == "clear_softint") {
1409+
RegKind = SparcOperand::rk_Special;
1410+
return SP::ASR21;
1411+
}
14051412
if (Name == "softint") {
14061413
RegKind = SparcOperand::rk_Special;
14071414
return SP::ASR22;

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,10 @@
502502
wr %i0, %i1, %ccr
503503
! V9: wr %i0, 1, %ccr ! encoding: [0x85,0x86,0x20,0x01]
504504
wr %i0, 1, %ccr
505+
! V9: wr %i0, 1, %asr20 ! encoding: [0xa9,0x86,0x20,0x01]
506+
wr %i0, 1, %set_softint
507+
! V9: wr %i0, 1, %asr21 ! encoding: [0xab,0x86,0x20,0x01]
508+
wr %i0, 1, %clear_softint
505509

506510
! V9: st %o1, [%o0] ! encoding: [0xd2,0x22,0x00,0x00]
507511
stw %o1, [%o0]

0 commit comments

Comments
 (0)