Questions tagged [x86-64]

x86-64 is a 64 bit extension to the Intel x86 architecture

x86-64 is a 64 bit instruction set, backwards compatible with the 16 and 32 bit architectures originating from the Intel 8086 processor. It is sometimes known as amd64 (common in GNU/Linux) or x64 (usually only seen in Windows).

The specification was created by AMD, and has been implemented by AMD, Intel, VIA, and others.

See the x86 tag for programming and optimising guides and other resources.

6825 questions
134
votes
10 answers

Why do x86-64 systems have only a 48 bit virtual address space?

In a book I read the following: 32-bit processors have 2^32 possible addresses, while current 64-bit processors have a 48-bit address space My expectation was that if it's a 64-bit processor, the address space should also be 2^64. So I was…
er4z0r
  • 4,711
  • 8
  • 42
  • 62
133
votes
3 answers

Possible GCC bug when returning struct from a function

I believe I found a bug in GCC while implementing O'Neill's PCG PRNG. (Initial code on Godbolt's Compiler Explorer) After multiplying oldstate by MULTIPLIER, (result stored in rdi), GCC doesn't add that result to INCREMENT, movabs'ing INCREMENT to…
vitorhnn
  • 1,043
  • 1
  • 8
  • 7
126
votes
11 answers

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…
maxpenguin
  • 5,039
  • 6
  • 28
  • 22
121
votes
19 answers

System.BadImageFormatException: Could not load file or assembly (from installutil.exe)

I am trying to install a Windows service using InstallUtil.exe and am getting the error message System.BadImageFormatException: Could not load file or assembly '{xxx.exe}' or one of its dependencies. An attempt was made to load a program with an…
Epaga
  • 38,231
  • 58
  • 157
  • 245
118
votes
1 answer

Ask GDB to list all functions in a program

How can you list all functions in a program with GDB?
pythonic
  • 20,589
  • 43
  • 136
  • 219
114
votes
8 answers

Targeting both 32bit and 64bit with Visual Studio in same solution/project

I have a little dilemma on how to set up my visual studio builds for multi-targeting. Background: c# .NET v2.0 with p/invoking into 3rd party 32 bit DLL's, SQL compact v3.5 SP1, with a Setup project. Right now, the platform target is set to x86 so…
Magnus Johansson
  • 28,010
  • 19
  • 106
  • 164
112
votes
10 answers

Why is x86 ugly? Why is it considered inferior when compared to others?

I've been reading some SO archives and encountered statements against the x86 architecture. Why do we need different CPU architecture for server & mini/mainframe & mixed-core? says "PC architecture is a mess, any OS developer would tell you…
claws
  • 52,236
  • 58
  • 146
  • 195
112
votes
5 answers

Memory alignment : how to use alignof / alignas?

I work with shared memory right now. I can't understand alignof and alignas. cppreference is unclear : alignof returns "alignment" but what is "alignment" ? number of bytes to add for the next block to be aligned ? padded size ? Stack overflow /…
Offirmo
  • 18,962
  • 12
  • 76
  • 97
110
votes
3 answers

How to build x86 and/or x64 on Windows from command line with CMAKE?

One way to get cmake to build x86 on Windows with Visual Studio is like so: Start Visual Studio Command prompt for x86 Run cmake: cmake -G "NMake Makefiles" \path_to_source\ nmake One way to get cmake to build x64 on Windows with Visual Studio is…
101010
  • 14,866
  • 30
  • 95
  • 172
100
votes
2 answers

What does @plt mean here?

0x00000000004004b6 : callq 0x400398 Anyone knows? UPDATE Why two disas printf give me different result? (gdb) disas printf Dump of assembler code for function printf@plt: 0x0000000000400398 : jmpq …
gdb
  • 7,189
  • 12
  • 38
  • 36
97
votes
2 answers

What does "rep; nop;" mean in x86 assembly? Is it the same as the "pause" instruction?

What does rep; nop mean? Is it the same as pause instruction? Is it the same as rep nop (without the semi-colon)? What's the difference to the simple nop instruction? Does it behave differently on AMD and Intel processors? (bonus) Where is the…
Denilson Sá Maia
  • 47,466
  • 33
  • 109
  • 111
97
votes
2 answers

What does the endbr64 instruction actually do?

I've been trying to understand assembly language code generated by GCC and frequently encounter this instruction at the start of many functions including _start(), but couldn't find any guide explaining its purpose: 31-0000000000001040 <_start>: 32:…
Mah35h
  • 1,127
  • 1
  • 7
  • 18
94
votes
2 answers

How can objdump emit intel syntax

How can I tell objdump to emit assembly in Intel Syntax rather than the default AT&T syntax?
pythonic
  • 20,589
  • 43
  • 136
  • 219
93
votes
1 answer

x86_64 registers rax/eax/ax/al overwriting full register contents

As it is widely advertised, modern x86_64 processors have 64-bit registers that can be used in backward-compatible fashion as 32-bit registers, 16-bit registers and even 8-bit registers, for example: 0x1122334455667788 ================ rax (64…
GreyCat
  • 16,622
  • 18
  • 74
  • 112
88
votes
3 answers

Where is the x86-64 System V ABI documented?

The x86-64 System V ABI (used on everything except Windows) used to live at http://x86-64.org/documentation/abi.pdf, but that site has now fallen off the internet. Is there a new authoritative home for the document?
Jeffrey Yasskin
  • 5,171
  • 2
  • 27
  • 39