|
From: Florian K. <br...@ac...> - 2013-01-31 16:50:20
|
On 01/31/2013 03:37 AM, Julian Seward wrote:
>
> Didn't you have some previous proposal that did this?
>
> typedef struct { UInt r; } HReg;
>
> so that the typechecker can find all mixups?
Yes. The thing is that we compare HREgs for equality using == or != and
you cannot do that if HReg is a struct. Won't compile.
We do that 91 times in current code. If we want to go this route we need
to define a function sameHReg or so and change all comparisons to call
that function. That is what I meant that it will be somewhat intrusive.
If the function is inlined it probably will generate the same quality of
code although we would have to make sure.
> But I'd also be happy with your different-encoding scheme too, if you
> prefer that. The current situation is for sure not good.
>
Hmm. I made the encoding change and ran regtest on x86-64 with no new
regression. However, there are still two issues in amd64 insn selection.
I must have overlooked them first time around..:
priv/host_amd64_isel.c:3446:7: error: invalid initializer
priv/host_amd64_isel.c:3447:43: error: invalid operands to binary ^
(have 'HReg' and 'int')
Hmm, maybe we should bite the bullet and make HReg a struct after all.
Let me see how generated code looks like....
Florian
|