On 30/01/24 17:14, wolfgang kern wrote:
>> movl $4294967295, %eax
>> That first instruction - the movl - has
>> negative 1 as an unsigned value.
>
> of course because it's just the lower part of RAX
> where the upper part become zeroed by a move to EAX.
It took me a while to realize this zero extension.
I was looking at code that looked like it should
be 64-bit but was seemingly 32-bit. I had to run
a testcase before I realized that the high 32 bits
were being zeroed.
Regardless, the original problem with the compiler
has been resolved (the way I was building it, I had
missed a define, so indexes were 32-bit instead of
64-bit), and with that resolved, and with a switch
to Win64 conventions, I now have:
D:\devel\gcc\gcc>type foo.s
.file "foo.c"
.text
.p2align 2,,3
.globl foo
foo:
.LFB1:
movsbl -1(%rcx),%eax
ret
.LFE1:
D:\devel\gcc\gcc>
And the compiler (now 64-bit pointers and 64-bit
long) is capable of self-recompilation.
And on my 32-bit Windows 2000 development environment
I can use it to produce 64-bit executables for my
Windows 10 host.
BFN. Paul.