Opinions on getting existing code 64-bit ready

Ask a Question related to UNIX Programming, Design and Development.

  1. #1

    Default Opinions on getting existing code 64-bit ready


    I'm curious if anyone has any opinions on the best way to get existing
    32-bit UNIX code ready for forthcoming 64-bit OSes and processors. What I've
    been thinking about doing is requiring that code be changed to tolerate both
    ILP32 and LP64 models. This seems to me to be both realistically doable as
    well as sufficient.

    It seems to me that 64-bit int's will likely be a loss overall.
    Presumably, 64-bit processors will be able to manipulate 32-bit quantities
    about as fast as they can manipulate 32-bit quantities and any possible loss
    will be made up for by the benefits of smaller structures easing memory
    bandwidth usage.

    I don't really want to start a religious war. I'm just looking for
    practical suggestions about how to draft coding standards so that code will
    work with minimal pain on future platforms.

    DS


    David Schwartz Guest

  2. Similar Questions and Discussions

    1. Make code wait, till other code is ready
      Hey there, sorry for the silly topic title, I'm not sure how to phrase my problem :$ I have an mxml page.. which initializes a manager in which...
    2. Opinions Sought: Is this an Appropriate Use Of Code Access Securit
      I'm interested in hearing opionions as to whether you think the following solution is a valid use of Code Access Security: Goal: Ensure all email...
    3. read existing code...
      hello i'm searching for a tool to be able to read the lingo-code of simple existing director- (lingo-) applications. thx in advance
    4. adding code to existing page
      How do you ad HTML Code to a page created on MS Publisher?
    5. W3D never ready
      My own fault, forgot to add the xtras for INetURL, Netfile & Netlingo. Ch chimpoid@hotmail.com (Chimpoid) wrote in message...
  3. #2

    Default Re: Opinions on getting existing code 64-bit ready

    On Thu, 3 Jul 2003 18:51:16 -0700 "David Schwartz" <davids@webmaster.com> wrote:
    > I'm curious if anyone has any opinions on the best way to get
    > existing 32-bit UNIX code ready for forthcoming 64-bit OSes and
    > processors.
    ISTM Sun has already produced a lot of documentation addressing this.
    I would use that as a starting point.

    Are there any ILP64 platforms?

    /fc
    Frank Cusack Guest

  4. #3

    Default Re: Opinions on getting existing code 64-bit ready

    "David Schwartz" <davids@webmaster.com> writes:
    > I'm curious if anyone has any opinions on the best way to get existing
    > 32-bit UNIX code ready for forthcoming 64-bit OSes and processors. What I've
    Forthcoming? They've been around for a decade.
    > been thinking about doing is requiring that code be changed to tolerate both
    > ILP32 and LP64 models. This seems to me to be both realistically doable as
    > well as sufficient.
    >
    > It seems to me that 64-bit int's will likely be a loss overall.
    > Presumably, 64-bit processors will be able to manipulate 32-bit quantities
    > about as fast as they can manipulate 32-bit quantities and any possible loss
    > will be made up for by the benefits of smaller structures easing memory
    > bandwidth usage.
    >
    > I don't really want to start a religious war. I'm just looking for
    > practical suggestions about how to draft coding standards so that code will
    > work with minimal pain on future platforms.
    It's rather easy when writing new code. Whenever you require a
    particular size for a variable, use one of the intXX_t types. Never
    cast a pointer to an integer and expect to be able to get back the
    right value.

    Fixing up old code can be a real PITA, though. Your best bet might be
    to compile it with a compiler that generates warnings for 64-bit
    unsafe things. Supplement with heavy testing, of course.

    --
    Måns Rullgård
    [email]mru@users.sf.net[/email]
    Måns Rullgård Guest

  5. #4

    Default Re: Opinions on getting existing code 64-bit ready


    "Frank Cusack" <fcusack@fcusack.com> wrote in message
    news:x5y65mj2brf.fsf@vger.corp.google.com...
    > On Thu, 3 Jul 2003 18:51:16 -0700 "David Schwartz" <davids@webmaster.com>
    wrote:
    > > I'm curious if anyone has any opinions on the best way to get
    > > existing 32-bit UNIX code ready for forthcoming 64-bit OSes and
    > > processors.
    > ISTM Sun has already produced a lot of documentation addressing this.
    > I would use that as a starting point.
    I only found a few FAQs that seemed to suggest that supporting both
    ILP32 and LP64 would be the best way to go.
    > Are there any ILP64 platforms?
    Not that I know of.

    DS


    David Schwartz Guest

  6. #5

    Default Re: Opinions on getting existing code 64-bit ready

    "David Schwartz" <davids@webmaster.com> writes:
    > "Frank Cusack" <fcusack@fcusack.com> wrote in message
    > news:x5y65mj2brf.fsf@vger.corp.google.com...
    >
    > > On Thu, 3 Jul 2003 18:51:16 -0700 "David Schwartz"
    > > <davids@webmaster.com>
    > wrote:
    >
    > > > I'm curious if anyone has any opinions on the best way to
    > > > get existing 32-bit UNIX code ready for forthcoming 64-bit OSes
    > > > and processors.
    >
    > > ISTM Sun has already produced a lot of documentation addressing
    > > this. I would use that as a starting point.
    >
    > I only found a few FAQs that seemed to suggest that supporting
    > both ILP32 and LP64 would be the best way to go.
    I don't know if you saw this, but it might have some relevant things
    in it.

    [url]http://docs.sun.com/db/doc/806-0477?q=lp64&a=load[/url]

    Joe
    joe@invalid.address Guest

  7. #6

    Default Re: Opinions on getting existing code 64-bit ready

    Frank Cusack wrote:
    > Are there any ILP64 platforms?
    IIRC, Cray C90 was an ILP64 platform.
    Bjorn Reese Guest

  8. #7

    Default Re: Opinions on getting existing code 64-bit ready

    Frank Cusack <fcusack@fcusack.com> writes in comp.unix.programmer:
    |Are there any ILP64 platforms?

    A handful of rare ones. Of the platforms X11/XFree86 has been ported
    to, the only ifdef for ILP64 mode is for CRAY - there's a sizable list
    for LP64 mode though. There was also a short lived custom port of
    Solaris using ILP64 that HaL did for their SPARC64 machines before Sun
    came out with the LP64 support in Solaris.

    --
    __________________________________________________ ______________________
    Alan Coopersmith [email]alanc@alum.calberkeley.org[/email]
    [url]http://www.CSUA.Berkeley.EDU/~alanc/[/url] aka: [email]Alan.Coopersmith@Sun.COM[/email]
    Working for, but definitely not speaking for, Sun Microsystems, Inc.
    Alan Coopersmith Guest

  9. #8

    Default Re: Opinions on getting existing code 64-bit ready

    [email]mru@users.sf.net[/email] (Måns Rullgård) wrote:
    > Forthcoming? They've been around for a decade.
    I thought the same thing, but then it occurred to me that the original
    poster is probably living in the world of Intel and AMD.
    > Fixing up old code can be a real PITA, though.
    I've never had problems, and most of the code I've ported to make 64-bit
    safe is kernel code (device drivers and big chunks of the real kernel on
    AIX and Solaris). If you start out with poorly written code --
    especially code that makes assumptions about sizeof(int) == sizeof(*void)
    -- then you'll have a bit of a headache, but even these are not too hard
    to find if you pay attention to compiler warning output.

    RFM
    --
    To reply, translate domain from l33+ 2p33|< to alpha.
    4=a 0=o 3=e +=t
    Fritz M Guest

  10. #9

    Default Re: Opinions on getting existing code 64-bit ready


    "Fritz M" <news@m4s0n3r.n3+> wrote in message
    news:Xns93B260041A5B6fritz2masonernet@139.187.81.1 ...
    > [email]mru@users.sf.net[/email] (Måns Rullgård) wrote:
    > > Forthcoming? They've been around for a decade.
    > I thought the same thing, but then it occurred to me that the original
    > poster is probably living in the world of Intel and AMD.
    More Intel, AMD, MIPS, and R10K. The only 64-bit OS I've used, other
    than Solaris, is OSF1.
    > > Fixing up old code can be a real PITA, though.
    > I've never had problems, and most of the code I've ported to make 64-bit
    > safe is kernel code (device drivers and big chunks of the real kernel on
    > AIX and Solaris). If you start out with poorly written code --
    > especially code that makes assumptions about sizeof(int) == sizeof(*void)
    > -- then you'll have a bit of a headache, but even these are not too hard
    > to find if you pay attention to compiler warning output.
    Yeah, but is it okay to replace that with code that assumes
    sizeof(long)==sizeof(void*)? That makes things easier than more general
    fixes.

    DS


    David Schwartz Guest

  11. #10

    Default Re: Opinions on getting existing code 64-bit ready

    David Schwartz <davids@webmaster.com> wrote:
    > "Fritz M" <news@m4s0n3r.n3+> wrote in message
    >> I've never had problems, and most of the code I've ported to make 64-bit
    >> safe is kernel code (device drivers and big chunks of the real kernel on
    >> AIX and Solaris). If you start out with poorly written code --
    >> especially code that makes assumptions about sizeof(int) == sizeof(*void)
    >> -- then you'll have a bit of a headache, but even these are not too hard
    >> to find if you pay attention to compiler warning output.
    >
    > Yeah, but is it okay to replace that with code that assumes
    > sizeof(long)==sizeof(void*)? That makes things easier than more general
    > fixes.
    use intptr_t instead. if it's available, it'll be the proper type. if its
    not, then your code won't silently break.

    - Bill
    William Ahern Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139