r/Compilers • • Jun 13 '26

IA64 Instruction Encoding

I’m preparing to write a compiler backend for the first time, and need to understand how x86_64 instructions are encoded. I’ve written a few simple programs with x86_64 assembly language but I’m not deeply familiar with the architecture. I assume that the x86_64 manual is the definitive guide, but it’s very long, dry, and covers a lot of details about “real mode” and backward compatibility that I frankly don’t understand. Explanations or pointers to good resources are much appreciated.

Edit: Changed IA64 to x86_64

14 Upvotes

15 comments sorted by

View all comments

Show parent comment

3

u/[deleted] Jun 13 '26

Sorry, I meant x86_64. I’m writing a JIT compiler for my application, so assembly output isn’t an option.

4

u/braaaaaaainworms Jun 14 '26

x86 encoding is a nightmare to deal with, check out https://github.com/herumi/xbyak

3

u/[deleted] Jun 14 '26

[removed] — view removed comment

1

u/[deleted] Jun 14 '26

Thanks, that’s a good point. At least initially, I’ll only generate instructions to read, write, and do arithmetic on struct fields. I guess I’ll generate some output binaries to run through a disassembler.