-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[Xtensa] Implement Xtensa Floating Point Option. #136086
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
94b8fbe
8ec0901
b0c04d0
1cfc902
fe21537
989582e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -113,6 +113,39 @@ static DecodeStatus DecodeMR23RegisterClass(MCInst &Inst, uint64_t RegNo, | |||||
return MCDisassembler::Success; | ||||||
} | ||||||
|
||||||
static const MCPhysReg FPRDecoderTable[] = { | ||||||
Xtensa::F0, Xtensa::F1, Xtensa::F2, Xtensa::F3, Xtensa::F4, Xtensa::F5, | ||||||
Xtensa::F6, Xtensa::F7, Xtensa::F8, Xtensa::F9, Xtensa::F10, Xtensa::F11, | ||||||
Xtensa::F12, Xtensa::F13, Xtensa::F14, Xtensa::F15}; | ||||||
|
||||||
static DecodeStatus DecodeFPRRegisterClass(MCInst &Inst, uint64_t RegNo, | ||||||
uint64_t Address, | ||||||
const void *Decoder) { | ||||||
if (RegNo >= std::size(FPRDecoderTable)) | ||||||
return MCDisassembler::Fail; | ||||||
|
||||||
MCPhysReg Reg = FPRDecoderTable[RegNo]; | ||||||
Inst.addOperand(MCOperand::createReg(Reg)); | ||||||
return MCDisassembler::Success; | ||||||
} | ||||||
|
||||||
static DecodeStatus DecodeURRegisterClass(MCInst &Inst, uint64_t RegNo, | ||||||
uint64_t Address, | ||||||
const MCDisassembler *Decoder) { | ||||||
const llvm::MCSubtargetInfo STI = | ||||||
((const MCDisassembler *)Decoder)->getSubtargetInfo(); | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Don't make a copy of SubtargetInfo, but this also isn't used since it's requeryed below anyway There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you very much for comment. I fixes this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||
if (RegNo > 255) | ||||||
return MCDisassembler::Fail; | ||||||
|
||||||
MCPhysReg Reg = Xtensa::getUserRegister(RegNo); | ||||||
if (!Xtensa::checkRegister(Reg, Decoder->getSubtargetInfo().getFeatureBits())) | ||||||
return MCDisassembler::Fail; | ||||||
|
||||||
Inst.addOperand(MCOperand::createReg(Reg)); | ||||||
return MCDisassembler::Success; | ||||||
} | ||||||
|
||||||
const MCPhysReg SRDecoderTable[] = { | ||||||
Xtensa::SAR, 3, Xtensa::ACCLO, 16, Xtensa::ACCHI, 17, | ||||||
Xtensa::M0, 32, Xtensa::M1, 33, Xtensa::M2, 34, | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed