x86-64

What is the difference between the x64 and x86 library files in DirectX?

I recently got Visual Studio on a new computer, and to set up DirectX on it, I went to Tools>Options>Projects and Solutions>VC++ Directories and under Library Files made a new entry C:\Program Files\Microsoft DirectX SDK (August 2009)\Lib\x86 and now ran a test program (essentially just initialized DirectX) and it worked fine. However,...

Assembly/Linking problem with nasm and ld

I have a sample assembly file that I compile with nasm: nasm -f elf syscall.asm This generates a syscall.o file. I try to link it with ld: ld -o syscall syscall.o The ld command fails with the following error: ld: i386 architecture of input file `syscall.o' is incompatible with i386:x86-64 output However, if I do ld -o syscall...

Using assembly JMP function on x86_64

I'm really new to programming (in general - it's pathetic) and some Python-related assembly has cropped up in this app that I'm hacking to run on 64-bit. Essentially, the code goes like this: #define FUNCTION(name) \ .globl _##name; \ _##name: \ jmp *(_p_##name) .text FUNCTION(name) Th...

Is it possible to vectorize myNum += a[b[i]] * c[i]; on x86_64?

What intrinsics would I use to vectorize the following(if it's even possible to vectorize) on the x86_64? double myNum = 0; for(int i=0;i<n;i++){ myNum += a[b[i]] * c[i]; //b[i] = int, a[b[i]] = double, c[i] = double } ...

Assembly - 32 bit vs 64 bit...?

Hey guys... I'm really wanting to learn assembly. I'm pretty good at c/c++, but want a better understanding of what's going on at a lower level. I realize that asembly related questions have been asked before, but I'm just looking for some direction that's particular to my situation: I'm running windows 7, and am confused about how I ...

Implementing traceback on i386

Hi, I am currently porting our code from an alpha (Tru64) to an i386 processor (Linux) in C. Everything has gone pretty smoothly up until I looked into porting our exception handling routine. Currently we have a parent process which spawns lots of sub processes, and when one of these sub-processes fatal's (unfielded) I have routines to ...

Faster math library than glibc on x86_64/linux?

Is there a drop-in replacement to glibc's libm (and headers?) for x86_64-linux that is faster? ...

What about Programmer "Invisible" registers?

These are "Programmer Visible" x86-64 registers: What about the invisible registers? Just now I learned that MMU registers, Interrupt Descriptor Table (IDT) uses these invisible registers. I'm learning these things in the hard way. Is there any resource (book/documentation/etc) that gives me the complete picture at once? I am aware ...

P6 Architecture - Register renaming aside, does the limited user registers result in more ops spent spilling/loading?

I'm studying JIT design with regard to dynamic languages VM implementation. I haven't done much Assembly since the 8086/8088 days, just a little here or there, so be nice if I'm out of sorts. As I understand it, the x86 (IA-32) architecture still has the same basic limited register set today that it always did, but the internal register...

How to access C arrays from assembler for Windows x64?

I've written an assembler function to speed up a few things for image processing (images are created with CreateDIBSection). For Win32 the assembler code works without problems, but for Win64 I get a crash as soon as I try to access my array data. I put the relevant info in a struct and my assembler function gets a pointer to this stru...

x86 opcode alignment references and guidelines

I'm generating some opcodes dynamically in a JIT compiler and I'm looking for guidelines for opcode alignment. 1) I've read comments that briefly "recommend" alignment by adding nops after calls 2) I've also read about using nop for optimizing sequences for parallelism. 3) I've read that alignment of ops is good for "cache" performanc...

Running 32 bit assembly code on a 64 bit Linux & 64 bit Processor : Explain the anomaly.

Hello, I'm in an interesting problem.I forgot I'm using 64bit machine & OS and wrote a 32 bit assembly code. I don't know how to write 64 bit code. This is the x86 32-bit assembly code for Gnu Assembler (AT&T syntax) on Linux. //hello.S #include <asm/unistd.h> #include <syscall.h> #define STDOUT 1 .data hellostr: .ascii "hello w...

How to install python2.6-devel package under CentOs 5

I need to install mysql-python under python2.6. mysql-python package needs python2.6-devel package that depends on the libpython2.6.so.1.0(64bit) I found on the net some python2.6-devel packages, but can't find libpython2.6 Server architecture is x86_64. Maybe someone have this lib, or know where i can find it. Thanks for help) ...

Floating point vs integer calculations on modern hardware

I am doing some performance critical work in C++, and we are currently using integer calculations for problems that are inherently floating point because "its faster". This causes a whole lot of annoying problems and adds a lot of annoying code. Now, I remember reading about how floating point calculations were so slow approximately cir...

Examining C/C++ Heap memory statistics in gdb

I'm trying to investigate the state of the C/C++ heap from within gdb on Linux amd64, is there a nice way to do this? One approach I've tried is to "call mallinfo()" but unfortunately I can't then extract the values I want since gdb doesn't deal with the return value properly. I'm not easily able to write a function to be compiled into...

Actual long double precision does not agree with std::numeric_limits

Working on Mac OS X 10.6.2, Intel, with i686-apple-darwin10-g++-4.2.1, and compiling with the -arch x86_64 flag, I just noticed that while... std::numeric_limits<long double>::max_exponent10 = 4932 ...as is expected, when a long double is actually set to a value with exponent greater than 308, it becomes inf--ie in reality it only has...

Determine 32/64 bit architecture in assembly

I was reading over this question and wondered if the accepted answer might also be a way to determine the architecture. For instance, in asm could I push a WORD onto the stack and then check SP. Compare the new SP to the old SP: Diff of 4 means 32 bit Diff of 8 means 64 bit Am I correct in this thinking? ...

64bit registers on 32bit binaries: At what an extend are they used? [dependence to OS, Machine considered]

Any tips to programming would be appreciated. ...

Detecting architecture at compile time from MASM/MASM64

How can I detect at compile time from an ASM source file if the target architecture is I386 or AMD64? I am using masm(ml.exe)/masm64(ml64.exe) to assemble file32.asm and file64.asm. It would be nice to create a single file, file.asm, which should include either file32.asm, or file64.asm, depending on the architecture. Ideally, I would l...

Additional concerns when compiling for x64

I know that the additional consideratiosn when compiling for x64 is that some data types, like ints, can hold larger values. Are there any concerns? VS2010, released a few days ago, can support compiling for x64 and x32, just like VS2008. The app is x32/86 only. I keep thinking that the app needs to be 64 bit however. What am I missing?...