Add support for this target hook, covering MIPS, microMIPS and MIPSR6, along
with some tests. Also add missing getOppositeBranchOpc() cases exposed by the
tests.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Target/Mips/MipsInstrInfo.cpp | ||
---|---|---|
370–392 ↗ | (On Diff #146475) | Is this offset correct here? |
lib/Target/Mips/MipsLongBranch.cpp | ||
---|---|---|
588 ↗ | (On Diff #146475) | If this part is removed, then the below estimation for the NaCl will be estimated several times more. |
lib/Target/Mips/MipsInstrInfo.cpp | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
370–392 ↗ | (On Diff #146475) | Yes, that's an error. BC(1|2)(EQ|NE)ZC, B{...}ZALC, B((N|O)VC have 17 bit offsets, the rest have 18 bit offsets. | ||||||||||||
lib/Target/Mips/MipsLongBranch.cpp | ||||||||||||||
588 ↗ | (On Diff #146475) | Yes, but we're checking a wider / different range. The old logic is testing if the encoded offset (i.e. we have right shifted the value) would fit in a 16 bit offset in the instruction. The new logic is testing if the offset in bytes is in range of the branch instructions without the right shift.
|
lib/Target/Mips/MipsLongBranch.cpp | ||
---|---|---|
588 ↗ | (On Diff #146475) | Oh yes, it's true. I didn't connect these things immediately. |