Commit 0d9466f
[Z80][GISel] Fix eZ80 s16 shift-by-const selection from o16 sources.
The eZ80 G_SHL selector path for s16 shifts by 2..6 was constraining the
source vreg to A16 before emitting:
SUBREG_TO_REG
COPY to UHL
repeated ADD24aa
COPY low 16 bits from HL
That source constraint was unnecessary and rejects valid inputs such as o16
virtual registers, causing instruction selection failures like:
cannot select: %...:o16(s16) = G_SHL %...:o16, %...:gpr(s8)
Remove the unnecessary source constraint and constrain the fallback
destination to R16 instead of A16 after copying the low 16-bit result out of
HL.
This fixes backend crashes seen in real code such as invert_palette from
dino-run-ce, and adds a MIR regression test covering G_SHL on an o16 s16
input in eZ80 mode.
Co-Authored-By: Codex CLI <codex@openai.com>1 parent d189354 commit 0d9466f
2 files changed
Lines changed: 34 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2962 | 2962 | | |
2963 | 2963 | | |
2964 | 2964 | | |
2965 | | - | |
2966 | | - | |
2967 | 2965 | | |
2968 | 2966 | | |
2969 | 2967 | | |
| |||
2979 | 2977 | | |
2980 | 2978 | | |
2981 | 2979 | | |
2982 | | - | |
| 2980 | + | |
2983 | 2981 | | |
2984 | 2982 | | |
2985 | 2983 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
0 commit comments