x32 has 32-bit pointers; x86-64 can't jmp %r32. This patch addresses this issue by explicitly zero-extending brind's target to 64-bits.
Details
Diff Detail
Event Timeline
| test/CodeGen/X86/x32-indirectbr.ll | ||
|---|---|---|
| 21 | %{{e|r}} | |
| test/CodeGen/X86/x32-indirectbr.ll | ||
|---|---|---|
| 21 | They are, if you are using the new registers( r8d-15d). The regexp could potentially be improved. | |
| lib/Target/X86/X86ISelDAGToDAG.cpp | ||
|---|---|---|
| 2281 | Could you comment on why not NaCl? Maybe restyle to be more readable: case ISD::BRIND: {
if (Subtarget->isTargetNaCl())
// Not NaCl because...
break;
if (Subtarget->isTarget64BitILP32()) {
// ...
}
break; | |
| test/CodeGen/X86/x32-indirectbr.ll | ||
| 7 | It seems like test2 relies on switch lowering's specific implementation? Is this tested here because it's generated through a different code path than indirectbr? I'd like to make sure that the tests isn't brittle if e.g. fast-isel changes, while still making sure you have proper test coverage. | |
| 9 | CHECK-LABEL | |
| 22 | CHECK-NEXT for this line. | |
| 24 | CHECK-LABEL | |
| 56 | CHECK-NEXT | |
| test/CodeGen/X86/x32-indirectbr.ll | ||
|---|---|---|
| 21 | Oh ok, I misunderstood. and the regex is explicitly trying to throw away the d for REG. It makes sense, but probably worth a comment saying that the test is checking for a 32-bit mov followed by a jump through the 64-bit version of the same register. | |
Could you comment on why not NaCl? Maybe restyle to be more readable:
case ISD::BRIND: { if (Subtarget->isTargetNaCl()) // Not NaCl because... break; if (Subtarget->isTarget64BitILP32()) { // ... } break;