Pointer 1<<34 doesn't make sense on 32-bit platforms.

The for loop in main, indeed the whole of main is just a test harness.

I need to simulate addresses that span the 32-bit boundary in 64-bit and slot size in both 32/64-bit.

I also don't see how you can get the same output on 32-bit and 64-bit platforms when ALIGN_BITS depends on the pointer size (sizeof(void*) >> 1i64). The data or ALIGN_BITS would need to be changed.

You are right that the output won't be the same in both modes.

The nice thing about the MS compiler intrinsic types is that my posted code compiles clean under /Wall in both modes. And runs, doing the 'right thing' in both modes. Albiet that the for loop never terminates in 32-bit mode due to wraparound.

Your code

The salient bit missing from your code is the conditional test for 32/64 bit compilation?

Also, what you've called NOP_BITS (which is unused) would be 3 or 4 (32/64 repectively) not 2.

Does your code produce the same output for 64-bit?


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re^2: 64-bit *nix/gcc expertise required by BrowserUk
in thread 64-bit *nix/gcc expertise required (THIS IS NOT OFF TOPIC!) by BrowserUk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.