This patch makes the assembler support all modifiers defined in gnu-as.
Also changes some diagnostic information.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
So it seems we're restricting the applicable instructions for each fixup kind, for example even if both lu12i.w and lu32i.d take a 20-bit signed immediate, the xxx64_LO20 fixups still cannot be used with lu12i.w and the xxx_HI20 ones cannot be used with lu32i.d.
Is this the same behavior as in binutils? I don't know if this is an artificial limitation to assembly expressiveness, but since I know the reloc types are deliberately designed with effectively only the linker implementation in mind, this might as well just be expected. I didn't find any other major problem though...
(test results)
The behavior is different with binutils. Probably the current implementation of binutils doesn't care if the relocation conforms to the instruction.
llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCCodeEmitter.cpp | ||
---|---|---|
162 | Using the relocation numbers directly looks weird. It's better to define in a header file. |
place 12 before 14