mirror of
https://github.com/Ed94/perfaware.git
synced 2026-09-17 21:23:48 +00:00
Compare commits
3
Commits
28e6e38c92
...
b9b1ed460a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b9b1ed460a | ||
|
|
749a712ceb | ||
|
|
7e533cbfb2 |
@@ -1,4 +1,5 @@
|
||||
#include "duffle/dsl.h"
|
||||
#include "duffle/asm.h"
|
||||
#include "duffle/analysis.h"
|
||||
#include "duffle/math.h"
|
||||
#include "duffle/encoding.h"
|
||||
@@ -40,11 +41,11 @@ typedef Struct_(X8616_DecodeGenInfo) {
|
||||
X8616_InfoList msgs;
|
||||
};
|
||||
|
||||
FI_ B1 x8616_decode_gen_operand_uses_modrm(X8616_Operand operand) {
|
||||
FI_ B4 x8616_decode_gen_operand_uses_modrm(X8616_Operand operand) {
|
||||
return operand == x8616_operand_rm || operand == x8616_operand_reg_modrm || operand == x8616_operand_segment_modrm;
|
||||
}
|
||||
|
||||
FI_ B1 x8616_decode_gen_operand_uses_rm(X8616_Operand operand) { return operand == x8616_operand_rm; }
|
||||
FI_ B4 x8616_decode_gen_operand_uses_rm(X8616_Operand operand) { return operand == x8616_operand_rm; }
|
||||
|
||||
internal X8616_DecodePayload
|
||||
x8616_decode_gen_payload_from_operand(X8616_Operand operand) {
|
||||
@@ -141,11 +142,11 @@ x8616_decode_gen_plan(X8616_Encoding const* encoding, U4 encoding_idx, X8616_Inf
|
||||
return plan;
|
||||
}
|
||||
|
||||
FI_ B1 x8616_decode_gen_encoding_matches_opcode(X8616_Encoding const* encoding, U1 opcode) {
|
||||
FI_ B4 x8616_decode_gen_encoding_matches_opcode(X8616_Encoding const* encoding, U1 opcode) {
|
||||
return (opcode & encoding->opcode.mask) == encoding->opcode.bits;
|
||||
}
|
||||
|
||||
FI_ B1 x8616_decode_gen_plan_matches_second(X8616_DecodePlan const* plan, U1 byte) {
|
||||
FI_ B4 x8616_decode_gen_plan_matches_second(X8616_DecodePlan const* plan, U1 byte) {
|
||||
if (plan->mod_rm.mask && ((byte & plan->mod_rm.mask) != plan->mod_rm.bits)) return false;
|
||||
if (plan->post_opcode.mask && ((byte & plan->post_opcode.mask) != plan->post_opcode.bits)) return false;
|
||||
return true;
|
||||
@@ -221,10 +222,10 @@ x8616_decode_gen_pass_validate(X8616_DecodeGen* gen, FArena_R info_scratch)
|
||||
for (U4 encoding_idx = 0; encoding_idx < X8616_ENCODING_COUNT; ++ encoding_idx)
|
||||
{
|
||||
X8616_Encoding const* encoding = x8616_encodings + encoding_idx;
|
||||
if (! x8616_decode_gen_encoding_matches_opcode(encoding, C_(U1, opcode))) continue;
|
||||
if (x8616_decode_gen_encoding_matches_opcode(encoding, C_(U1, opcode)) == false) continue;
|
||||
|
||||
X8616_DecodePlan const* plan = gen->plans + encoding_idx + 1;
|
||||
if (! x8616_decode_gen_plan_matches_second(plan, C_(U1, second))) continue;
|
||||
if (x8616_decode_gen_plan_matches_second(plan, C_(U1, second)) == false) continue;
|
||||
|
||||
if (expected) x8616_info_push(info_scratch, & gen->msgs, x8616_info_error
|
||||
, x8616_info_gen_ambiguous_decode
|
||||
@@ -239,7 +240,7 @@ x8616_decode_gen_pass_validate(X8616_DecodeGen* gen, FArena_R info_scratch)
|
||||
|
||||
if (dispatch & X8616_DECODE_AUX_BIT) {
|
||||
U2 base = dispatch & X8616_DECODE_AUX_MASK;
|
||||
actual = gen->aux[base + second];
|
||||
actual = gen->aux[base + second];
|
||||
}
|
||||
else if (dispatch) {
|
||||
U1 candidate = C_(U1, dispatch);
|
||||
@@ -274,29 +275,28 @@ x8616_decode_table_generate(X8616_DecodeGen* gen, FArena_R info_scratch) {
|
||||
}
|
||||
|
||||
|
||||
#ifndef X8616_DECODE_TABLE_OUTPUT
|
||||
# define X8616_DECODE_TABLE_OUTPUT "./code/8086/gen/decoder_table.h"
|
||||
#endif
|
||||
#define X8616_DECODE_TABLE_OUTPUT "./code/8086/gen/decoder_table.h"
|
||||
|
||||
enum {
|
||||
X8616_DECODE_GEN_INFO_MEMORY = kilo(64),
|
||||
X8616_DECODE_GEN_TEXT_MEMORY = kilo(128),
|
||||
X8616_DECODE_GEN_FILE_MEMORY = kilo(4),
|
||||
INFO_MEMORY_SIZE = kilo(64),
|
||||
TEXT_MEMORY_SIZE = kilo(128),
|
||||
FILE_MEMORY_SIZE = kilo(4),
|
||||
};
|
||||
|
||||
typedef Struct_(X8616_DecodeGenMemory) {
|
||||
U1 info[X8616_DECODE_GEN_INFO_MEMORY];
|
||||
U1 text[X8616_DECODE_GEN_TEXT_MEMORY];
|
||||
U1 file[X8616_DECODE_GEN_FILE_MEMORY];
|
||||
typedef FStack_(FStack_64k, U1, kilo(64));
|
||||
typedef Struct_(SMemory) {
|
||||
U1 info[INFO_MEMORY_SIZE];
|
||||
U1 text[TEXT_MEMORY_SIZE];
|
||||
U1 file[FILE_MEMORY_SIZE];
|
||||
|
||||
FStack_64k scratch;
|
||||
|
||||
X8616_DecodeGen gen;
|
||||
};
|
||||
global SMemory smem;
|
||||
|
||||
global X8616_DecodeGen x8616_decode_gen;
|
||||
global X8616_DecodeGenMemory x8616_decode_gen_memory;
|
||||
|
||||
I_ void
|
||||
x8616_decode_gen_append_u4(Str8Gen_R out, U4 value, U4 radix, U4 min_digits) {
|
||||
UTF8 buffer[64];
|
||||
Info_str8_from_u4 info = str8_from_u4_info(value, radix, min_digits, 0);
|
||||
I_ void x8616_decode_gen_append_u4(Str8Gen_R out, U4 value, U4 radix, U4 min_digits) {
|
||||
UTF8 buffer[64]; Info_str8_from_u4 info = str8_from_u4_info(value, radix, min_digits, 0);
|
||||
Str8 text = str8_from_u4_buf(slice_ut_arr(buffer), value, radix, min_digits, 0, info);
|
||||
str8gen_append_str8(out, text);
|
||||
}
|
||||
@@ -305,33 +305,63 @@ I_ void x8616_decode_gen_append_hex_u1(Str8Gen_R out, U1 value) { x8616_decode_g
|
||||
I_ void x8616_decode_gen_append_hex_u2(Str8Gen_R out, U2 value) { x8616_decode_gen_append_u4(out, value, 16, 4); }
|
||||
I_ void x8616_decode_gen_append_dec (Str8Gen_R out, U4 value) { x8616_decode_gen_append_u4(out, value, 10, 1); }
|
||||
|
||||
internal void
|
||||
x8616_decode_gen_emit_plan(Str8Gen_R out, X8616_DecodePlan const* plan) {
|
||||
str8gen_append_str8(out, slit8("\t{ "));
|
||||
x8616_decode_gen_append_hex_u2(out, plan->flags); str8gen_append_str8(out, slit8(", "));
|
||||
x8616_decode_gen_append_hex_u1(out, plan->op); str8gen_append_str8(out, slit8(", "));
|
||||
x8616_decode_gen_append_hex_u1(out, plan->encoding_flags); str8gen_append_str8(out, slit8(", "));
|
||||
x8616_decode_gen_append_hex_u1(out, plan->width); str8gen_append_str8(out, slit8(", {"));
|
||||
x8616_decode_gen_append_hex_u1(out, plan->operands[0]); str8gen_append_str8(out, slit8(","));
|
||||
x8616_decode_gen_append_hex_u1(out, plan->operands[1]); str8gen_append_str8(out, slit8("}, "));
|
||||
x8616_decode_gen_append_dec(out, plan->operand_count); str8gen_append_str8(out, slit8(", "));
|
||||
x8616_decode_gen_append_dec(out, plan->payload); str8gen_append_str8(out, slit8(", "));
|
||||
x8616_decode_gen_append_dec(out, plan->prefix_kind); str8gen_append_str8(out, slit8(", "));
|
||||
x8616_decode_gen_append_dec(out, plan->d_shift); str8gen_append_str8(out, slit8(","));
|
||||
x8616_decode_gen_append_dec(out, plan->w_shift); str8gen_append_str8(out, slit8(","));
|
||||
x8616_decode_gen_append_dec(out, plan->s_shift); str8gen_append_str8(out, slit8(","));
|
||||
x8616_decode_gen_append_dec(out, plan->v_shift); str8gen_append_str8(out, slit8(","));
|
||||
x8616_decode_gen_append_dec(out, plan->z_shift); str8gen_append_str8(out, slit8(","));
|
||||
x8616_decode_gen_append_dec(out, plan->reg_shift); str8gen_append_str8(out, slit8(","));
|
||||
x8616_decode_gen_append_dec(out, plan->sr_shift); str8gen_append_str8(out, slit8(", {"));
|
||||
x8616_decode_gen_append_hex_u1(out, plan->mod_rm.bits); str8gen_append_str8(out, slit8(","));
|
||||
x8616_decode_gen_append_hex_u1(out, plan->mod_rm.mask); str8gen_append_str8(out, slit8("}, {"));
|
||||
x8616_decode_gen_append_hex_u1(out, plan->post_opcode.bits); str8gen_append_str8(out, slit8(","));
|
||||
x8616_decode_gen_append_hex_u1(out, plan->post_opcode.mask); str8gen_append_str8(out, slit8("} },\n"));
|
||||
FI_ Slice scratch_push(U8 len) { return fstack_push_(smem.scratch, len); }
|
||||
|
||||
typedef Opt_(str8_from_u4) { U4 radix, min_digits, digit_group_separator; };
|
||||
I_ Str8 str8_from_u4_opt(U4 num, Opt_str8_from_u4 o) { if (o.radix == 0) {o.radix = 10;}
|
||||
/*gather info*/Info_str8_from_u4 info = str8_from_u4_info(num, o.radix, o.min_digits, o.digit_group_separator);
|
||||
/*write buf */return str8_from_u4_buf(scratch_push(128), num, o.radix, o.min_digits, o.digit_group_separator, info);
|
||||
}
|
||||
#define str8_from_u4(num, ...) str8_from_u4_opt(num, opt_(str8_from_u4, __VA_ARGS__))
|
||||
|
||||
#define code_str8(...) slit8(stringify(__VA_ARGS__))
|
||||
|
||||
internal void
|
||||
x8616_decode_gen_emit_plan(Str8Gen_R out, X8616_DecodePlan_R plan) { defer_rewind(smem.scratch.top) {
|
||||
Str8 template = code_str8(
|
||||
\t{
|
||||
<flags>, <op>, <encoding_flags>, <width>,
|
||||
{<operands[0]>, <operands[1]>}, <operand_count>,
|
||||
<payload>, <prefix_kind>,
|
||||
<d_shift>, <w_shift>, <s_shift>, <v_shift>, <z_shift>, <reg_shift>, <sr_shift>,
|
||||
{<mod_rm.bits>, <mod_rm.mask>},
|
||||
{<post_opcode.bits>, <post_opcode.mask>},
|
||||
},\n
|
||||
);
|
||||
KTL_Slot_Str8 tbl[] = {
|
||||
#define dec(value) str8_from_u4(value, .radix = 10, .min_digits = 1)
|
||||
#define hex_u1(value) str8_from_u4(value, .radix = 16, .min_digits = 2)
|
||||
#define hex_u2(value) str8_from_u4(value, .radix = 16, .min_digits = 4)
|
||||
#define entry(key,value) { ktl_str8_key(key), value }
|
||||
entry("flags", hex_u2(plan->flags)),
|
||||
entry("op", hex_u1(plan->op)),
|
||||
entry("encoding_flags", hex_u1(plan->encoding_flags)),
|
||||
entry("width", hex_u1(plan->width)),
|
||||
entry("operands[0]", hex_u1(plan->operands[0])),
|
||||
entry("operands[1]", hex_u1(plan->operands[1])),
|
||||
entry("operand_count", dec(plan->operand_count)),
|
||||
entry("payload", dec(plan->payload)),
|
||||
entry("prefix_kind", dec(plan->prefix_kind)),
|
||||
entry("d_shift", dec(plan->d_shift)),
|
||||
entry("w_shift", dec(plan->w_shift)),
|
||||
entry("s_shift", dec(plan->s_shift)),
|
||||
entry("v_shift", dec(plan->v_shift)),
|
||||
entry("z_shift", dec(plan->z_shift)),
|
||||
entry("reg_shift", dec(plan->reg_shift)),
|
||||
entry("sr_shift", dec(plan->sr_shift)),
|
||||
entry("mod_rm.bits", hex_u1(plan->mod_rm.bits)),
|
||||
entry("mod_rm.mask", hex_u1(plan->mod_rm.mask)),
|
||||
entry("post_opcode.bits", hex_u1(plan->post_opcode.bits)),
|
||||
entry("post_opcode.mask", hex_u1(plan->post_opcode.mask)),
|
||||
#undef dec
|
||||
#undef hex
|
||||
#undef entry
|
||||
};
|
||||
str8gen_append_fmt(out, template, ktl_str8_from_arr(tbl));
|
||||
}}
|
||||
|
||||
internal Str8
|
||||
x8616_decode_gen_emit(Str8Gen_R out, X8616_DecodeGen const* gen) {
|
||||
x8616_decode_gen_emit(Str8Gen_R out, X8616_DecodeGen_R gen) {
|
||||
str8gen_append_str8(out, slit8(
|
||||
"// Generated from encoder_table.h. Do not hand-edit.\n"
|
||||
"// Plan 0 is the all-zero nil/invalid plan.\n\n"
|
||||
@@ -363,25 +393,20 @@ x8616_decode_gen_emit(Str8Gen_R out, X8616_DecodeGen const* gen) {
|
||||
return str8(out->ptr, out->len);
|
||||
}
|
||||
|
||||
CLANG_OPTIMIZE_DISABLE
|
||||
int
|
||||
main(void) {
|
||||
FArena info_scratch = farena_make(slice_ut_arr(x8616_decode_gen_memory.info));
|
||||
X8616_DecodeGenInfo gen_info = x8616_decode_table_generate(& x8616_decode_gen, & info_scratch);
|
||||
FArena info_scratch = farena_make(slice_ut_arr(smem.info));
|
||||
X8616_DecodeGenInfo gen_info = x8616_decode_table_generate(& smem.gen, & info_scratch);
|
||||
if (gen_info.msgs.error_count) { ms_exit_process(1); return 1; }
|
||||
|
||||
Str8Gen output = {
|
||||
.ptr = C_(UTF8*, x8616_decode_gen_memory.text),
|
||||
.cap = S_(x8616_decode_gen_memory.text),
|
||||
};
|
||||
Str8 generated = x8616_decode_gen_emit(& output, & x8616_decode_gen);
|
||||
Str8Gen output = str8gen_make(slice_ut_arr(smem.text));
|
||||
Str8 generated = x8616_decode_gen_emit(& output, & smem.gen);
|
||||
|
||||
FArena file_scratch = farena_make(slice_ut_arr(x8616_decode_gen_memory.file));
|
||||
FArena file_scratch = farena_make(slice_ut_arr(smem.file));
|
||||
B4 wrote = write_data_to_file_path(slit8(X8616_DECODE_TABLE_OUTPUT), generated, & file_scratch);
|
||||
if (! wrote) { ms_exit_process(2); return 2; }
|
||||
if (wrote == false) { ms_exit_process(2); return 2; }
|
||||
if (gen_info.verified_count != 256 * 256) { ms_exit_process(3); return 3; }
|
||||
|
||||
ms_exit_process(0);
|
||||
return 0;
|
||||
}
|
||||
CLANG_OPTIMIZE_ENABLE
|
||||
|
||||
+132
-132
@@ -3,138 +3,138 @@
|
||||
|
||||
RO_ global X8616_DecodePlan x8616_decode_plans[132] =
|
||||
{
|
||||
{ 0x0000, 0x00, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x020d, 0x02, 0x00, 0x00, {0x01,0x02}, 2, 0, 0, 1,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0209, 0x02, 0x00, 0x00, {0x01,0x07}, 2, 1, 0, 0,0,0,0,0,0,0, {0x00,0x38}, {0x00,0x00} },
|
||||
{ 0x0088, 0x02, 0x00, 0x00, {0x03,0x07}, 2, 1, 0, 0,3,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x000c, 0x02, 0x00, 0x00, {0x06,0x0a}, 2, 4, 0, 1,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0205, 0x02, 0x00, 0x02, {0x01,0x04}, 2, 0, 0, 1,0,0,0,0,0,0, {0x00,0x20}, {0x00,0x00} },
|
||||
{ 0x0201, 0x0b, 0x00, 0x02, {0x01,0x00}, 1, 0, 0, 0,0,0,0,0,0,0, {0x30,0x38}, {0x00,0x00} },
|
||||
{ 0x0080, 0x0b, 0x00, 0x02, {0x03,0x00}, 1, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0100, 0x0b, 0x00, 0x02, {0x05,0x00}, 1, 0, 0, 0,0,0,0,0,0,3, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0201, 0x0c, 0x00, 0x02, {0x01,0x00}, 1, 0, 0, 0,0,0,0,0,0,0, {0x00,0x38}, {0x00,0x00} },
|
||||
{ 0x0080, 0x0c, 0x00, 0x02, {0x03,0x00}, 1, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0100, 0x0c, 0x00, 0x02, {0x05,0x00}, 1, 0, 0, 0,0,0,0,0,0,3, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0209, 0x0d, 0x00, 0x00, {0x02,0x01}, 2, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0080, 0x0d, 0x00, 0x02, {0x06,0x03}, 2, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0008, 0x0e, 0x00, 0x00, {0x06,0x08}, 2, 2, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0008, 0x0e, 0x00, 0x00, {0x06,0x0e}, 2, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0008, 0x0f, 0x00, 0x00, {0x08,0x06}, 2, 2, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0008, 0x0f, 0x00, 0x00, {0x0e,0x06}, 2, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x10, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0201, 0x11, 0x00, 0x02, {0x02,0x01}, 2, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0201, 0x12, 0x00, 0x02, {0x02,0x01}, 2, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0201, 0x13, 0x00, 0x02, {0x02,0x01}, 2, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x14, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x15, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x16, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x17, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x020d, 0x03, 0x00, 0x00, {0x01,0x02}, 2, 0, 0, 1,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0219, 0x03, 0x00, 0x00, {0x01,0x07}, 2, 1, 0, 0,0,1,0,0,0,0, {0x00,0x38}, {0x00,0x00} },
|
||||
{ 0x0008, 0x03, 0x00, 0x00, {0x06,0x07}, 2, 1, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x020d, 0x04, 0x00, 0x00, {0x01,0x02}, 2, 0, 0, 1,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0209, 0x04, 0x00, 0x00, {0x01,0x07}, 2, 1, 0, 0,0,0,0,0,0,0, {0x08,0x38}, {0x00,0x00} },
|
||||
{ 0x0008, 0x04, 0x00, 0x00, {0x06,0x07}, 2, 1, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x020d, 0x05, 0x00, 0x00, {0x01,0x02}, 2, 0, 0, 1,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0219, 0x05, 0x00, 0x00, {0x01,0x07}, 2, 1, 0, 0,0,1,0,0,0,0, {0x10,0x38}, {0x00,0x00} },
|
||||
{ 0x0008, 0x05, 0x00, 0x00, {0x06,0x07}, 2, 1, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x020d, 0x06, 0x00, 0x00, {0x01,0x02}, 2, 0, 0, 1,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0219, 0x06, 0x00, 0x00, {0x01,0x07}, 2, 1, 0, 0,0,1,0,0,0,0, {0x18,0x38}, {0x00,0x00} },
|
||||
{ 0x0008, 0x06, 0x00, 0x00, {0x06,0x07}, 2, 1, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x020d, 0x07, 0x00, 0x00, {0x01,0x02}, 2, 0, 0, 1,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0209, 0x07, 0x00, 0x00, {0x01,0x07}, 2, 1, 0, 0,0,0,0,0,0,0, {0x20,0x38}, {0x00,0x00} },
|
||||
{ 0x0008, 0x07, 0x00, 0x00, {0x06,0x07}, 2, 1, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x020d, 0x08, 0x00, 0x00, {0x01,0x02}, 2, 0, 0, 1,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0219, 0x08, 0x00, 0x00, {0x01,0x07}, 2, 1, 0, 0,0,1,0,0,0,0, {0x28,0x38}, {0x00,0x00} },
|
||||
{ 0x0008, 0x08, 0x00, 0x00, {0x06,0x07}, 2, 1, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x020d, 0x09, 0x00, 0x00, {0x01,0x02}, 2, 0, 0, 1,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0209, 0x09, 0x00, 0x00, {0x01,0x07}, 2, 1, 0, 0,0,0,0,0,0,0, {0x30,0x38}, {0x00,0x00} },
|
||||
{ 0x0008, 0x09, 0x00, 0x00, {0x06,0x07}, 2, 1, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x020d, 0x0a, 0x00, 0x00, {0x01,0x02}, 2, 0, 0, 1,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0219, 0x0a, 0x00, 0x00, {0x01,0x07}, 2, 1, 0, 0,0,1,0,0,0,0, {0x38,0x38}, {0x00,0x00} },
|
||||
{ 0x0008, 0x0a, 0x00, 0x00, {0x06,0x07}, 2, 1, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0209, 0x18, 0x00, 0x00, {0x01,0x00}, 1, 0, 0, 0,0,0,0,0,0,0, {0x00,0x38}, {0x00,0x00} },
|
||||
{ 0x0080, 0x18, 0x00, 0x02, {0x03,0x00}, 1, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x19, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x1a, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0209, 0x1b, 0x00, 0x00, {0x01,0x00}, 1, 0, 0, 0,0,0,0,0,0,0, {0x08,0x38}, {0x00,0x00} },
|
||||
{ 0x0080, 0x1b, 0x00, 0x02, {0x03,0x00}, 1, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0209, 0x1c, 0x00, 0x00, {0x01,0x00}, 1, 0, 0, 0,0,0,0,0,0,0, {0x18,0x38}, {0x00,0x00} },
|
||||
{ 0x0209, 0x1f, 0x00, 0x00, {0x01,0x00}, 1, 0, 0, 0,0,0,0,0,0,0, {0x20,0x38}, {0x00,0x00} },
|
||||
{ 0x0209, 0x20, 0x00, 0x00, {0x01,0x00}, 1, 0, 0, 0,0,0,0,0,0,0, {0x28,0x38}, {0x00,0x00} },
|
||||
{ 0x0209, 0x22, 0x00, 0x00, {0x01,0x00}, 1, 0, 0, 0,0,0,0,0,0,0, {0x30,0x38}, {0x00,0x00} },
|
||||
{ 0x0209, 0x23, 0x00, 0x00, {0x01,0x00}, 1, 0, 0, 0,0,0,0,0,0,0, {0x38,0x38}, {0x00,0x00} },
|
||||
{ 0x0209, 0x27, 0x00, 0x00, {0x01,0x00}, 1, 0, 0, 0,0,0,0,0,0,0, {0x10,0x38}, {0x00,0x00} },
|
||||
{ 0x0000, 0x1d, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x1e, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0002, 0x21, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x0a,0xff} },
|
||||
{ 0x0002, 0x24, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x0a,0xff} },
|
||||
{ 0x0000, 0x25, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x26, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0229, 0x2b, 0x00, 0x00, {0x01,0x0f}, 2, 0, 0, 0,0,0,1,0,0,0, {0x00,0x38}, {0x00,0x00} },
|
||||
{ 0x0229, 0x2c, 0x00, 0x00, {0x01,0x0f}, 2, 0, 0, 0,0,0,1,0,0,0, {0x08,0x38}, {0x00,0x00} },
|
||||
{ 0x0229, 0x2d, 0x00, 0x00, {0x01,0x0f}, 2, 0, 0, 0,0,0,1,0,0,0, {0x10,0x38}, {0x00,0x00} },
|
||||
{ 0x0229, 0x2e, 0x00, 0x00, {0x01,0x0f}, 2, 0, 0, 0,0,0,1,0,0,0, {0x18,0x38}, {0x00,0x00} },
|
||||
{ 0x0229, 0x28, 0x00, 0x00, {0x01,0x0f}, 2, 0, 0, 0,0,0,1,0,0,0, {0x20,0x38}, {0x00,0x00} },
|
||||
{ 0x0229, 0x29, 0x00, 0x00, {0x01,0x0f}, 2, 0, 0, 0,0,0,1,0,0,0, {0x28,0x38}, {0x00,0x00} },
|
||||
{ 0x0229, 0x2a, 0x00, 0x00, {0x01,0x0f}, 2, 0, 0, 0,0,0,1,0,0,0, {0x38,0x38}, {0x00,0x00} },
|
||||
{ 0x0209, 0x2f, 0x00, 0x00, {0x01,0x02}, 2, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0209, 0x2f, 0x00, 0x00, {0x01,0x07}, 2, 1, 0, 0,0,0,0,0,0,0, {0x00,0x38}, {0x00,0x00} },
|
||||
{ 0x0008, 0x2f, 0x00, 0x00, {0x06,0x07}, 2, 1, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0440, 0x30, 0x02, 0x00, {0x00,0x00}, 0, 0, 2, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0008, 0x31, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0008, 0x32, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0008, 0x33, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0008, 0x34, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0008, 0x35, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0400, 0x5b, 0x02, 0x00, {0x00,0x00}, 0, 0, 1, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0500, 0x5c, 0x02, 0x00, {0x00,0x00}, 0, 0, 3, 0,0,0,0,0,0,3, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x36, 0x00, 0x00, {0x0c,0x00}, 1, 6, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0201, 0x36, 0x00, 0x02, {0x01,0x00}, 1, 0, 0, 0,0,0,0,0,0,0, {0x10,0x38}, {0x00,0x00} },
|
||||
{ 0x0000, 0x36, 0x01, 0x00, {0x0d,0x00}, 1, 7, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0201, 0x36, 0x01, 0x02, {0x01,0x00}, 1, 0, 0, 0,0,0,0,0,0,0, {0x18,0x38}, {0x00,0x00} },
|
||||
{ 0x0000, 0x37, 0x00, 0x00, {0x0c,0x00}, 1, 6, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x37, 0x00, 0x00, {0x0b,0x00}, 1, 5, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0201, 0x37, 0x00, 0x02, {0x01,0x00}, 1, 0, 0, 0,0,0,0,0,0,0, {0x20,0x38}, {0x00,0x00} },
|
||||
{ 0x0000, 0x37, 0x01, 0x00, {0x0d,0x00}, 1, 7, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0201, 0x37, 0x01, 0x02, {0x01,0x00}, 1, 0, 0, 0,0,0,0,0,0,0, {0x28,0x38}, {0x00,0x00} },
|
||||
{ 0x0000, 0x38, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x38, 0x00, 0x00, {0x09,0x00}, 1, 3, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x39, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x39, 0x00, 0x00, {0x09,0x00}, 1, 3, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x40, 0x00, 0x00, {0x0b,0x00}, 1, 5, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x48, 0x00, 0x00, {0x0b,0x00}, 1, 5, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x3d, 0x00, 0x00, {0x0b,0x00}, 1, 5, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x45, 0x00, 0x00, {0x0b,0x00}, 1, 5, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x3a, 0x00, 0x00, {0x0b,0x00}, 1, 5, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x42, 0x00, 0x00, {0x0b,0x00}, 1, 5, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x3e, 0x00, 0x00, {0x0b,0x00}, 1, 5, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x46, 0x00, 0x00, {0x0b,0x00}, 1, 5, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x41, 0x00, 0x00, {0x0b,0x00}, 1, 5, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x49, 0x00, 0x00, {0x0b,0x00}, 1, 5, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x3f, 0x00, 0x00, {0x0b,0x00}, 1, 5, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x47, 0x00, 0x00, {0x0b,0x00}, 1, 5, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x3b, 0x00, 0x00, {0x0b,0x00}, 1, 5, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x43, 0x00, 0x00, {0x0b,0x00}, 1, 5, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x3c, 0x00, 0x00, {0x0b,0x00}, 1, 5, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x44, 0x00, 0x00, {0x0b,0x00}, 1, 5, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x4c, 0x00, 0x00, {0x0b,0x00}, 1, 5, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x4b, 0x00, 0x00, {0x0b,0x00}, 1, 5, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x4a, 0x00, 0x00, {0x0b,0x00}, 1, 5, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x4d, 0x00, 0x00, {0x0b,0x00}, 1, 5, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x4e, 0x00, 0x00, {0x08,0x00}, 1, 2, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x4f, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x50, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x51, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x52, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x53, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x54, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x55, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x56, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x57, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x58, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x59, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x5a, 0x00, 0x00, {0x00,0x00}, 0, 0, 0, 0,0,0,0,0,0,0, {0x00,0x00}, {0x00,0x00} },
|
||||
{ 0x0000, 0x00, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x020d, 0x02, 0x00, 0x00, {0x01, 0x02}, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0209, 0x02, 0x00, 0x00, {0x01, 0x07}, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0088, 0x02, 0x00, 0x00, {0x03, 0x07}, 2, 1, 0, 0, 3, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x000c, 0x02, 0x00, 0x00, {0x06, 0x0a}, 2, 4, 0, 1, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0205, 0x02, 0x00, 0x02, {0x01, 0x04}, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, {0x00, 0x20}, {0x00, 0x00}, },
|
||||
{ 0x0201, 0x0b, 0x00, 0x02, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x30, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0080, 0x0b, 0x00, 0x02, {0x03, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0100, 0x0b, 0x00, 0x02, {0x05, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 3, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0201, 0x0c, 0x00, 0x02, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0080, 0x0c, 0x00, 0x02, {0x03, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0100, 0x0c, 0x00, 0x02, {0x05, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 3, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0209, 0x0d, 0x00, 0x00, {0x02, 0x01}, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0080, 0x0d, 0x00, 0x02, {0x06, 0x03}, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0008, 0x0e, 0x00, 0x00, {0x06, 0x08}, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0008, 0x0e, 0x00, 0x00, {0x06, 0x0e}, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0008, 0x0f, 0x00, 0x00, {0x08, 0x06}, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0008, 0x0f, 0x00, 0x00, {0x0e, 0x06}, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x10, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0201, 0x11, 0x00, 0x02, {0x02, 0x01}, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0201, 0x12, 0x00, 0x02, {0x02, 0x01}, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0201, 0x13, 0x00, 0x02, {0x02, 0x01}, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x14, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x15, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x16, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x17, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x020d, 0x03, 0x00, 0x00, {0x01, 0x02}, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0219, 0x03, 0x00, 0x00, {0x01, 0x07}, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, {0x00, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0008, 0x03, 0x00, 0x00, {0x06, 0x07}, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x020d, 0x04, 0x00, 0x00, {0x01, 0x02}, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0209, 0x04, 0x00, 0x00, {0x01, 0x07}, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, {0x08, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0008, 0x04, 0x00, 0x00, {0x06, 0x07}, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x020d, 0x05, 0x00, 0x00, {0x01, 0x02}, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0219, 0x05, 0x00, 0x00, {0x01, 0x07}, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, {0x10, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0008, 0x05, 0x00, 0x00, {0x06, 0x07}, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x020d, 0x06, 0x00, 0x00, {0x01, 0x02}, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0219, 0x06, 0x00, 0x00, {0x01, 0x07}, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, {0x18, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0008, 0x06, 0x00, 0x00, {0x06, 0x07}, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x020d, 0x07, 0x00, 0x00, {0x01, 0x02}, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0209, 0x07, 0x00, 0x00, {0x01, 0x07}, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, {0x20, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0008, 0x07, 0x00, 0x00, {0x06, 0x07}, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x020d, 0x08, 0x00, 0x00, {0x01, 0x02}, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0219, 0x08, 0x00, 0x00, {0x01, 0x07}, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, {0x28, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0008, 0x08, 0x00, 0x00, {0x06, 0x07}, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x020d, 0x09, 0x00, 0x00, {0x01, 0x02}, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0209, 0x09, 0x00, 0x00, {0x01, 0x07}, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, {0x30, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0008, 0x09, 0x00, 0x00, {0x06, 0x07}, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x020d, 0x0a, 0x00, 0x00, {0x01, 0x02}, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0219, 0x0a, 0x00, 0x00, {0x01, 0x07}, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, {0x38, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0008, 0x0a, 0x00, 0x00, {0x06, 0x07}, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0209, 0x18, 0x00, 0x00, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0080, 0x18, 0x00, 0x02, {0x03, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x19, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x1a, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0209, 0x1b, 0x00, 0x00, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x08, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0080, 0x1b, 0x00, 0x02, {0x03, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0209, 0x1c, 0x00, 0x00, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x18, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0209, 0x1f, 0x00, 0x00, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x20, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0209, 0x20, 0x00, 0x00, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x28, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0209, 0x22, 0x00, 0x00, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x30, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0209, 0x23, 0x00, 0x00, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x38, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0209, 0x27, 0x00, 0x00, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x10, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x1d, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x1e, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0002, 0x21, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x0a, 0xff}, },
|
||||
{ 0x0002, 0x24, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x0a, 0xff}, },
|
||||
{ 0x0000, 0x25, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x26, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0229, 0x2b, 0x00, 0x00, {0x01, 0x0f}, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, {0x00, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0229, 0x2c, 0x00, 0x00, {0x01, 0x0f}, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, {0x08, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0229, 0x2d, 0x00, 0x00, {0x01, 0x0f}, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, {0x10, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0229, 0x2e, 0x00, 0x00, {0x01, 0x0f}, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, {0x18, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0229, 0x28, 0x00, 0x00, {0x01, 0x0f}, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, {0x20, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0229, 0x29, 0x00, 0x00, {0x01, 0x0f}, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, {0x28, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0229, 0x2a, 0x00, 0x00, {0x01, 0x0f}, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, {0x38, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0209, 0x2f, 0x00, 0x00, {0x01, 0x02}, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0209, 0x2f, 0x00, 0x00, {0x01, 0x07}, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0008, 0x2f, 0x00, 0x00, {0x06, 0x07}, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0440, 0x30, 0x02, 0x00, {0x00, 0x00}, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0008, 0x31, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0008, 0x32, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0008, 0x33, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0008, 0x34, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0008, 0x35, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0400, 0x5b, 0x02, 0x00, {0x00, 0x00}, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0500, 0x5c, 0x02, 0x00, {0x00, 0x00}, 0, 0, 3, 0, 0, 0, 0, 0, 0, 3, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x36, 0x00, 0x00, {0x0c, 0x00}, 1, 6, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0201, 0x36, 0x00, 0x02, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x10, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x36, 0x01, 0x00, {0x0d, 0x00}, 1, 7, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0201, 0x36, 0x01, 0x02, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x18, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x37, 0x00, 0x00, {0x0c, 0x00}, 1, 6, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x37, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0201, 0x37, 0x00, 0x02, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x20, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x37, 0x01, 0x00, {0x0d, 0x00}, 1, 7, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0201, 0x37, 0x01, 0x02, {0x01, 0x00}, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x28, 0x38}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x38, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x38, 0x00, 0x00, {0x09, 0x00}, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x39, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x39, 0x00, 0x00, {0x09, 0x00}, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x40, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x48, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x3d, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x45, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x3a, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x42, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x3e, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x46, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x41, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x49, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x3f, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x47, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x3b, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x43, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x3c, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x44, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x4c, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x4b, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x4a, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x4d, 0x00, 0x00, {0x0b, 0x00}, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x4e, 0x00, 0x00, {0x08, 0x00}, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x4f, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x50, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x51, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x52, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x53, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x54, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x55, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x56, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x57, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x58, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x59, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
{ 0x0000, 0x5a, 0x00, 0x00, {0x00, 0x00}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0x00, 0x00}, {0x00, 0x00}, },
|
||||
};
|
||||
|
||||
RO_ global U2 x8616_decode_dispatch[256] =
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
# include "dsl.h"
|
||||
#endif
|
||||
|
||||
#define asm_out /* outputs */
|
||||
#define asm_in /* inputs */
|
||||
#define asm_clobber /* clobbers */
|
||||
|
||||
#define asm_out_r(name) [name] "=r"(name)
|
||||
#define asm_in_r(name) [name] "r"(name)
|
||||
#define asm_out_x(name) [name] "=&x"(name) /* XMM, earlyclobber */
|
||||
#define asm_out_x0(name) [name] "=x"(name) /* XMM, no earlyclobber */
|
||||
#define asm_in_x(name) [name] "x"(name)
|
||||
|
||||
#define x64_r(name) "%[" #name "]"
|
||||
#define x64_m(name) "(%[" #name "])"
|
||||
#define x64_xmm(name) "%x[" #name "]"
|
||||
|
||||
typedef U8 U8x2 attribute(vector_size(16));
|
||||
typedef U8 U8x4 attribute(vector_size(32));
|
||||
typedef U1 U1x16 attribute(vector_size(16));
|
||||
|
||||
#define x64_u4_from_byte_hits(dst, src) "pmovmskb " x64_r(src) ", " x64_r(dst) "\n"
|
||||
#define x64_u4_count_trailing_zeros(dst, src) "tzcntl " x64_r(src) ", " x64_r(dst) "\n"
|
||||
|
||||
#define x64_u1x16_repeat_dwords(dst, src, n) "pshufd $" #n ", " x64_r(src) ", " x64_r(dst) "\n"
|
||||
#define x64_u1x16_load_mem4(dst, src) "movd " x64_r(src) ", " x64_r(dst) "\n"
|
||||
#define x64_u1x16_load_mem8(dst, src) "movq " x64_m(src) ", " x64_r(dst) "\n"
|
||||
#define x64_u1x16_load_mem16(dst, src) "movdqu " x64_m(src) ", " x64_r(dst) "\n"
|
||||
#define x64_u1x16_match_bytes(dst, src) "pcmpeqb " x64_r(src) ", " x64_r(dst) "\n"
|
||||
|
||||
#define x64_u8x2_load_u8(dst, src) "vmovq " x64_m(src) ", " x64_r(dst) "\n"
|
||||
#define x64_u8x2_insert_u8(dst, src, n) "vpinsrq $" #n ", " x64_m(src) ", " x64_r(dst) ", " x64_r(dst) "\n"
|
||||
#define x64_u8x4_insert_xmm(dst, src, n) "vinserti128 $" #n ", " x64_r(src) ", " x64_r(dst) ", " x64_r(dst) "\n"
|
||||
#define x64_u8x4_broadcast(dst, src) "vpbroadcastq " x64_r(src) ", " x64_r(dst) "\n"
|
||||
#define x64_u8x4_match(dst, a, b) "vpcmpeqq " x64_r(b) ", " x64_r(a) ", " x64_r(dst) "\n"
|
||||
#define x64_u4_from_qword_hits(dst, src) "vmovmskpd " x64_r(src) ", " x64_r(dst) "\n"
|
||||
|
||||
I_ U4 count_trailing_zeros_u4(U4 mask) {
|
||||
U4 n;
|
||||
asm volatile(
|
||||
x64_u4_count_trailing_zeros(n, mask)
|
||||
asm_out : asm_out_r(n)
|
||||
asm_in : asm_in_r(mask)
|
||||
);
|
||||
return n;
|
||||
}
|
||||
|
||||
I_ U1x16 splat_u4_u1x16(U4 b4) {
|
||||
U1x16 v;
|
||||
asm volatile(
|
||||
x64_u1x16_load_mem4 (v, b4)
|
||||
x64_u1x16_repeat_dwords(v, v, 0)
|
||||
asm_out : asm_out_x0(v)
|
||||
asm_in : asm_in_r(b4)
|
||||
);
|
||||
return v;
|
||||
}
|
||||
|
||||
I_ U4 mask_eq8_u1x16(U1_R p, U1x16 needle) {
|
||||
U1x16 chunk;
|
||||
U4 mask;
|
||||
asm volatile(
|
||||
x64_u1x16_load_mem8 (chunk, p)
|
||||
x64_u1x16_match_bytes(chunk, needle)
|
||||
x64_u4_from_byte_hits(mask, chunk)
|
||||
asm_out : asm_out_x(chunk), asm_out_r(mask)
|
||||
asm_in : asm_in_r(p), asm_in_x(needle)
|
||||
asm_clobber : "memory"
|
||||
);
|
||||
return mask; /* movq zero-fills the high 8 bytes; bits 8–15 stay 0 */
|
||||
}
|
||||
|
||||
I_ U4 mask_eq16_u1x16(U1_R p, U1x16 needle) {
|
||||
U1x16 chunk;
|
||||
U4 mask;
|
||||
asm volatile(
|
||||
x64_u1x16_load_mem16 (chunk, p)
|
||||
x64_u1x16_match_bytes(chunk, needle)
|
||||
x64_u4_from_byte_hits(mask, chunk)
|
||||
asm_out : asm_out_x(chunk), asm_out_r(mask)
|
||||
asm_in : asm_in_r(p), asm_in_x(needle)
|
||||
asm_clobber : "memory"
|
||||
);
|
||||
return mask;
|
||||
}
|
||||
|
||||
I_ U8 find_u1_via_u1x16(U1_R p, U8 len, U1 ch, U1x16 needle) {
|
||||
U8 i = 0;
|
||||
while (len - i >= 16) {
|
||||
U4 mask = mask_eq16_u1x16(p + i, needle);
|
||||
if (mask) return i + C_(U8, count_trailing_zeros_u4(mask));
|
||||
i += 16;
|
||||
}
|
||||
while (len - i >= 8) {
|
||||
U4 mask = mask_eq8_u1x16(p + i, needle);
|
||||
if (mask) return i + C_(U8, count_trailing_zeros_u4(mask));
|
||||
i += 8;
|
||||
}
|
||||
while (i < len) {
|
||||
if (p[i] == ch) return i;
|
||||
++ i;
|
||||
}
|
||||
return len; /* not found */
|
||||
}
|
||||
|
||||
I_ U4 find_aos_keys_mask_u8x4(U8_R p0, U8_R p1, U8_R p2, U8_R p3, U8 key) {
|
||||
U8x2 lo, hi;
|
||||
U8x4 keys, splat, eq;
|
||||
U4 mask;
|
||||
asm volatile(
|
||||
x64_u8x2_load_u8 (lo, p0)
|
||||
x64_u8x2_insert_u8(lo, p1, 1)
|
||||
x64_u8x2_load_u8 (hi, p2)
|
||||
x64_u8x2_insert_u8(hi, p3, 1)
|
||||
x64_u8x4_insert_xmm(keys, lo, 0)
|
||||
x64_u8x4_insert_xmm(keys, hi, 1)
|
||||
x64_u8x4_broadcast(splat, key)
|
||||
x64_u8x4_match(eq, keys, splat)
|
||||
x64_u4_from_qword_hits(mask, eq)
|
||||
asm_out : asm_out_x(lo), asm_out_x(hi), asm_out_x(keys), asm_out_x(splat), asm_out_x(eq), asm_out_r(mask)
|
||||
asm_in : asm_in_r(p0), asm_in_r(p1), asm_in_r(p2), asm_in_r(p3), asm_in_r(key)
|
||||
asm_clobber : "memory"
|
||||
);
|
||||
return mask;
|
||||
}
|
||||
+17
-34
@@ -41,8 +41,8 @@ Standard: c23
|
||||
#define glue(A, B) glue_impl(A, B)
|
||||
#define tmpl(prefix, type) prefix ## _ ## type
|
||||
|
||||
#define stringify_impl(S) #S
|
||||
#define stringify(S) stringify_impl(S)
|
||||
#define stringify_impl(...) #__VA_ARGS__
|
||||
#define stringify(...) stringify_impl(__VA_ARGS__)
|
||||
|
||||
#define VA_Sel_1( _1, ... ) _1 // <-- Of all th args passed pick _1.
|
||||
#define VA_Sel_2( _1, _2, ... ) _2 // <-- Of all the args passed pick _2.
|
||||
@@ -54,16 +54,19 @@ Standard: c23
|
||||
#define LP_ static // static data within procedure scope
|
||||
#define internal static // internal
|
||||
|
||||
|
||||
#define attribute(directive) __attribute__((directive))
|
||||
|
||||
#define asm __asm__
|
||||
|
||||
#define align_(value) __attribute__((aligned (value))) // for easy alignment
|
||||
#define C_(type,data) ((type)(data)) // for enforced precedence
|
||||
#define expect_(x, y) __builtin_expect(x, y) // so compiler knows the common path
|
||||
#define align_(value) attribute(aligned(value)) // for easy alignment
|
||||
#define C_(type,data) ((type)(data)) // for enforced precedence
|
||||
#define expect_(x, y) __builtin_expect(x, y) // so compiler knows the common path
|
||||
#define cexpr_ __builtin_constant_p
|
||||
#define I_ internal inline
|
||||
#define FI_ inline __attribute__((always_inline)) // inline always
|
||||
#define NI_ internal __attribute__((noinline)) // inline never
|
||||
#define RO_ __attribute__((section(".rodata"))) // Read only data allocation
|
||||
#define FI_ inline attribute(always_inline) // inline always
|
||||
#define NI_ internal attribute(noinline) // inline never
|
||||
#define RO_ attribute(section(".rodata")) // Read only data allocation
|
||||
#define T_ typeof //
|
||||
#define T_same(a,b) _Generic((a), typeof((b)): 1, default: 0)
|
||||
|
||||
@@ -262,6 +265,10 @@ FI_ U8 atm_swap_u8(U8_R addr, U8 value){asm volatile("lock xchgq %0,%1":"=r"(val
|
||||
#pragma endregion Thread Coherence
|
||||
|
||||
#pragma region Misc
|
||||
#define byte_pos(pos) (pos * 8)
|
||||
#define byte_shift(value,pos) (value << byte_pos(pos))
|
||||
#define u4_byte_fill(value) byte_shift(value,0) | byte_shift(value,1) | byte_shift(value,2) | byte_shift(value,3)
|
||||
|
||||
enum {
|
||||
Bitmask_3 = 0x00000007,
|
||||
Bitmask_4 = 0x0000000f,
|
||||
@@ -270,32 +277,8 @@ enum {
|
||||
Bitmask_10 = 0x000003ff,
|
||||
};
|
||||
|
||||
typedef Enum_(U4, WeekDay) {
|
||||
WeekDay_Sun,
|
||||
WeekDay_Mon,
|
||||
WeekDay_Tue,
|
||||
WeekDay_Wed,
|
||||
WeekDay_Thu,
|
||||
WeekDay_Fri,
|
||||
WeekDay_Sat,
|
||||
WeekDay_Num,
|
||||
};
|
||||
|
||||
typedef Enum_(U4, Month) {
|
||||
Month_Jan,
|
||||
Month_Feb,
|
||||
Month_Mar,
|
||||
Month_Apr,
|
||||
Month_May,
|
||||
Month_Jun,
|
||||
Month_Jul,
|
||||
Month_Aug,
|
||||
Month_Sep,
|
||||
Month_Oct,
|
||||
Month_Nov,
|
||||
Month_Dec,
|
||||
Month_Num,
|
||||
};
|
||||
typedef Enum_(U4,WeekDay){ WeekDay_Sun, WeekDay_Mon, WeekDay_Tue, WeekDay_Wed, WeekDay_Thu, WeekDay_Fri, WeekDay_Sat, WeekDay_Num, };
|
||||
typedef Enum_(U4,Month) { Month_Jan, Month_Feb, Month_Mar, Month_Apr, Month_May, Month_Jun, Month_Jul, Month_Aug, Month_Sep, Month_Oct, Month_Nov, Month_Dec, Month_Num, };
|
||||
|
||||
typedef U8 DenseTime;
|
||||
|
||||
|
||||
+38
-19
@@ -5,7 +5,7 @@
|
||||
|
||||
#define MEM_ALIGNMENT_DEFAULT 4
|
||||
|
||||
#define assert_bounds(point, start, end) for(;0;){ \
|
||||
#define assert_bounds(point, start, end) do{ \
|
||||
assert((start) <= (point)); \
|
||||
assert((point) <= (end)); \
|
||||
} while(0)
|
||||
@@ -39,8 +39,17 @@ FI_ B4 mem_match (U8 a, U8 b, U8 z) { return mem_compare(a, b, z) == 0; }
|
||||
#define mem_match_struct(a,b) mem_match(C_(U8,a), C_(U8,b), S_((a)[0]))
|
||||
#define mem_zero_struct(s) mem_zero(u8_(& s), S_(s))
|
||||
|
||||
#pragma region DAG
|
||||
I_ void mem_push_aligned_typed(U8 start, U8 capacity, U8_R used, U8 amount, U4 alignment, U4 type_width, U8_R out_ptr, U8_R out_len) {
|
||||
if (amount == 0) { out_ptr[0] = 0; out_len[0] = 0; return; }
|
||||
U8 desired = amount * (type_width == 0 ? 1 : type_width);
|
||||
U8 to_commit = align_pow2(desired, alignment ? alignment : MEM_ALIGNMENT_DEFAULT);
|
||||
U8 ptr = start + used[0];
|
||||
mem_bump_u8(start, capacity, used, to_commit);
|
||||
out_ptr[0] = ptr;
|
||||
out_len[0] = to_commit;
|
||||
}
|
||||
|
||||
#pragma region DAG
|
||||
#define check_nil(nil, p) ((p) == 0 || (p) == nil)
|
||||
#define set_nil(nil, p) ((p) = nil)
|
||||
|
||||
@@ -59,15 +68,13 @@ FI_ B4 mem_match (U8 a, U8 b, U8 z) { return mem_compare(a, b, z) == 0; }
|
||||
) \
|
||||
)
|
||||
#define sll_queue_push_n(f, l, n, next) sll_queue_push_nz(0, f, l, n, next)
|
||||
|
||||
#pragma endregion DAG
|
||||
|
||||
#pragma region Slice
|
||||
|
||||
typedef unsigned char TSet_(UTF8);
|
||||
typedef Struct_(Str8) { UTF8* ptr; U8 len; }; typedef Str8 Slice_UTF8;
|
||||
typedef Struct_(Slice_Str8) { Str8* ptr; U8 len; };
|
||||
#define slit8(string_literal) (Str8){ (UTF8*) string_literal, S_(string_literal) - 1 }
|
||||
#define slit8(string_literal) ((Str8){ (UTF8*) string_literal, S_(string_literal) - 1 })
|
||||
#define str8(p,l) (Str8){p,l}
|
||||
|
||||
typedef Struct_(Slice) { U8 ptr; U8 len; }; // Untyped Slice
|
||||
@@ -81,7 +88,6 @@ FI_ Slice slice_ut_(U8 ptr, U8 len) { return (Slice){ptr, len}; }
|
||||
#define slice_ut(ptr,len) slice_ut_(u8_(ptr), u8_(len))
|
||||
#define slice_ut_arr(a) slice_ut_(u8_(a), S_(a))
|
||||
#define slice_to_ut(s) slice_ut_(u8_((s).ptr), S_slice(s))
|
||||
|
||||
#define slice_iter(container, iter) (T_((container).ptr) iter = (container).ptr; iter != slice_end(container); ++ iter)
|
||||
#define slice_arg_from_array(type, ...) & (tmpl(Slice,type)) { .ptr = Array_decl(type,__VA_ARGS__), .len = Array_len( Array_decl(type,__VA_ARGS__)) }
|
||||
#define slice_from_array(type, array) (tmpl(Slice,type)) { .ptr = array, .len = S_(array) }
|
||||
@@ -105,11 +111,9 @@ typedef Slice_(U1);
|
||||
typedef Slice_(U2);
|
||||
typedef Slice_(U4);
|
||||
typedef Slice_(U8);
|
||||
|
||||
#pragma endregion Slice
|
||||
|
||||
#pragma region FArena
|
||||
|
||||
typedef Opt_(farena) { U8 alignment, type_width; };
|
||||
typedef Struct_(FArena) { U8 start, capacity, used; };
|
||||
FI_ void farena_init(FArena_R arena, Slice mem) { assert(arena != nullptr);
|
||||
@@ -118,13 +122,10 @@ FI_ void farena_init(FArena_R arena, Slice mem) { assert(arena != nullptr);
|
||||
arena->used = 0;
|
||||
}
|
||||
FI_ FArena farena_make(Slice mem) { FArena a; farena_init(& a, mem); return a; }
|
||||
I_ Slice farena_push(FArena_R arena, U8 amount, Opt_farena o) {
|
||||
if (amount == 0) { return (Slice){}; }
|
||||
U8 desired = amount * (o.type_width == 0 ? 1 : o.type_width);
|
||||
U8 to_commit = align_pow2(desired, o.alignment ? o.alignment : MEM_ALIGNMENT_DEFAULT);
|
||||
U8 ptr = arena->start + arena->used;
|
||||
mem_bump_u8(arena->start, arena->capacity, & arena->used, to_commit);
|
||||
return (Slice){ ptr, to_commit };
|
||||
FI_ Slice farena_push(FArena_R arena, U8 amount, Opt_farena o) { Slice res;
|
||||
mem_push_aligned_typed(arena->start, arena->capacity, & arena->used, amount, o.alignment, o.type_width
|
||||
, & res.ptr, & res.len);
|
||||
return res;
|
||||
}
|
||||
FI_ void farena_reset (FArena_R arena) { arena->used = 0; }
|
||||
FI_ void farena_rewind(FArena_R arena, U8 save_point) {
|
||||
@@ -132,8 +133,26 @@ FI_ void farena_rewind(FArena_R arena, U8 save_point) {
|
||||
arena->used = save_point;
|
||||
}
|
||||
FI_ U8 farena_save(FArena arena) { return arena.used; }
|
||||
#define farena_push_(arena, amount, ...) farena_push((arena), (amount), opt_(farena, __VA_ARGS__))
|
||||
#define farena_push_type(arena, type, ...) C_(type*, farena_push((arena), 1, opt_(farena, .type_width=S_(type), __VA_ARGS__)).ptr)
|
||||
#define farena_push_array(arena, type, amount, ...) (tmpl(Slice,type)){ C_(type*, farena_push((arena), (amount), opt_(farena, .type_width=S_(type), __VA_ARGS__)).ptr), (amount) }
|
||||
|
||||
#define farena_push_(arena, amount, ...) farena_push((arena),(amount),opt_(farena,__VA_ARGS__))
|
||||
#define farena_push_type(arena, type, ...) C_(type*,farena_push((arena),1, opt_(farena,.type_width=S_(type),__VA_ARGS__)).ptr)
|
||||
#define farena_push_array(arena, type, amount, ...) (tmpl(Slice,type)){ C_(type*,farena_push((arena),(amount),opt_(farena,.type_width=S_(type),__VA_ARGS__)).ptr),(amount) }
|
||||
#pragma endregion FArena
|
||||
|
||||
#pragma region FStack
|
||||
#define FStack_(name, type, width) Struct_(name) { U8 top; type arr[width]; }
|
||||
|
||||
FI_ Slice fstack_push(Slice mem, U8_R top, U8 amount, Opt_farena o) { Slice res;
|
||||
mem_push_aligned_typed(mem.ptr, mem.len, top, amount, o.alignment, o.type_width
|
||||
, & res.ptr, & res.len);
|
||||
return res;
|
||||
};
|
||||
|
||||
// This is here more for annotation than anything else.
|
||||
#define fstack_save(stack) stack.top
|
||||
#define fstack_rewind(stack, sp) do{stack.top = sp;}while(0)
|
||||
#define fstack_reset(stack) do{stack.top = 0; }while(0)
|
||||
|
||||
#define fstack_slice(stack) slice_ut_arr((stack).arr)
|
||||
#define fstack_push_(stk, amount, ...) fstack_push(fstack_slice(stk),&(stk).top,(amount),opt_(farena,__VA_ARGS__))
|
||||
#define fstack_push_array(stk, type, amount, ...) (tmpl(Slice,type)){ C_(type*,fstack_push(fstack_slice(stk),&(stk).top,(amount),opt_(farena,.type_width=S_(type),__VA_ARGS__)).ptr),(amount) }
|
||||
#pragma endregion FStack
|
||||
|
||||
+19
-4
@@ -1,14 +1,14 @@
|
||||
#ifdef INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
# include "dsl.h"
|
||||
# include "asm.h"
|
||||
# include "memory.h"
|
||||
# include "hashing.h"
|
||||
# include "analysis.h"
|
||||
#endif
|
||||
|
||||
#pragma region Key Table Linear (KTL)
|
||||
|
||||
enum { KT_SLot_value = S_(U8), };
|
||||
enum { KT_Slot_value = S_(U8), };
|
||||
#define KTL_Slot_(type) Struct_(tmpl(KTL_Slot,type)) { \
|
||||
U8 key; \
|
||||
type value; \
|
||||
@@ -34,7 +34,22 @@ FI_ void ktl_populate_slice_a2_str8(KTL_Str8* kt, Slice_A2_Str8 values) {
|
||||
mem_copy(u8_(& kt->ptr[id].value), u8_(& values.ptr[id][1]), S_(Str8));
|
||||
}
|
||||
}
|
||||
#define ktl_str8_key(str) hash64_fnv1a_ret(slice_to_ut(str8(str)), 0)
|
||||
#define ktl_str8_from_arr(arr) (KTL_Str8){arr, array_len(arr)}
|
||||
#define ktl_str8_key(str) hash64_fnv1a_ret(slice_to_ut(slit8(str)), 0)
|
||||
#define ktl_str8_from_arr(arr) (KTL_Str8){arr, Array_len(arr)}
|
||||
|
||||
FI_ Str8_R ktl_str8_find(KTL_Str8 table, U8 key) {
|
||||
U8 i = 0;
|
||||
while (table.len - i >= 4) {
|
||||
KTL_Slot_Str8_R p = table.ptr + i;
|
||||
U4 mask = find_aos_keys_mask_u8x4(& p[0].key, & p[1].key, & p[2].key, & p[3].key, key);
|
||||
if (mask) return & table.ptr[i + C_(U8, count_trailing_zeros_u4(mask))].value;
|
||||
i += 4;
|
||||
}
|
||||
while (i < table.len) {
|
||||
if (table.ptr[i].key == key) return & table.ptr[i].value;
|
||||
++ i;
|
||||
}
|
||||
assert(false);
|
||||
return nullptr;
|
||||
}
|
||||
#pragma endregion KTL
|
||||
|
||||
+51
-57
@@ -6,6 +6,7 @@
|
||||
# include "hashing.h"
|
||||
# include "tables.h"
|
||||
# include "analysis.h"
|
||||
# include "asm.h"
|
||||
#endif
|
||||
|
||||
// NOTE(rjf): Includes reverses for uppercase and lowercase hex.
|
||||
@@ -122,8 +123,8 @@ I_ Str8 str8_from_u4_buf(Slice buf, U4 num, U4 radix, U4 min_digits, U4 digit_gr
|
||||
/*Fill Prefix*/ if (info.prefix.len > 0) { slice_copy(result, info.prefix); }
|
||||
return result;
|
||||
}
|
||||
I_ Str8 str8_fmt_ktl_buf(Slice buffer, KTL_Str8 table, Str8 fmt_template)
|
||||
{
|
||||
|
||||
I_ Str8 str8_fmt_ktl_buf(Slice buffer, KTL_Str8 table, Str8 fmt_template){
|
||||
slice_assert(buffer);
|
||||
slice_assert(table);
|
||||
slice_assert(fmt_template);
|
||||
@@ -131,68 +132,41 @@ I_ Str8 str8_fmt_ktl_buf(Slice buffer, KTL_Str8 table, Str8 fmt_template)
|
||||
U8 buffer_remaining = buffer.len;
|
||||
UTF8_R cursor_fmt = fmt_template.ptr;
|
||||
U8 left_fmt = fmt_template.len;
|
||||
U1x16 needle_lt = splat_u4_u1x16(u4_byte_fill('<'));
|
||||
U1x16 needle_gt = splat_u4_u1x16(u4_byte_fill('>'));
|
||||
while (left_fmt && buffer_remaining)
|
||||
{
|
||||
// Forward until we hit the delimiter '<' or the template's contents are exhausted.
|
||||
U8 copy_offset = 0;
|
||||
if (cursor_fmt[0] == '<')
|
||||
{
|
||||
UTF8_R potential_token_cursor = cursor_fmt + 1; // Skip '<'
|
||||
U8 potential_token_len = 0;
|
||||
B4 fmt_overflow = false;
|
||||
while(true) {
|
||||
UTF8_R cursor = potential_token_cursor + potential_token_len;
|
||||
fmt_overflow = cursor >= slice_end(fmt_template);
|
||||
B4 found_terminator = potential_token_cursor[potential_token_len] == '>';
|
||||
if (fmt_overflow || found_terminator) { break; }
|
||||
++ potential_token_len;
|
||||
}
|
||||
if (fmt_overflow) {
|
||||
// Failed to find a subst and we're at end of fmt, just copy segment.
|
||||
copy_offset = 1 + potential_token_len; // '<' + token
|
||||
goto write_to_buffer;
|
||||
}
|
||||
// Hashing the potential token and cross checking it with our token table
|
||||
U8 key = hash64_fnv1a_ret(slice_ut(u8_(potential_token_cursor), potential_token_len), 0);
|
||||
Str8_R value = nullptr; for slice_iter(table, token) {
|
||||
// We do a linear iteration instead of a hash table lookup because the user should never subst with more than 100 unqiue tokens..
|
||||
if (token->key == key) { value = & token->value; break; }
|
||||
}
|
||||
if (value)
|
||||
{
|
||||
// We're going to appending the string, make sure we have enough space in our buffer.
|
||||
// NOTE(Ed): this version doesn't support growing the buffer (No Allocator Interface)
|
||||
assert((buffer_remaining - potential_token_len) > 0);
|
||||
copy_offset = min(buffer_remaining, value->len); // Prevent Buffer overflow.
|
||||
mem_copy(u8_(cursor_buffer), u8_(value->ptr), buffer_remaining);
|
||||
// Sync cursor format to after the processed token
|
||||
cursor_buffer += copy_offset;
|
||||
buffer_remaining -= copy_offset;
|
||||
cursor_fmt = potential_token_cursor + 1 + potential_token_len; // '<' + token
|
||||
left_fmt -= potential_token_len + 2; // The 2 here are the '<' & '>' delimiters being omitted.
|
||||
continue;
|
||||
}
|
||||
// If not a subsitution, we copy the segment and continue.
|
||||
copy_offset = 1 + potential_token_len; // '<' + token
|
||||
goto write_to_buffer;
|
||||
if (cursor_fmt[0] == '<') {
|
||||
UTF8_R sig = cursor_fmt + 1;
|
||||
U8 sig_max = slice_end(fmt_template) - sig;
|
||||
U8 sig_len = find_u1_via_u1x16(sig, sig_max, '>', needle_gt);
|
||||
assert(sig_len < sig_max);
|
||||
|
||||
Str8_R value = ktl_str8_find(table, hash64_fnv1a_ret(slice_ut(sig, sig_len), 0));
|
||||
U8 n = min(buffer_remaining, value->len);
|
||||
assert((buffer_remaining - n) > 0); mem_copy(u8_(cursor_buffer), u8_(value->ptr), n);
|
||||
cursor_buffer += n;
|
||||
buffer_remaining -= n;
|
||||
cursor_fmt = sig + sig_len + 1;
|
||||
left_fmt -= sig_len + 2;
|
||||
continue;
|
||||
}
|
||||
else do {
|
||||
++ copy_offset;
|
||||
}
|
||||
while ( (cursor_fmt[copy_offset] != '<' && (cursor_fmt + copy_offset) < slice_end(fmt_template)) );
|
||||
write_to_buffer:
|
||||
assert((buffer_remaining - copy_offset) > 0);
|
||||
copy_offset = min(buffer_remaining, copy_offset); // Prevent buffer overflow.
|
||||
mem_copy(u8_(cursor_buffer), u8_(cursor_fmt), copy_offset);
|
||||
buffer_remaining -= copy_offset;
|
||||
left_fmt -= copy_offset;
|
||||
cursor_buffer += copy_offset;
|
||||
cursor_fmt += copy_offset;
|
||||
U8 n = find_u1_via_u1x16(cursor_fmt, min(left_fmt, buffer_remaining), '<', needle_lt);
|
||||
assert((buffer_remaining - 1) > 0); n = min(buffer_remaining, n);
|
||||
mem_copy(u8_(cursor_buffer), u8_(cursor_fmt), n);
|
||||
cursor_buffer += n;
|
||||
cursor_fmt += n;
|
||||
buffer_remaining -= n;
|
||||
left_fmt -= n;
|
||||
}
|
||||
return (Str8){C_(UTF8*, buffer.ptr), buffer.len - buffer_remaining};
|
||||
return str8(C_(UTF8*,buffer.ptr), buffer.len - buffer_remaining);
|
||||
}
|
||||
|
||||
typedef Struct_(Str8Gen) { UTF8* ptr; U8 cap, len; };
|
||||
FI_ Str8Gen str8gen_make(Slice s) { return (Str8Gen){C_(UTF8*,s.ptr), s.len, 0}; }
|
||||
|
||||
FI_ Slice str8gen_buf(Str8Gen_R gen) { return (Slice){u8_(gen->ptr) + gen->len, gen->cap - gen->len}; }
|
||||
|
||||
FI_ void str8gen_append_str8(Str8Gen_R gen, Str8 str) { assert(gen != nullptr);
|
||||
@@ -223,8 +197,7 @@ str16_from_8(FArena* arena, Str8 in) {
|
||||
U1* opl = ptr + in.len;
|
||||
U8 size = 0;
|
||||
UnicodeDecode consume;
|
||||
for(;ptr < opl; ptr += consume.inc)
|
||||
{
|
||||
for(;ptr < opl; ptr += consume.inc) {
|
||||
consume = utf8_decode(ptr, opl - ptr);
|
||||
size += utf16_encode(str.ptr + size, consume.codepoint);
|
||||
}
|
||||
@@ -235,3 +208,24 @@ str16_from_8(FArena* arena, Str8 in) {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// Formatter where serial operation is done on-demand per-entry.
|
||||
|
||||
// enum {
|
||||
// KTL_Str8FmtEntry_InlaidSize = (S_(Str8) * 2) - S_(Str8Fmt_TokenKind),
|
||||
// };
|
||||
// typedef Enum_(U4, Str8Fmt_SerialOpKind) {
|
||||
// Str8Fmt_TKind_Str8,
|
||||
// Str8Fmt_Base16_U1,
|
||||
// Str8Fmt_Base16_U2,
|
||||
// Str8Fmt_Base10_U4,
|
||||
// };
|
||||
// typedef Struct_(KTL_Str8Fmt_SerialOp_Entry) {
|
||||
// union {
|
||||
// U1 InlaidData[KTL_Str8FmtEntry_InlaidSize];
|
||||
// Str8 str;
|
||||
// void* Ptr;
|
||||
// };
|
||||
// Str8Fmt_SerialOpKind kind;
|
||||
// };
|
||||
// typedef KTL_Slot_(KTL_Str8Fmt_SerialOp_Entry);
|
||||
|
||||
@@ -128,6 +128,7 @@ $f_ms_extensions = '-fms-extensions' # Allow MSVC language extension
|
||||
$f_ms_compatibility = '-fms-compatibility'
|
||||
$f_ms_runtime_lib_none = '-fno-ms-runtime'
|
||||
$f_preprocess_non_integrated = '-no-integrated-cpp'
|
||||
$f_stack_probes_disabled = '-mno-stack-arg-probe' # Requires the fully committed stack in link-modules
|
||||
$f_stack_protector = '-fstack-protector'
|
||||
$f_stack_protector_strong = '-fstack-protector-strong'
|
||||
$f_stack_protector_all = '-fstack-protector-all'
|
||||
@@ -144,6 +145,9 @@ $f_sanitize_hwaddress = '-fsanitize=hwaddress'
|
||||
$f_sanitize_address_safe = '-fsanitize=address,safe-stack'
|
||||
$f_sanitize_cfi = '-fsanitize=cfi'
|
||||
|
||||
# --- Compiler Flags: Hardware Architecture ---
|
||||
$f_arch_haswell = '-march=haswell'
|
||||
|
||||
# --- Compiler Flags: Environment / Target ---
|
||||
$f_no_stdlib = '-nostdlib'
|
||||
$f_freestanding = '-ffreestanding'
|
||||
@@ -285,10 +289,12 @@ function compile-unit { param(
|
||||
$compile_args = @()
|
||||
$compile_args += $f_std_c11
|
||||
$compile_args += $f_all_c
|
||||
$compile_args += $f_arch_haswell
|
||||
$compile_args += $f_ms_ex
|
||||
$compile_args += $f_wall
|
||||
$compile_args += $f_wno_attributes
|
||||
$compile_args += $f_exceptions_disabled
|
||||
$compile_args += $f_stack_probes_disabled
|
||||
$compile_args += $f_diagnostics_absolute
|
||||
$compile_args += $f_debug
|
||||
foreach ($p in $include_paths) {
|
||||
@@ -321,6 +327,7 @@ function link-modules { param(
|
||||
$link_args += $f_link_win_no_incremental
|
||||
$link_args += ($f_link_win_path_output + $module)
|
||||
$link_args += $f_link_win_subsystem_console
|
||||
$link_args += ($f_link_win_stack + '262144,262144') # 256 KiB reserved
|
||||
$link_args += $f_link_win_debug
|
||||
$link_args += ($f_link_win_entry + 'main')
|
||||
$link_args += ($f_link_win_pdb + $pdb)
|
||||
|
||||
Reference in New Issue
Block a user