mirror of
https://github.com/odin-lang/Odin.git
synced 2026-07-19 06:01:11 +00:00
Minimize x86.Instruction size to be 64-bytes rather than 72-bytes
This commit is contained in:
@@ -30,14 +30,14 @@ Rep :: enum u8 {
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
Instruction :: struct #packed {
|
||||
ops: [4]Operand `fmt:"v,operand_count`, // 64 bytes
|
||||
mnemonic: Mnemonic, // 2 bytes
|
||||
operand_count: u8, // 1 byte
|
||||
flags: Instruction_Flags, // 1 byte
|
||||
length: u8, // 1 byte (filled by decoder, used for iteration)
|
||||
_pad: [3]u8, // 3 bytes
|
||||
ops: [4]Operand `fmt:"v,operand_count`, // 48 bytes
|
||||
mnemonic: Mnemonic, // 2 bytes
|
||||
operand_count: u8, // 1 byte
|
||||
flags: Instruction_Flags, // 1 byte
|
||||
length: u8, // 1 byte (filled by decoder, used for iteration)
|
||||
_: [11]u8, // 11 bytes
|
||||
}
|
||||
#assert(size_of(Instruction) == 72)
|
||||
#assert(size_of(Instruction) == 64)
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// SECTION: 7.9 Instruction Builder Helpers
|
||||
|
||||
@@ -165,9 +165,8 @@ Operand :: struct #packed {
|
||||
kind: Operand_Kind,
|
||||
size: u8, // operand size in bytes (1, 2, 4, 8, 16, 32, 64)
|
||||
flags: Operand_Flags,
|
||||
_: [4]u8,
|
||||
}
|
||||
#assert(size_of(Operand) == 16)
|
||||
#assert(size_of(Operand) == 12)
|
||||
|
||||
// EVEX broadcast mode values for Operand_Flags.broadcast
|
||||
// Used for EVEX instructions to broadcast a scalar element to all lanes
|
||||
|
||||
Reference in New Issue
Block a user