Add support for custom execution domain fixing and implement support for BLENDPD/BLENDPS/PBLENDD/PBLENDW.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Target/X86/X86InstrInfo.cpp | ||
---|---|---|
10083 | Could we just detect ImmWidth == 16 instead of having a Repeat flag? | |
10085 | Can we mask the immediate to 8-bits on the previous line so we don't need two ands on this line? | |
10101 | Does this branch only happen when the starting instruction was a BLENDW? And that means that the table is pointing at ReplaceableCustomInstrs not ReplaceableCustomAVX2Instrs? |
lib/Target/X86/X86InstrInfo.cpp | ||
---|---|---|
10154 | This line gives a compiler warning due to the assigment not having extra parentheses |
lib/Target/X86/X86InstrInfo.cpp | ||
---|---|---|
10098 | This doesn't work if we ever start with a BLENDW that could be represented with a BLENDD right? We'd find the BLENDW in the table search and keep that opcode, but give it a BLENDD immediate? |
lib/Target/X86/X86InstrInfo.cpp | ||
---|---|---|
10098 | What should happen is if a PBLENDW mask ends up back here then it can be re-scaled as a PBLENDD, else it'll drop down to PBLENDW again. |
lib/Target/X86/X86InstrInfo.cpp | ||
---|---|---|
10098 | But what will change the opcode from PBLENDW to PBLENDD? The table lookup will just hit the original opcode won't it? |
lib/Target/X86/X86InstrInfo.cpp | ||
---|---|---|
10098 | No, I cheated and put the VPBLENDWY opcodes under the ReplaceableCustomInstrs not the AVX2 variant, so it'll match in the first lookup (at line 10086) and won't use the second (line 10088). Then if we can widen it for VPBLENDD I lookup again with ReplaceableCustomAVX2Instrs directly |
lib/Target/X86/X86InstrInfo.cpp | ||
---|---|---|
10098 | But if the original opcode was VBLENDW/VBLENDWY the lookup into ReplaceableCustomAVX2Instrs at 10098 won't find a match for that opcode and will return null. |
lib/Target/X86/X86InstrInfo.cpp | ||
---|---|---|
10098 | Yup you're right - will look into it. |
Remove rescaling between VPBLENDD and VPBLENDW - it doesn't seem to help as they are both in the integer domain and as @craig.topper noticed was causing issues with the lookup.
Reopening as it was reverted at rL353699 due to a rather weird regression.....
@dlj @sammccall Please can you post your repros here?
Could we just detect ImmWidth == 16 instead of having a Repeat flag?