Welcome, Guest. Please login or register.

Author Topic: 64 bit integers in SAS/C  (Read 13031 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show all replies
Re: 64 bit integers in SAS/C
« on: July 21, 2013, 10:06:55 PM »
Quote from: nOw2;741497

I'm not confident of patching the compiler with experimental code. SAS/C 6.5x is a restriction at the moment.


If you roll your own 64-bit int math functionality then it will also be experimental. If you don't want experimental then consider another compiler. I've found bugs in the 64-bit integer math of some versions of GCC 3.x. The latest version of vbcc has been accurate and is reasonably fast from what I've seen with 64-bit int. The next version out soon will have much faster 64x64=64 for the 68060 ;).

What does SAS/C support that you need?

Quote from: nOw2;741497

I'm thinking of using two longs to hold the data, even if that makes calculations interesting. UtilityBase functions may be suitable for that, otherwise I'll roll my own. This way existing code will continue to work as it does today (little-endian style) and new code can be adapted to see the higher bytes.


The utility.library only has partial 64-bit integer functions. A true 64x64=64 bit multiplication becomes easy with 32x32=64 help but there is not much help for 64/64=64 which is dead slow as there is no hardware help on any 68k processor. Addition and subtraction of full 64-bit numbers are easy enough but faster with hardware help that C does not provide. Logic operations are no problem and fast even with C.

Itix's suggestion can be done but you will be reinventing the wheel for a stoneage compiler. New compilers already have well oiled and nicely rounded 64-bit wheels.