[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Tinycc-devel] Wrong __int64 computation
From: |
Christian Jullien |
Subject: |
RE: [Tinycc-devel] Wrong __int64 computation |
Date: |
Sun, 20 Dec 2009 08:01:47 +0100 |
Now, mod branch compiles my openlisp ISLISP *and* its huge non regression
tests suite ROOTB.
Thanks.
-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of
grischka
Sent: samedi 19 décembre 2009 19:33
To: address@hidden
Subject: Re: [Tinycc-devel] Wrong __int64 computation
Christian Jullien wrote:
> In fact it was related to unsigned __int64 not signed __int64
>
> The following patch modeled after TOK_DIV in x86_64-gen fixes, at least
for
> my case, this issue.
Yes, almost. The signed div does sign-extend rax into rdx
4: 48 99 cqto
6: 48 f7 f9 idiv %rcx
while the unsigned case just clears rdx, like this:
9: 48 31 d2 xor %rdx,%rdx
c: 48 f7 f1 div %rcx
You'd notice the difference only with _very_ big numbers,
such as 0xBFFFFFFFFFFFFFFF / 16, though.
I hope this works: http://repo.or.cz/w/tinycc.git/commitdiff/a98caba0
--- grischka
> Could you please review the patch?
>
> } else {
> if (op == TOK_UDIV || op == TOK_UMOD) {
> #if 1
> if ((vtop->type.t & VT_BTYPE) & VT_LLONG) {
> o(0x9948); /* cqto */
> o(0x48 + REX_BASE(fr));
> } else {
> o(0x99); /* cltd */
> }
> o(0xf7); /* idiv fr, %eax */
> o(0xf0 + fr);
> #else
> o(0xf7d231); /* xor %edx, %edx, div fr, %eax */
> o(0xf0 + fr);
> #endif
>
> Christian
>
_______________________________________________
Tinycc-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/tinycc-devel
----------------------------------------------------------------------------
-----------
Orange vous informe que cet e-mail a ete controle par l'anti-virus mail.
Aucun virus connu a ce jour par nos services n'a ete detecte.
- Re: [Tinycc-devel] 64bits - Wrong comparison between pointer and long cste, (continued)
- Re: [Tinycc-devel] 64bits - Wrong comparison between pointer and long cste, grischka, 2009/12/07
- RE: [Tinycc-devel] 64bits - Wrong comparison between pointer andlong cste, Christian Jullien, 2009/12/08
- RE: [Tinycc-devel] 64bits - Wrong comparison between pointerandlong cste, Christian Jullien, 2009/12/08
- RE: [Tinycc-devel] 64bits - Wrong comparison betweenpointerandlong cste, Christian Jullien, 2009/12/08
- [Tinycc-devel] longjmp not working on 64bit, Christian Jullien, 2009/12/11
- Re: [Tinycc-devel] longjmp not working on 64bit, grischka, 2009/12/17
- RE: [Tinycc-devel] longjmp not working on 64bit, Christian Jullien, 2009/12/18
- [Tinycc-devel] Wrong __int64 computation, Christian Jullien, 2009/12/18
- RE: [Tinycc-devel] Wrong __int64 computation, Christian Jullien, 2009/12/19
- Re: [Tinycc-devel] Wrong __int64 computation, grischka, 2009/12/19
- RE: [Tinycc-devel] Wrong __int64 computation,
Christian Jullien <=
Re: [Tinycc-devel] Understanding tcc Makefile, k1w1, 2009/12/07