authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-03-12 22:06:22+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-03-12 22:06:22+01:00
logac434fd8cc1105912d29f209e2f9f67e5af3a744
tree820c9d6b7ecd4ff3cba46f2d6e9163f16b9831b2
parent955e394792af69fc8c795802c0165e5c86f5ea73

x86_64: avoid inline for-loops when scanning the encodings table


1 files changed, 2 insertions(+), 2 deletions(-)

src/arch/x86_64/Encoding.zig+2-2
...@@ -68,7 +68,7 @@ pub fn findByMnemonic(mnemonic: Mnemonic, args: struct {...@@ -68,7 +68,7 @@ pub fn findByMnemonic(mnemonic: Mnemonic, args: struct {
68 // TODO work out what is the maximum number of variants we can actually find in one swoop.68 // TODO work out what is the maximum number of variants we can actually find in one swoop.
69 var candidates: [10]Encoding = undefined;69 var candidates: [10]Encoding = undefined;
70 var count: usize = 0;70 var count: usize = 0;
71 inline for (table) |entry| {71 for (table) |entry| {
72 const enc = Encoding{72 const enc = Encoding{
73 .mnemonic = entry[0],73 .mnemonic = entry[0],
74 .op_en = entry[1],74 .op_en = entry[1],
...@@ -162,7 +162,7 @@ pub fn findByOpcode(opc: []const u8, prefixes: struct {...@@ -162,7 +162,7 @@ pub fn findByOpcode(opc: []const u8, prefixes: struct {
162 legacy: LegacyPrefixes,162 legacy: LegacyPrefixes,
163 rex: Rex,163 rex: Rex,
164}, modrm_ext: ?u3) ?Encoding {164}, modrm_ext: ?u3) ?Encoding {
165 inline for (table) |entry| {165 for (table) |entry| {
166 const enc = Encoding{166 const enc = Encoding{
167 .mnemonic = entry[0],167 .mnemonic = entry[0],
168 .op_en = entry[1],168 .op_en = entry[1],