delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/04/08/21:58:08

From: buers AT gmx DOT de (Dieter Buerssner)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: GCC BUG & 64-BIT INTEGERS PROBLEMS
Date: 9 Apr 2000 00:42:02 GMT
Lines: 45
Message-ID: <8coqeb.3vvqo2j.0@buerssner-17104.user.cis.dfn.de>
References: <38EFB4DF DOT 7AD2BF3C AT mtu-net DOT ru>
NNTP-Posting-Host: pec-3-159.tnt2.s2.uunet.de (149.225.3.159)
Mime-Version: 1.0
X-Trace: fu-berlin.de 955240922 6946614 149.225.3.159 (16 [17104])
X-Posting-Agent: Hamster/1.3.13.0
User-Agent: Xnews/03.02.04
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Alexei A. Frounze wrote:

>I define two 64-bit integer values as folows:
>--------8<--------
>long long A, B;
>--------8<--------
>
>then I assign something to them (actually I call a routine that stores
>there 64-bit results of the RDTSC CPU instruction).
>
>Then I try to shift these A and B values right:
>--------8<--------
>A>>=32;
>B>>=33;
>--------8<--------

Please note, that shifts are only well defined for unsigned integral
values in C. Also, I think that the output of the RDTSC opcode really
should be interpreted as an unsigned long long. This probably won't cure 
your problem, but you might want to try it anyway.

>But GCC generates the following faulty code (see attached screenshot from
>builtin RHIDE debugger/disassembler).

It is difficult, to read your screenshot. (This may be due to my 
news-reader.) I think more people could help you, if you posted the
C source code and yoursrc.s, the output of 

  gcc [your favorite compiler otions] -S yoursrc.c

>Btw, is it possible to printf() 64-bit integers as well as 32-bit? 

  long long ll;
  unsigned long long ull;
  [...]
  printf("ll=%Ld, ull=%Lu\n", ll, ull);

>How to make RHIDE supporting 64-bit values too?

I don't use Rhide, no idea.

[Not too helpful (at least for me) screenshot snipped]

-- 
Regards, Dieter

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019