42 rs_trace(
"emit DELTA magic");
50 int param_len = len <= 64 ? 0 : rs_int_len(len);
54 rs_trace(
"emit LITERAL_%d, cmd_byte=%#04x", len, cmd);
55 }
else if (param_len == 1) {
56 cmd = RS_OP_LITERAL_N1;
57 rs_trace(
"emit LITERAL_N1(len=%d), cmd_byte=%#04x", len, cmd);
58 }
else if (param_len == 2) {
59 cmd = RS_OP_LITERAL_N2;
60 rs_trace(
"emit LITERAL_N2(len=%d), cmd_byte=%#04x", len, cmd);
62 assert(param_len == 4);
63 cmd = RS_OP_LITERAL_N4;
64 rs_trace(
"emit LITERAL_N4(len=%d), cmd_byte=%#04x", len, cmd);
84 const int where_bytes = rs_int_len(where);
85 const int len_bytes = rs_int_len(len);
89 cmd = RS_OP_COPY_N8_N1;
90 else if (where_bytes == 4)
91 cmd = RS_OP_COPY_N4_N1;
92 else if (where_bytes == 2)
93 cmd = RS_OP_COPY_N2_N1;
95 assert(where_bytes == 1);
96 cmd = RS_OP_COPY_N1_N1;
100 else if (len_bytes == 2)
102 else if (len_bytes == 4)
105 assert(len_bytes == 8);
109 rs_trace(
"emit COPY_N%d_N%d(where=" FMT_LONG
", len=" FMT_LONG
110 "), cmd_byte=%#04x", where_bytes, len_bytes, where, len, cmd);
116 stats->copy_bytes += len;
117 stats->copy_cmdbytes += 1 + where_bytes + len_bytes;
127 rs_trace(
"emit END, cmd_byte=%#04x", cmd);