The logic from line 633 to 640 is specific for ARM as the comments said, it will make all the targets will prefer to using instruction with more predicates when compiler do AsmMatching.
And for code from line 642 to 649, X86 want to use the order records written in source file to sort the instructions. So X86 could be affected by this logic. (These code could be arrived only by X86)
After change this, seems AVX instructions have not be affected but it exposed some other errors for instruction push and call.
CALLpcrel16 could not be used in 64 bit mode, we need add Predicate for it. And for push instruction, previously because pushi32 has predicates = [Not64bitmode], so it precede pushi16, which is incorrect here, we should get pushw here and it also align with gcc.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/test/MC/X86/x86_64-encoding.s | ||
---|---|---|
5 | Put this in a test for 16-bit mode. Otherwise we would lose test coverage. |
llvm/test/MC/X86/pr22028.s | ||
---|---|---|
17 | Is this correct? 65536 does not fit into a 16-bit word. |
llvm/test/MC/X86/pr22028.s | ||
---|---|---|
17 | It aligns with the GAS's behavior. bash$ cat 1.s .code16 push 65536 bash$ as 1.s -o 1.o 0000000000000000 <.text>: 0: ff 36 00 00 pushw 0x0 |
Comment Actions
Can you make the summary easier to read? Developers have to check the line number of the source file to understand it, if you mention the logic by line 633
Is this correct? 65536 does not fit into a 16-bit word.