How does 64 bit code work on OS-X 10.5?

Posted by philcolbourn on Stack Overflow See other posts from Stack Overflow or by philcolbourn
Published on 2010-03-20T07:20:32Z Indexed on 2010/03/20 7:31 UTC
Read the original article Hit count: 305

Filed under:

I initially thought that 64 bit instructions would not work on OS-X 10.5.

I wrote a little test program and compiled it with GCC -m64. I used long long for my 64 bit integers.

The assembly instructions used look like they are 64 bit. eg. imultq and movq 8(%rbp),%rax.

I seems to work.

I am only using printf to display the 64 bit values using %lld.

  1. Is this the expected behaviour?
  2. Are there any gotcha's that would cause this to fail?
  3. Am I allowed to ask multiple questions in a question?
  4. Does this work on other OS's?

© Stack Overflow or respective owner

Related posts about gcc

Related posts about 32bit-64bit