views:

351

answers:

4

Some old x86 instructions are undefined in 64-bit mode. For instance LDS, LES and LSS, or short opcodes of the INC r16 (40 + rw) and INC r32 (40 + rd) instructions.

Are there any instructions that are defined only in 64-bit mode, and not in 32-bit protected mode?

Edit: The context is development of an x86 processor. I want to make sure I'm compatible to the spec.

+2  A: 

There is an addressing mode, which has no counterpart in 32 bit: Instruction pointer relative addressing. In 32 bit mode, this is only available with branches (aka branch offset), in 64 bit mode you can form effective addresses for any memory operand relative to the (r)ip.

So, the instruction

mov rbx,$100[rip]

does exist in x86-64, while

mov ebx,$100[eip]

does not in x86.

drhirsch
A: 

You can always look into the different manuals at http://www.intel.com/products/processor/index.htm?iid=dev%5Fcenter+tech%5Fhw%5Fdesign+prods+processors to find such instructions. Will be a lot of work tough ;)

Filip P.
Yes, I have those. That's just what I'm trying to avoid :)
Nathan Fellman
+1  A: 

Setting aside old instructions that now operate on 64 bit registers (they are really new instructions as they use a distinct binary representation), I can think of at least two instructions that are 64-bit only: syscall and sysret instructions.

Mehrdad Afshari
64-bit registers are specified with REX.W, which is a byte beginning with 0x4, and which maps to `INC` in 32-bit mode, so they're not really new instructions.
Nathan Fellman
Nathan: 64-bit registers are specified with REX.W... which makes them have a distinct binary value, and make them new instructions, at least as far as Intel marketing goes.
Mehrdad Afshari
A: 

the opposite is much easier to come up with;) like cmpxchg8b .... you'd never use that one in 64-bit mode.

Peeter Joot