x86-64

GCC 4.5: "checking whether the C compiler works... no" error when CFLAGS="-arch x86_64"

I compiled and installed GCC 4.5.1 via MacPorts in my installation of Mac OS X 10.6.4. When trying to ./configure software (such as, but not limited to: Wine 1.3.0, libjpeg, etc.), I set the compiler flag to CFLAGS = "-arch x86_64 -m64" to make sure that the compiled program will be 64-bit enabled. But I got an error during configure say...

How can I call sprintf from x86_64 assembly?

I am trying to convert a double to a string on the stack from x86_64 assembly code: bs.code += isa.movsd(registers.xmm0, MemRef(registers.rsp)) bs.code += isa.pop(registers.rax) bs.code += isa.push(registers.rbp) bs.code += isa.mov(registers.rbp, registers.rsp) bs.code += isa.sub(registers.rsp, ...

What's use of %c in x86_64 inline assembly?

I'm reading KVM source code and confronted with x86_64 inline assembly. In the following code, what's use of "%c"? It it new feature in x86_64 inline assembly? Any reference for new features in x86_64 inline assembly in gcc? Many thanks /* Check if vmlaunch of vmresume is needed */ "cmp $0, %1 \n\t" /* Load guest registers....

64 bits binary form in assembler....

I'm kind a of making a "JIT" for a numeric routine that I need to compute fast, for x86-64. I'm only using sse instructions for arithmetics and of course some moves. My application generates all of those by simply writing the binary form of machine instructions to some part of memory and then executing. For getting the binary form of ins...

Where did int 3 go?

Hi, In 32 bits mode programming I used to employ int 3 in my programs a lot for stopping at a given location with the debugger (embedding the instruction in the source). Now in 64 bits it seems to not be working, producing a very ordinary SIGSEGV under gdb and destroying the program beyond hope ("Program terminated with signal SIGSEGV,...

How to encode an AVI from x64 .Net Application?

I have a .Net application which we compile in both x86 and x64 bit. One feature is the video export to avi, but on the x64 version this doesn't work. The reason, I think, is that it uses the win32 dll called AviFil32.dll to encode the avis, and this doesn't like being called by a x64 process. Originally I thought the problem was a lack ...

What's the state of compilers that generate X86 assembly today?

Whenever I talk to people that work with real-time preformance they tend to point out that the generated X86 assembly instructions are not that efficent. With things like VMX on the horizon I have to ask, how likely is it that commercial C++ compilers will utilize these instruction sets? I get the feeling that compiler vendors don't emi...

gcc - writing and executing code in the bss - setting the permission flags

Hi all, I am generating x86-64 code at runtime in a C program on a linux system (centos 5.4 to be exact). I generate my bytecodes into a global array as shown below char program[1024 * 1024] __attribute__((aligned (16))); and then call into it via a function pointer. My issue is, when I compile the program like this gcc -std=gnu99...

Help understanding x86-64 function preamble

I am experiencing a crash, and while investigating I found myself totally blocked by the following code: 0000000000000a00 <_IO_vfprintf>: a00: 55 push %rbp a01: 48 89 e5 mov %rsp,%rbp a04: 41 57 push %r15 a06: 41 56 push %r14 a08: ...

CPU Cycle count based profiling in C/C++ Linux x86_64

I am using the following code to profile my operations to optimize on cpu cycles taken in my functions. static __inline__ unsigned long GetCC(void) { unsigned a, d; asm volatile("rdtsc" : "=a" (a), "=d" (d)); return ((unsigned long)a) | (((unsigned long)d) << 32); } I don't think it is the best since even two consecutive call...

How to be sure if a processor is 32bits or 64bits ? Are dual core processors 32 or 64 bits ?

Having a Macbook Pro with windows installed thanks to bootcamp, I have several questions: Under windows, I see that processes only use 50% maximum of the CPU charge, is that because the processor is a dual core and because the process is not multi-threaded ? Should I install windows xp version 64 bits instead, to have better performanc...

Is there a way of forcing a variable to stay cached in x86(/_64)?

With Blackfin processors, I can declare a variable with "l1_data" attribute in gcc, and that variable stays in L1 data SRAM. Is there a way to do this on x86 or x86_64? ...

Xcode Only Gives Me Desktop Architectures for iOS App

I have an iOS project that I've put in Dropbox to work with a few friends. The issue is that it seems to get "corrupted", so that after some time (after someone else has accessed the Xcode project file), when I try to go and open it again I get a Base SDK Missing error. In the Project Settings, I discover that I'm missing the valid ARM6/...

Why does this code cause an access violation exception?

_memcpy_r SEGMENT memcpy_r PROC mov r10, rdi mov r11, rsi mov rdi, rcx mov rsi, rdx mov rcx, r8 shr rcx, 3 rep movsq mov rcx, r8 and rcx, 7 rep movsb mov rsi, r11 mov rdi, r10 ret memcpy_r ENDP _memcpy_r ENDS END I have the above code in a .asm file which I'm using in a Visual Studio 2010 project. It's set to compile us...

x86 Assembly: INC and DEC instruction and overflow flag

In x86 assembly, the overflow flag is set when an add or sub operation on a signed integer overflows, and the carry flag is set when an operation on an unsigned integer overflows. However, when it comes to the inc and dec instructions, the situation seems to be somewhat different. According to this website, the inc instruction does not...

how to set control register 0 (cr0) bits in x86-64 using gcc assembly on linux

I am using the following code to set the cr0 bit to disable cache. When I compile this #include <stdio.h> int main() { __asm__("pushl %eax\n\t" "mov %cr0,%eax;\n\t" "orl $(1 << 30),%eax;\n\t" "mov %eax,%cr0;\n\t" "wbinvd\n\t" "popl %eax"...

Why does Math.Exp give different results between 32-bit and 64-bit, with same input, same hardware

I am using .NET 2.0 with PlatformTarget x64 and x86. I am giving Math.Exp the same input number, and it returns different results in either platform. MSDN says you can't rely on a literal/parsed Double to represent the same number between platforms, but I think my use of Int64BitsToDouble below avoids this problem and guarantees the sa...

How can I call jstack programmatically on a 64-bit process?

I've got a little tool to help debug client problems with our Java application. Basically it runs jps.exe to get all the Java processes running on the machine, and then calls jstack and jmap on each of them in turn. Finally, it zips everything up and FTP's it to us for forensic analysis. To run any of the commands it uses the ProcessB...

Any Debian based Linux distribution optimized for I686 or X86_64 and suitable for a number crunching cluster

I only know of Arch Linux which is pretty awesome and I use it for my desktop. But its rolling release model makes me wary of using it for servers. I know that the benefit of an optimized distribution will not be striking, at least it is unlikely to hurt. Given that I have more modern CPU I would rather enjoy an occasional benefit rather...

Centos x86_64 PHP 5.2.14 SQLITE missing? (WEBTATIC repo)

Hello, i allready updated php on my server to version 5.2.14 from webtatic repository (http://repo.webtatic.com/yum/centos/5/x86_64/). But i can't find SQLITE. Can someone help me? ...