Board index » cppbuilder » Re: vote for a native 64-bit compiler

Re: vote for a native 64-bit compiler


2005-02-12 04:03:03 AM
cppbuilder72
Sean Hoffman < XXXX@XXXXX.COM >writes:
Quote
Chris Uzdavinis (TeamB) wrote:
>Sean Hoffman < XXXX@XXXXX.COM >writes:
<snip>

You're right, I did make an assumption. I assumed Windows and
Microsoft as a compiler; and I stand corrected. At the time I was
interested in looking at doing 64 bit stuff for Windows, there were no
practical compiler options other than Microsoft's (I couldn't afford
Pathscale). GCC wasn't 64 bit at that time (not sure if that's the
case now or not.. anyone know if I can build 64 bit XP64 binaries with
GCC now?)

As far as your example, I'm assuming you didn't compile this using
Visual Studio, correct?
That's right, that was done using g++ 3.3.3 for AMD64 on SuSE linux.
--
Chris (TeamB);
 
 

Re:Re: vote for a native 64-bit compiler

"Will DeWitt Jr." < XXXX@XXXXX.COM >writes:
Quote
Alex Bakaev [TeamB] wrote:

>The language specifies relations between the integer types, not the
>number of bits in them.

How do you explain things like __int8, __int16, __int32 and __int64
(which, IIRC, are part of standard C now)? And surely it's something
that's done on a language by language basis (and can often be
influenced by the platform, e.g. - Unix vs. Windows).
C++ is based on C89, not C99, and does not have those constructs.
--
Chris (TeamB);
 

Re:Re: vote for a native 64-bit compiler

Chris Uzdavinis (TeamB) < XXXX@XXXXX.COM >wrote in
Quote

C++ is based on C89, not C99, and does not have those constructs.

I did a double-take on that. Doesn't the standard say that a valid C
program is also a valid C++ program?
mr_organic
 

{smallsort}

Re:Re: vote for a native 64-bit compiler

"mr_organic" < XXXX@XXXXX.COM >writes:
Quote
Chris Uzdavinis (TeamB) < XXXX@XXXXX.COM >wrote in
news: XXXX@XXXXX.COM :

>
>C++ is based on C89, not C99, and does not have those constructs.
>

I did a double-take on that. Doesn't the standard say that a valid C
program is also a valid C++ program?
No, C++ is based on a specific version of C. Changes to the C
language will not affect C++ unless the C++ committee adopts those
changes too. (And the C++ committee will probably try to accomodate
many of the changes, but some simply do not make sense for C++.) You
can read about this in the normative references in the C++ standard,
section 1.2. They refer specifically to the version of C specified in
ISO/IEC 9989:1990.
--
Chris (TeamB);
 

Re:Re: vote for a native 64-bit compiler

mr_organic wrote:
Quote
I did a double-take on that. Doesn't the standard say that a valid C
program is also a valid C++ program?
No, it incorporates by reference the original C standard, and the 1995
technical corrigendum. The C++ standard was ratified in 1998, the
revised C stanard was the following year. How can the 1998 standard
include concepts that official did not exist when it was published? <g>
You could argue for forward-compatibility automatically including all C
revisions, but that does not work when C is steered by a different
committee that does not regard C++ concerns as limitting on their own,
separate language.
Of course improved compatibility with C99 is a goal of the C++
committee. You will see the C99 standard library incorporated in
Library TR1, the preprocessor is being actively looked at, 'long long'
is pretty much a done deal (although integer promotion and function
overloading make this a little more interesting for C++, especially
when figuring out the type of a literal - should MAXINT + 1 be unsigned
int or long long?)
On the other hand, 'restrict' and VLAs are a long way off, and I have
not heard many calls for the different floating point types...
AlisdairM(TeamB)
 

Re:Re: vote for a native 64-bit compiler

"Alisdair Meredith" <alisdair.meredith@ XXXX@XXXXX.COM >
wrote in news:420d295e$ XXXX@XXXXX.COM :
Quote
mr_organic wrote:

>I did a double-take on that. Doesn't the standard say that a valid C
>program is also a valid C++ program?

No, it incorporates by reference the original C standard, and the 1995
technical corrigendum. The C++ standard was ratified in 1998, the
revised C stanard was the following year. How can the 1998 standard
include concepts that official did not exist when it was published? <g>

You could argue for forward-compatibility automatically including all C
revisions, but that does not work when C is steered by a different
committee that does not regard C++ concerns as limitting on their own,
separate language.

Of course improved compatibility with C99 is a goal of the C++
committee. You will see the C99 standard library incorporated in
Library TR1, the preprocessor is being actively looked at, 'long long'
is pretty much a done deal (although integer promotion and function
overloading make this a little more interesting for C++, especially
when figuring out the type of a literal - should MAXINT + 1 be unsigned
int or long long?)

On the other hand, 'restrict' and VLAs are a long way off, and I have
not heard many calls for the different floating point types...

AlisdairM(TeamB)

So is it fair to say that there is *no* C99-conformant compiler in the
Windows market now? I am unaware of any vendor that sells a "pure C"
compiler, and AFAIK GCC is not fully C99 compliant yet. If Microsoft is
tracking the ISO C++ standard, then it too will not compile C99-based C
code.
Am I missing something obvious here? If I want to write pure, C99-
compliant C code targetting a WIN32 platform, what toolset can I use?
mr_organic
 

Re:Re: vote for a native 64-bit compiler

"mr_organic" < XXXX@XXXXX.COM >writes:
Quote
So is it fair to say that there is *no* C99-conformant compiler in the
Windows market now? I am unaware of any vendor that sells a "pure C"
compiler, and AFAIK GCC is not fully C99 compliant yet. If Microsoft is
tracking the ISO C++ standard, then it too will not compile C99-based C
code.

Am I missing something obvious here? If I want to write pure, C99-
compliant C code targetting a WIN32 platform, what toolset can I use?
It seems that C99 is in the same status C++ was for a long time: there
is no implementation for the full spec, although all vendors cover the
most "interesting" features.
BTW, gcc, VC++, Borland, Intel and most compiler vendors provide a C++
compiler *and* a C compiler, even if they share a large part of the
infrastructure. GCC has the C and C++ front ends on separate
executables, while most other vendors has both frontend on the same
executable, but this is just a implementation detail. So you have
plenty of options for pure C development.
--
Oscar
 

Re:Re: vote for a native 64-bit compiler

mr_organic wrote:
[big snip]
Quote

Am I missing something obvious here? If I want to write pure, C99-
compliant C code targetting a WIN32 platform, what toolset can I use?

Doesn't Comeau support C99 fully?
.a
 

Re:Re: vote for a native 64-bit compiler

"Alex Bakaev [TeamB]" < XXXX@XXXXX.COM >writes:
Quote
Doesn't Comeau support C99 fully?
From reading their web page, my conclusion is "no", although their
info is outdated: they mention C++'s "export" as not supported, but it
is supported since a long time ago.
--
Oscar
 

Re:Re: vote for a native 64-bit compiler

mr_organic wrote:
Quote
So is it fair to say that there is no C99-conformant compiler in the
Windows market now?
Possbily. I have no need of the C99 language so I have not researched
for existing implementations. Note that C99 replaces the existing C89
standard, so if your 'C' vendor does not implement C99, they do not
implement a conforming C compiler.
One of the problems of the C++ standard is that it
includes-by-reference a standard that is no longer available - try
buying an out of date standard from ISO and you will see what I mean!
There are also certain 'blended' implementations that support elements
of C99 as a conforming extension to C++. For instance, _Pragma sits in
the list of identifiers reserved to the implementation, so a vendor can
choose to implement this feature as specified in C99 as a conforming
C++ extension. While you cannot implement the entire standard this way
(new keywords are awkward for a start!) you can certainly make some
progress.
Quote
If Microsoft is tracking the ISO C++ standard, then it too will not
compile C99-based C code.
I am not sure what Microsoft are doing precisely, but I'm not familiar
with their efforts on straight C++. Last I heard they had no intention
of implementing a fully conforming C++ compiler, the export keyword and
2-phase looking for templates being the two most notable omissions.
Quote
Am I missing something obvious here? If I want to write pure, C99-
compliant C code targetting a WIN32 platform, what toolset can I use?
I was fairly sure that EDG sold a C99 conforming front end, and
Dinkumware have the library, so it should be possible to put out a C99
toolset. It has not bothered me significantly enough to seek one out
though, and as Alex says - the parallels with finding a conforming C++
compiler are scary <g>
Off the record, I suspect the most controversial parts of C++0x to
implement will continue to be holdovers from C++98. The language is
already large and complex enough without adding the kitchen sink, so
additions will be carefully chosen and almost certainly have at least
one implementation before being accepted. That said, we'll see what
sneaks under the wire as the process comes to an end - at some point
you have to stop, write the words and ship!
AlisdairM(TeamB)
 

Re:Re: vote for a native 64-bit compiler

Sean Hoffman in <420cde2c$ XXXX@XXXXX.COM >:
Quote
The benefit of a register access is that it's much MUCH
faster than a memory access. In the context of a block of code, storing
that data in registers rather than in memory will result in code that
runs faster because it takes less time to access the data. How much of
an improvement that will bring is largely dependent on the code itself.
Not universally true. CPUs like P4 have much more actual registers than
those 'visible' to the user and they use register renaming to map
specific registers to specific roles for processing particular
instructions. Combined with instruction reordering / out-of-order
execution this can have the same effect as a bigger official register set
(depending on the instruction dependencies in the actual code).
More importantly, certain local memory accesses are almost as fast as
register access (and certainly faster than access to a stalled register)
and these reads/writes can be handled completely within the CPU chip;
some of the writes may never go into external caches/memory. Intel had a
special name for that but I have forgotten it - I haven't done serious
assembly programming for a couple of years. <g>
So the benefit of the bigger register set may actually not be as big as
the difference to the tiny 'nominal' x86 register set makes it seem.
--
Sherlog [Personenkennzahl 250866413515 / Stefan Otto / SO1801-RIPE]
 

Re:Re: vote for a native 64-bit compiler

Will DeWitt Jr. in <420cfea7$ XXXX@XXXXX.COM >:
Quote
Alex Bakaev [TeamB] wrote:

>The language specifies relations between the integer types, not the
>number of bits in them.

How do you explain things like __int8, __int16, __int32 and __int64
(which, IIRC, are part of standard C now)? And surely it's something
that's done on a language by language basis (and can often be
influenced by the platform, e.g. - Unix vs. Windows).
These are Microsoftisms (emulated by all self-respecting Wintel
compilers, of course).
The type names in C99 are int32_t, uint32_t and so on - just look into
<stdint.h>, which BCB also has had since at least version 6. But this has
nothing to do with what the language says about char, int, long and so
on. According to the *language* definition a long must be at least 32
bits and a char must not be longer - but it could be just as long as a
long. In fact, a couple of years I worked with a system where
sizeof(char) == sizeof(short) == sizeof(int) == sizeof(long) ==
sizeof(void*). This certainly simplified a lot of things. ;-)
--
Sherlog [Personenkennzahl 250866413515 / Stefan Otto / SO1801-RIPE]
 

Re:Re: vote for a native 64-bit compiler

"Sean Hoffman" < XXXX@XXXXX.COM >schrieb im Newsbeitrag news:420cf082$ XXXX@XXXXX.COM ...
Quote
Whoops, I also noticed another error on my part with regards to the size of long. long really IS 64 bits.
I think that depends on the platform and compiler you are using.
Regarding the MSDN documentation all integral datatypes will have the same size
on a 64-bit Windows operating system as they had on the current 32-bit
Windows operating systems.
Quote from the MSDN documentation
"
An int and a long are 32-bit values on 64-bit Windows operating systems.
size_t, time_t, and ptrdiff_t are 64-bit values on 64-bit Windows operating systems.
"
I hadnīt time to install 64 Bit XP yet, so i can only refer to the MSDN documentation.
Quote
[...]
Andre
 

Re:Re: vote for a native 64-bit compiler

Sherlog wrote:
Quote
In fact, a couple of years I worked with a system
where sizeof(char) == sizeof(short) == sizeof(int) == sizeof(long) ==
sizeof(void*). This certainly simplified a lot of things. ;-)
LOL, I bet. =)
Will
--
Want native support in Delphi for AMD64/EM64T? Vote here--
qc.borland.com/wc/qcmain.aspx
 

Re:Re: vote for a native 64-bit compiler

Sherlog < XXXX@XXXXX.COM >writes:
[snip]
Quote
According to the *language* definition a long must be at least 32
bits [snip]
It is not clear if you are talking about C99 or C++, but your claim is
false for the later.
BTW, the int size used on compilers for the x86 64bit architectures
seems in conflict with the C++ standard (3.9.1/2):
"... Plain ints have the natural size suggested by the architecture of
the executing environment^(39). ..."
The footnote 39 says:
"That is, large enough to contain any value in the range of INT_MIN
and INT_MAX, as defined in the header <climits>."
which is a cyclic definition, but the intent is clear: an int in a 64
bit processor should be 64 bits wide. This would cause some problems
for using 32 bit and 16 bit types: `short int' for 32 bits and
`short short int' for 16 bits?
[snip]
--
Oscar