../3rdparty/pcre/sljit/sljitNativeX86_common.c

Source codeSwitch to Preprocessed file
LineSource CodeCoverage
1/* -
2 * Stack-less Just-In-Time compiler -
3 * -
4 * Copyright 2009-2012 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved. -
5 * -
6 * Redistribution and use in source and binary forms, with or without modification, are -
7 * permitted provided that the following conditions are met: -
8 * -
9 * 1. Redistributions of source code must retain the above copyright notice, this list of -
10 * conditions and the following disclaimer. -
11 * -
12 * 2. Redistributions in binary form must reproduce the above copyright notice, this list -
13 * of conditions and the following disclaimer in the documentation and/or other materials -
14 * provided with the distribution. -
15 * -
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND CONTRIBUTORS ``AS IS'' AND ANY -
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT -
19 * SHALL THE COPYRIGHT HOLDER(S) OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -
21 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -
22 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -
23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -
24 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -
25 */ -
26 -
27SLJIT_API_FUNC_ATTRIBUTE SLJIT_CONST char* sljit_get_platform_name() -
28{ -
29 return "x86" SLJIT_CPUINFO;
never executed: return "x86" " 64bit (" "little endian + " "unaligned)";
0
30} -
31 -
32/* -
33 32b register indexes: -
34 0 - EAX -
35 1 - ECX -
36 2 - EDX -
37 3 - EBX -
38 4 - none -
39 5 - EBP -
40 6 - ESI -
41 7 - EDI -
42*/ -
43 -
44/* -
45 64b register indexes: -
46 0 - RAX -
47 1 - RCX -
48 2 - RDX -
49 3 - RBX -
50 4 - none -
51 5 - RBP -
52 6 - RSI -
53 7 - RDI -
54 8 - R8 - From now on REX prefix is required -
55 9 - R9 -
56 10 - R10 -
57 11 - R11 -
58 12 - R12 -
59 13 - R13 -
60 14 - R14 -
61 15 - R15 -
62*/ -
63 -
64#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
65 -
66/* Last register + 1. */ -
67#define TMP_REGISTER (SLJIT_NO_REGISTERS + 1) -
68 -
69static SLJIT_CONST sljit_ub reg_map[SLJIT_NO_REGISTERS + 2] = { -
70 0, 0, 2, 1, 0, 0, 3, 6, 7, 0, 0, 4, 5 -
71}; -
72 -
73#define CHECK_EXTRA_REGS(p, w, do) \ -
74 if (p >= SLJIT_TEMPORARY_EREG1 && p <= SLJIT_TEMPORARY_EREG2) { \ -
75 w = compiler->temporaries_start + (p - SLJIT_TEMPORARY_EREG1) * sizeof(sljit_w); \ -
76 p = SLJIT_MEM1(SLJIT_LOCALS_REG); \ -
77 do; \ -
78 } \ -
79 else if (p >= SLJIT_SAVED_EREG1 && p <= SLJIT_SAVED_EREG2) { \ -
80 w = compiler->saveds_start + (p - SLJIT_SAVED_EREG1) * sizeof(sljit_w); \ -
81 p = SLJIT_MEM1(SLJIT_LOCALS_REG); \ -
82 do; \ -
83 } -
84 -
85#else /* SLJIT_CONFIG_X86_32 */ -
86 -
87/* Last register + 1. */ -
88#define TMP_REGISTER (SLJIT_NO_REGISTERS + 1) -
89#define TMP_REG2 (SLJIT_NO_REGISTERS + 2) -
90#define TMP_REG3 (SLJIT_NO_REGISTERS + 3) -
91 -
92/* Note: r12 & 0x7 == 0b100, which decoded as SIB byte present -
93 Note: avoid to use r12 and r13 for memory addessing -
94 therefore r12 is better for SAVED_EREG than SAVED_REG. */ -
95#ifndef _WIN64 -
96/* 1st passed in rdi, 2nd argument passed in rsi, 3rd in rdx. */ -
97static SLJIT_CONST sljit_ub reg_map[SLJIT_NO_REGISTERS + 4] = { -
98 0, 0, 6, 1, 8, 11, 3, 15, 14, 13, 12, 4, 2, 7, 9 -
99}; -
100/* low-map. reg_map & 0x7. */ -
101static SLJIT_CONST sljit_ub reg_lmap[SLJIT_NO_REGISTERS + 4] = { -
102 0, 0, 6, 1, 0, 3, 3, 7, 6, 5, 4, 4, 2, 7, 1 -
103}; -
104#else -
105/* 1st passed in rcx, 2nd argument passed in rdx, 3rd in r8. */ -
106static SLJIT_CONST sljit_ub reg_map[SLJIT_NO_REGISTERS + 4] = { -
107 0, 0, 2, 1, 11, 13, 3, 6, 7, 14, 12, 15, 10, 8, 9 -
108}; -
109/* low-map. reg_map & 0x7. */ -
110static SLJIT_CONST sljit_ub reg_lmap[SLJIT_NO_REGISTERS + 4] = { -
111 0, 0, 2, 1, 3, 5, 3, 6, 7, 6, 4, 7, 2, 0, 1 -
112}; -
113#endif -
114 -
115#define REX_W 0x48 -
116#define REX_R 0x44 -
117#define REX_X 0x42 -
118#define REX_B 0x41 -
119#define REX 0x40 -
120 -
121typedef unsigned int sljit_uhw; -
122typedef int sljit_hw; -
123 -
124#define IS_HALFWORD(x) ((x) <= 0x7fffffffll && (x) >= -0x80000000ll) -
125#define NOT_HALFWORD(x) ((x) > 0x7fffffffll || (x) < -0x80000000ll) -
126 -
127#define CHECK_EXTRA_REGS(p, w, do) -
128 -
129#endif /* SLJIT_CONFIG_X86_32 */ -
130 -
131#if (defined SLJIT_SSE2 && SLJIT_SSE2) -
132#define TMP_FREG (SLJIT_FLOAT_REG4 + 1) -
133#endif -
134 -
135/* Size flags for emit_x86_instruction: */ -
136#define EX86_BIN_INS 0x0010 -
137#define EX86_SHIFT_INS 0x0020 -
138#define EX86_REX 0x0040 -
139#define EX86_NO_REXW 0x0080 -
140#define EX86_BYTE_ARG 0x0100 -
141#define EX86_HALF_ARG 0x0200 -
142#define EX86_PREF_66 0x0400 -
143 -
144#if (defined SLJIT_SSE2 && SLJIT_SSE2) -
145#define EX86_PREF_F2 0x0800 -
146#define EX86_SSE2 0x1000 -
147#endif -
148 -
149#define INC_SIZE(s) (*buf++ = (s), compiler->size += (s)) -
150#define INC_CSIZE(s) (*code++ = (s), compiler->size += (s)) -
151 -
152#define PUSH_REG(r) (*buf++ = (0x50 + (r))) -
153#define POP_REG(r) (*buf++ = (0x58 + (r))) -
154#define RET() (*buf++ = (0xc3)) -
155#define RETN(n) (*buf++ = (0xc2), *buf++ = n, *buf++ = 0) -
156/* r32, r/m32 */ -
157#define MOV_RM(mod, reg, rm) (*buf++ = (0x8b), *buf++ = (mod) << 6 | (reg) << 3 | (rm)) -
158 -
159static sljit_ub get_jump_code(int type) -
160{ -
161 switch (type) { -
162 case SLJIT_C_EQUAL: -
163 case SLJIT_C_FLOAT_EQUAL: -
164 return 0x84;
executed: return 0x84;
Execution Count:70
70
165 -
166 case SLJIT_C_NOT_EQUAL: -
167 case SLJIT_C_FLOAT_NOT_EQUAL: -
168 return 0x85;
executed: return 0x85;
Execution Count:78
78
169 -
170 case SLJIT_C_LESS: -
171 case SLJIT_C_FLOAT_LESS: -
172 return 0x82;
executed: return 0x82;
Execution Count:54
54
173 -
174 case SLJIT_C_GREATER_EQUAL: -
175 case SLJIT_C_FLOAT_GREATER_EQUAL: -
176 return 0x83;
executed: return 0x83;
Execution Count:26
26
177 -
178 case SLJIT_C_GREATER: -
179 case SLJIT_C_FLOAT_GREATER: -
180 return 0x87;
executed: return 0x87;
Execution Count:23
23
181 -
182 case SLJIT_C_LESS_EQUAL: -
183 case SLJIT_C_FLOAT_LESS_EQUAL: -
184 return 0x86;
executed: return 0x86;
Execution Count:14
14
185 -
186 case SLJIT_C_SIG_LESS: -
187 return 0x8c;
never executed: return 0x8c;
0
188 -
189 case SLJIT_C_SIG_GREATER_EQUAL: -
190 return 0x8d;
never executed: return 0x8d;
0
191 -
192 case SLJIT_C_SIG_GREATER: -
193 return 0x8f;
never executed: return 0x8f;
0
194 -
195 case SLJIT_C_SIG_LESS_EQUAL: -
196 return 0x8e;
never executed: return 0x8e;
0
197 -
198 case SLJIT_C_OVERFLOW: -
199 case SLJIT_C_MUL_OVERFLOW: -
200 return 0x80;
never executed: return 0x80;
0
201 -
202 case SLJIT_C_NOT_OVERFLOW: -
203 case SLJIT_C_MUL_NOT_OVERFLOW: -
204 return 0x81;
never executed: return 0x81;
0
205 -
206 case SLJIT_C_FLOAT_NAN: -
207 return 0x8a;
never executed: return 0x8a;
0
208 -
209 case SLJIT_C_FLOAT_NOT_NAN: -
210 return 0x8b;
never executed: return 0x8b;
0
211 } -
212 return 0;
never executed: return 0;
0
213} -
214 -
215static sljit_ub* generate_far_jump_code(struct sljit_jump *jump, sljit_ub *code_ptr, int type); -
216 -
217#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
218static sljit_ub* generate_fixed_jump(sljit_ub *code_ptr, sljit_w addr, int type); -
219#endif -
220 -
221static sljit_ub* generate_near_jump_code(struct sljit_jump *jump, sljit_ub *code_ptr, sljit_ub *code, int type) -
222{ -
223 int short_jump;
executed (the execution status of this line is deduced): int short_jump;
-
224 sljit_uw label_addr;
executed (the execution status of this line is deduced): sljit_uw label_addr;
-
225 -
226 if (jump->flags & JUMP_LABEL)
evaluated: jump->flags & 0x1
TRUEFALSE
yes
Evaluation Count:401
yes
Evaluation Count:15
15-401
227 label_addr = (sljit_uw)(code + jump->u.label->size);
executed: label_addr = (sljit_uw)(code + jump->u.label->size);
Execution Count:401
401
228 else -
229 label_addr = jump->u.target;
executed: label_addr = jump->u.target;
Execution Count:15
15
230 short_jump = (sljit_w)(label_addr - (jump->addr + 2)) >= -128 && (sljit_w)(label_addr - (jump->addr + 2)) <= 127;
evaluated: (sljit_w)(label_addr - (jump->addr + 2)) >= -128
TRUEFALSE
yes
Evaluation Count:313
yes
Evaluation Count:103
evaluated: (sljit_w)(label_addr - (jump->addr + 2)) <= 127
TRUEFALSE
yes
Evaluation Count:137
yes
Evaluation Count:176
103-313
231 -
232#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
233 if ((sljit_w)(label_addr - (jump->addr + 1)) > 0x7fffffffll || (sljit_w)(label_addr - (jump->addr + 1)) < -0x80000000ll)
partially evaluated: (sljit_w)(label_addr - (jump->addr + 1)) > 0x7fffffffll
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:416
partially evaluated: (sljit_w)(label_addr - (jump->addr + 1)) < -0x80000000ll
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:416
0-416
234 return generate_far_jump_code(jump, code_ptr, type);
never executed: return generate_far_jump_code(jump, code_ptr, type);
0
235#endif -
236 -
237 if (type == SLJIT_JUMP) {
evaluated: type == 22
TRUEFALSE
yes
Evaluation Count:113
yes
Evaluation Count:303
113-303
238 if (short_jump)
evaluated: short_jump
TRUEFALSE
yes
Evaluation Count:52
yes
Evaluation Count:61
52-61
239 *code_ptr++ = 0xeb;
executed: *code_ptr++ = 0xeb;
Execution Count:52
52
240 else -
241 *code_ptr++ = 0xe9;
executed: *code_ptr++ = 0xe9;
Execution Count:61
61
242 jump->addr++;
executed (the execution status of this line is deduced): jump->addr++;
-
243 }
executed: }
Execution Count:113
113
244 else if (type >= SLJIT_FAST_CALL) {
evaluated: type >= 23
TRUEFALSE
yes
Evaluation Count:38
yes
Evaluation Count:265
38-265
245 short_jump = 0;
executed (the execution status of this line is deduced): short_jump = 0;
-
246 *code_ptr++ = 0xe8;
executed (the execution status of this line is deduced): *code_ptr++ = 0xe8;
-
247 jump->addr++;
executed (the execution status of this line is deduced): jump->addr++;
-
248 }
executed: }
Execution Count:38
38
249 else if (short_jump) {
evaluated: short_jump
TRUEFALSE
yes
Evaluation Count:85
yes
Evaluation Count:180
85-180
250 *code_ptr++ = get_jump_code(type) - 0x10;
executed (the execution status of this line is deduced): *code_ptr++ = get_jump_code(type) - 0x10;
-
251 jump->addr++;
executed (the execution status of this line is deduced): jump->addr++;
-
252 }
executed: }
Execution Count:85
85
253 else { -
254 *code_ptr++ = 0x0f;
executed (the execution status of this line is deduced): *code_ptr++ = 0x0f;
-
255 *code_ptr++ = get_jump_code(type);
executed (the execution status of this line is deduced): *code_ptr++ = get_jump_code(type);
-
256 jump->addr += 2;
executed (the execution status of this line is deduced): jump->addr += 2;
-
257 }
executed: }
Execution Count:180
180
258 -
259 if (short_jump) {
evaluated: short_jump
TRUEFALSE
yes
Evaluation Count:137
yes
Evaluation Count:279
137-279
260 jump->flags |= PATCH_MB;
executed (the execution status of this line is deduced): jump->flags |= 0x4;
-
261 code_ptr += sizeof(sljit_b);
executed (the execution status of this line is deduced): code_ptr += sizeof(sljit_b);
-
262 } else {
executed: }
Execution Count:137
137
263 jump->flags |= PATCH_MW;
executed (the execution status of this line is deduced): jump->flags |= 0x8;
-
264#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
265 code_ptr += sizeof(sljit_w); -
266#else -
267 code_ptr += sizeof(sljit_hw);
executed (the execution status of this line is deduced): code_ptr += sizeof(sljit_hw);
-
268#endif -
269 }
executed: }
Execution Count:279
279
270 -
271 return code_ptr;
executed: return code_ptr;
Execution Count:416
416
272} -
273 -
274SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compiler) -
275{ -
276 struct sljit_memory_fragment *buf;
executed (the execution status of this line is deduced): struct sljit_memory_fragment *buf;
-
277 sljit_ub *code;
executed (the execution status of this line is deduced): sljit_ub *code;
-
278 sljit_ub *code_ptr;
executed (the execution status of this line is deduced): sljit_ub *code_ptr;
-
279 sljit_ub *buf_ptr;
executed (the execution status of this line is deduced): sljit_ub *buf_ptr;
-
280 sljit_ub *buf_end;
executed (the execution status of this line is deduced): sljit_ub *buf_end;
-
281 sljit_ub len;
executed (the execution status of this line is deduced): sljit_ub len;
-
282 -
283 struct sljit_label *label;
executed (the execution status of this line is deduced): struct sljit_label *label;
-
284 struct sljit_jump *jump;
executed (the execution status of this line is deduced): struct sljit_jump *jump;
-
285 struct sljit_const *const_;
executed (the execution status of this line is deduced): struct sljit_const *const_;
-
286 -
287 CHECK_ERROR_PTR();
never executed: return ((void *)0);
executed: }
Execution Count:15
partially evaluated: __builtin_expect((compiler->error), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
0-15
288 check_sljit_generate_code(compiler);
executed (the execution status of this line is deduced): check_sljit_generate_code(compiler);
-
289 reverse_buf(compiler);
executed (the execution status of this line is deduced): reverse_buf(compiler);
-
290 -
291 /* Second code generation pass. */ -
292 code = (sljit_ub*)SLJIT_MALLOC_EXEC(compiler->size);
executed (the execution status of this line is deduced): code = (sljit_ub*)sljit_malloc_exec(compiler->size);
-
293 PTR_FAIL_WITH_EXEC_IF(code);
never executed: return ((void *)0);
executed: }
Execution Count:15
partially evaluated: __builtin_expect((!(code)), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
0-15
294 buf = compiler->buf;
executed (the execution status of this line is deduced): buf = compiler->buf;
-
295 -
296 code_ptr = code;
executed (the execution status of this line is deduced): code_ptr = code;
-
297 label = compiler->labels;
executed (the execution status of this line is deduced): label = compiler->labels;
-
298 jump = compiler->jumps;
executed (the execution status of this line is deduced): jump = compiler->jumps;
-
299 const_ = compiler->consts;
executed (the execution status of this line is deduced): const_ = compiler->consts;
-
300 do { -
301 buf_ptr = buf->memory;
executed (the execution status of this line is deduced): buf_ptr = buf->memory;
-
302 buf_end = buf_ptr + buf->used_size;
executed (the execution status of this line is deduced): buf_end = buf_ptr + buf->used_size;
-
303 do { -
304 len = *buf_ptr++;
executed (the execution status of this line is deduced): len = *buf_ptr++;
-
305 if (len > 0) {
evaluated: len > 0
TRUEFALSE
yes
Evaluation Count:1667
yes
Evaluation Count:687
687-1667
306 /* The code is already generated. */ -
307 SLJIT_MEMMOVE(code_ptr, buf_ptr, len);
executed (the execution status of this line is deduced): memmove(code_ptr, buf_ptr, len);
-
308 code_ptr += len;
executed (the execution status of this line is deduced): code_ptr += len;
-
309 buf_ptr += len;
executed (the execution status of this line is deduced): buf_ptr += len;
-
310 }
executed: }
Execution Count:1667
1667
311 else { -
312 if (*buf_ptr >= 4) {
evaluated: *buf_ptr >= 4
TRUEFALSE
yes
Evaluation Count:416
yes
Evaluation Count:271
271-416
313 jump->addr = (sljit_uw)code_ptr;
executed (the execution status of this line is deduced): jump->addr = (sljit_uw)code_ptr;
-
314 if (!(jump->flags & SLJIT_REWRITABLE_JUMP))
partially evaluated: !(jump->flags & 0x1000)
TRUEFALSE
yes
Evaluation Count:416
no
Evaluation Count:0
0-416
315 code_ptr = generate_near_jump_code(jump, code_ptr, code, *buf_ptr - 4);
executed: code_ptr = generate_near_jump_code(jump, code_ptr, code, *buf_ptr - 4);
Execution Count:416
416
316 else -
317 code_ptr = generate_far_jump_code(jump, code_ptr, *buf_ptr - 4);
never executed: code_ptr = generate_far_jump_code(jump, code_ptr, *buf_ptr - 4);
0
318 jump = jump->next;
executed (the execution status of this line is deduced): jump = jump->next;
-
319 }
executed: }
Execution Count:416
416
320 else if (*buf_ptr == 0) {
partially evaluated: *buf_ptr == 0
TRUEFALSE
yes
Evaluation Count:271
no
Evaluation Count:0
0-271
321 label->addr = (sljit_uw)code_ptr;
executed (the execution status of this line is deduced): label->addr = (sljit_uw)code_ptr;
-
322 label->size = code_ptr - code;
executed (the execution status of this line is deduced): label->size = code_ptr - code;
-
323 label = label->next;
executed (the execution status of this line is deduced): label = label->next;
-
324 }
executed: }
Execution Count:271
271
325 else if (*buf_ptr == 1) {
never evaluated: *buf_ptr == 1
0
326 const_->addr = ((sljit_uw)code_ptr) - sizeof(sljit_w);
never executed (the execution status of this line is deduced): const_->addr = ((sljit_uw)code_ptr) - sizeof(sljit_w);
-
327 const_ = const_->next;
never executed (the execution status of this line is deduced): const_ = const_->next;
-
328 }
never executed: }
0
329 else { -
330#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
331 *code_ptr++ = (*buf_ptr == 2) ? 0xe8 /* call */ : 0xe9 /* jmp */; -
332 buf_ptr++; -
333 *(sljit_w*)code_ptr = *(sljit_w*)buf_ptr - ((sljit_w)code_ptr + sizeof(sljit_w)); -
334 code_ptr += sizeof(sljit_w); -
335 buf_ptr += sizeof(sljit_w) - 1; -
336#else -
337 code_ptr = generate_fixed_jump(code_ptr, *(sljit_w*)(buf_ptr + 1), *buf_ptr);
never executed (the execution status of this line is deduced): code_ptr = generate_fixed_jump(code_ptr, *(sljit_w*)(buf_ptr + 1), *buf_ptr);
-
338 buf_ptr += sizeof(sljit_w);
never executed (the execution status of this line is deduced): buf_ptr += sizeof(sljit_w);
-
339#endif -
340 }
never executed: }
0
341 buf_ptr++;
executed (the execution status of this line is deduced): buf_ptr++;
-
342 }
executed: }
Execution Count:687
687
343 } while (buf_ptr < buf_end);
evaluated: buf_ptr < buf_end
TRUEFALSE
yes
Evaluation Count:2339
yes
Evaluation Count:15
15-2339
344 SLJIT_ASSERT(buf_ptr == buf_end);
executed: }
Execution Count:15
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
0-15
345 buf = buf->next;
executed (the execution status of this line is deduced): buf = buf->next;
-
346 } while (buf);
executed: }
Execution Count:15
partially evaluated: buf
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
0-15
347 -
348 SLJIT_ASSERT(!label);
executed: }
Execution Count:15
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
0-15
349 SLJIT_ASSERT(!jump);
executed: }
Execution Count:15
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
0-15
350 SLJIT_ASSERT(!const_);
executed: }
Execution Count:15
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
0-15
351 -
352 jump = compiler->jumps;
executed (the execution status of this line is deduced): jump = compiler->jumps;
-
353 while (jump) {
evaluated: jump
TRUEFALSE
yes
Evaluation Count:416
yes
Evaluation Count:15
15-416
354 if (jump->flags & PATCH_MB) {
evaluated: jump->flags & 0x4
TRUEFALSE
yes
Evaluation Count:137
yes
Evaluation Count:279
137-279
355 SLJIT_ASSERT((sljit_w)(jump->u.label->addr - (jump->addr + sizeof(sljit_b))) >= -128 && (sljit_w)(jump->u.label->addr - (jump->addr + sizeof(sljit_b))) <= 127);
executed: }
Execution Count:137
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:137
0-137
356 *(sljit_ub*)jump->addr = (sljit_ub)(jump->u.label->addr - (jump->addr + sizeof(sljit_b)));
executed (the execution status of this line is deduced): *(sljit_ub*)jump->addr = (sljit_ub)(jump->u.label->addr - (jump->addr + sizeof(sljit_b)));
-
357 } else if (jump->flags & PATCH_MW) {
executed: }
Execution Count:137
partially evaluated: jump->flags & 0x8
TRUEFALSE
yes
Evaluation Count:279
no
Evaluation Count:0
0-279
358 if (jump->flags & JUMP_LABEL) {
evaluated: jump->flags & 0x1
TRUEFALSE
yes
Evaluation Count:264
yes
Evaluation Count:15
15-264
359#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
360 *(sljit_w*)jump->addr = (sljit_w)(jump->u.label->addr - (jump->addr + sizeof(sljit_w))); -
361#else -
362 SLJIT_ASSERT((sljit_w)(jump->u.label->addr - (jump->addr + sizeof(sljit_hw))) >= -0x80000000ll && (sljit_w)(jump->u.label->addr - (jump->addr + sizeof(sljit_hw))) <= 0x7fffffffll);
executed: }
Execution Count:264
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:264
0-264
363 *(sljit_hw*)jump->addr = (sljit_hw)(jump->u.label->addr - (jump->addr + sizeof(sljit_hw)));
executed (the execution status of this line is deduced): *(sljit_hw*)jump->addr = (sljit_hw)(jump->u.label->addr - (jump->addr + sizeof(sljit_hw)));
-
364#endif -
365 }
executed: }
Execution Count:264
264
366 else { -
367#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
368 *(sljit_w*)jump->addr = (sljit_w)(jump->u.target - (jump->addr + sizeof(sljit_w))); -
369#else -
370 SLJIT_ASSERT((sljit_w)(jump->u.target - (jump->addr + sizeof(sljit_hw))) >= -0x80000000ll && (sljit_w)(jump->u.target - (jump->addr + sizeof(sljit_hw))) <= 0x7fffffffll);
executed: }
Execution Count:15
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
0-15
371 *(sljit_hw*)jump->addr = (sljit_hw)(jump->u.target - (jump->addr + sizeof(sljit_hw)));
executed (the execution status of this line is deduced): *(sljit_hw*)jump->addr = (sljit_hw)(jump->u.target - (jump->addr + sizeof(sljit_hw)));
-
372#endif -
373 }
executed: }
Execution Count:15
15
374 } -
375#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
376 else if (jump->flags & PATCH_MD)
never evaluated: jump->flags & 0x10
0
377 *(sljit_w*)jump->addr = jump->u.label->addr;
never executed: *(sljit_w*)jump->addr = jump->u.label->addr;
0
378#endif -
379 -
380 jump = jump->next;
executed (the execution status of this line is deduced): jump = jump->next;
-
381 }
executed: }
Execution Count:416
416
382 -
383 /* Maybe we waste some space because of short jumps. */ -
384 SLJIT_ASSERT(code_ptr <= code + compiler->size);
executed: }
Execution Count:15
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
0-15
385 compiler->error = SLJIT_ERR_COMPILED;
executed (the execution status of this line is deduced): compiler->error = 1;
-
386 compiler->executable_size = compiler->size;
executed (the execution status of this line is deduced): compiler->executable_size = compiler->size;
-
387 return (void*)code;
executed: return (void*)code;
Execution Count:15
15
388} -
389 -
390/* --------------------------------------------------------------------- */ -
391/* Operators */ -
392/* --------------------------------------------------------------------- */ -
393 -
394static int emit_cum_binary(struct sljit_compiler *compiler, -
395 sljit_ub op_rm, sljit_ub op_mr, sljit_ub op_imm, sljit_ub op_eax_imm, -
396 int dst, sljit_w dstw, -
397 int src1, sljit_w src1w, -
398 int src2, sljit_w src2w); -
399 -
400static int emit_non_cum_binary(struct sljit_compiler *compiler, -
401 sljit_ub op_rm, sljit_ub op_mr, sljit_ub op_imm, sljit_ub op_eax_imm, -
402 int dst, sljit_w dstw, -
403 int src1, sljit_w src1w, -
404 int src2, sljit_w src2w); -
405 -
406static int emit_mov(struct sljit_compiler *compiler, -
407 int dst, sljit_w dstw, -
408 int src, sljit_w srcw); -
409 -
410static SLJIT_INLINE int emit_save_flags(struct sljit_compiler *compiler) -
411{ -
412 sljit_ub *buf;
never executed (the execution status of this line is deduced): sljit_ub *buf;
-
413 -
414#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
415 buf = (sljit_ub*)ensure_buf(compiler, 1 + 5); -
416 FAIL_IF(!buf); -
417 INC_SIZE(5); -
418 *buf++ = 0x9c; /* pushfd */ -
419#else -
420 buf = (sljit_ub*)ensure_buf(compiler, 1 + 6);
never executed (the execution status of this line is deduced): buf = (sljit_ub*)ensure_buf(compiler, 1 + 6);
-
421 FAIL_IF(!buf);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!buf), 0)
never evaluated: 0
0
422 INC_SIZE(6);
never executed (the execution status of this line is deduced): (*buf++ = (6), compiler->size += (6));
-
423 *buf++ = 0x9c; /* pushfq */
never executed (the execution status of this line is deduced): *buf++ = 0x9c;
-
424 *buf++ = 0x48;
never executed (the execution status of this line is deduced): *buf++ = 0x48;
-
425#endif -
426 *buf++ = 0x8d; /* lea esp/rsp, [esp/rsp + sizeof(sljit_w)] */
never executed (the execution status of this line is deduced): *buf++ = 0x8d;
-
427 *buf++ = 0x64;
never executed (the execution status of this line is deduced): *buf++ = 0x64;
-
428 *buf++ = 0x24;
never executed (the execution status of this line is deduced): *buf++ = 0x24;
-
429 *buf++ = sizeof(sljit_w);
never executed (the execution status of this line is deduced): *buf++ = sizeof(sljit_w);
-
430 compiler->flags_saved = 1;
never executed (the execution status of this line is deduced): compiler->flags_saved = 1;
-
431 return SLJIT_SUCCESS;
never executed: return 0;
0
432} -
433 -
434static SLJIT_INLINE int emit_restore_flags(struct sljit_compiler *compiler, int keep_flags) -
435{ -
436 sljit_ub *buf;
never executed (the execution status of this line is deduced): sljit_ub *buf;
-
437 -
438#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
439 buf = (sljit_ub*)ensure_buf(compiler, 1 + 5); -
440 FAIL_IF(!buf); -
441 INC_SIZE(5); -
442#else -
443 buf = (sljit_ub*)ensure_buf(compiler, 1 + 6);
never executed (the execution status of this line is deduced): buf = (sljit_ub*)ensure_buf(compiler, 1 + 6);
-
444 FAIL_IF(!buf);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!buf), 0)
never evaluated: 0
0
445 INC_SIZE(6);
never executed (the execution status of this line is deduced): (*buf++ = (6), compiler->size += (6));
-
446 *buf++ = 0x48;
never executed (the execution status of this line is deduced): *buf++ = 0x48;
-
447#endif -
448 *buf++ = 0x8d; /* lea esp/rsp, [esp/rsp - sizeof(sljit_w)] */
never executed (the execution status of this line is deduced): *buf++ = 0x8d;
-
449 *buf++ = 0x64;
never executed (the execution status of this line is deduced): *buf++ = 0x64;
-
450 *buf++ = 0x24;
never executed (the execution status of this line is deduced): *buf++ = 0x24;
-
451 *buf++ = (sljit_ub)-(int)sizeof(sljit_w);
never executed (the execution status of this line is deduced): *buf++ = (sljit_ub)-(int)sizeof(sljit_w);
-
452 *buf++ = 0x9d; /* popfd / popfq */
never executed (the execution status of this line is deduced): *buf++ = 0x9d;
-
453 compiler->flags_saved = keep_flags;
never executed (the execution status of this line is deduced): compiler->flags_saved = keep_flags;
-
454 return SLJIT_SUCCESS;
never executed: return 0;
0
455} -
456 -
457#ifdef _WIN32 -
458#include <malloc.h> -
459 -
460static void SLJIT_CALL sljit_touch_stack(sljit_w local_size) -
461{ -
462 /* Workaround for calling _chkstk. */ -
463 alloca(local_size); -
464} -
465#endif -
466 -
467#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
468#include "sljitNativeX86_32.c" -
469#else -
470#include "sljitNativeX86_64.c" -
471#endif -
472 -
473static int emit_mov(struct sljit_compiler *compiler, -
474 int dst, sljit_w dstw, -
475 int src, sljit_w srcw) -
476{ -
477 sljit_ub* code;
executed (the execution status of this line is deduced): sljit_ub* code;
-
478 -
479 if (dst == SLJIT_UNUSED) {
partially evaluated: dst == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:634
0-634
480 /* No destination, doesn't need to setup flags. */ -
481 if (src & SLJIT_MEM) {
never evaluated: src & 0x100
0
482 code = emit_x86_instruction(compiler, 1, TMP_REGISTER, 0, src, srcw);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, (11 + 1), 0, src, srcw);
-
483 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
484 *code = 0x8b;
never executed (the execution status of this line is deduced): *code = 0x8b;
-
485 }
never executed: }
0
486 return SLJIT_SUCCESS;
never executed: return 0;
0
487 } -
488 if (src >= SLJIT_TEMPORARY_REG1 && src <= TMP_REGISTER) {
partially evaluated: src >= 1
TRUEFALSE
yes
Evaluation Count:634
no
Evaluation Count:0
evaluated: src <= (11 + 1)
TRUEFALSE
yes
Evaluation Count:228
yes
Evaluation Count:406
0-634
489 code = emit_x86_instruction(compiler, 1, src, 0, dst, dstw);
executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, src, 0, dst, dstw);
-
490 FAIL_IF(!code);
never executed: return compiler->error;
executed: }
Execution Count:228
partially evaluated: __builtin_expect((!code), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:228
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:228
0-228
491 *code = 0x89;
executed (the execution status of this line is deduced): *code = 0x89;
-
492 return SLJIT_SUCCESS;
executed: return 0;
Execution Count:228
228
493 } -
494 if (src & SLJIT_IMM) {
evaluated: src & 0x200
TRUEFALSE
yes
Evaluation Count:80
yes
Evaluation Count:326
80-326
495 if (dst >= SLJIT_TEMPORARY_REG1 && dst <= TMP_REGISTER) {
partially evaluated: dst >= 1
TRUEFALSE
yes
Evaluation Count:80
no
Evaluation Count:0
evaluated: dst <= (11 + 1)
TRUEFALSE
yes
Evaluation Count:69
yes
Evaluation Count:11
0-80
496#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
497 return emit_do_imm(compiler, 0xb8 + reg_map[dst], srcw); -
498#else -
499 if (!compiler->mode32) {
partially evaluated: !compiler->mode32
TRUEFALSE
yes
Evaluation Count:69
no
Evaluation Count:0
0-69
500 if (NOT_HALFWORD(srcw))
partially evaluated: (srcw) > 0x7fffffffll
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:69
partially evaluated: (srcw) < -0x80000000ll
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:69
0-69
501 return emit_load_imm64(compiler, dst, srcw);
never executed: return emit_load_imm64(compiler, dst, srcw);
0
502 }
executed: }
Execution Count:69
69
503 else -
504 return emit_do_imm32(compiler, (reg_map[dst] >= 8) ? REX_B : 0, 0xb8 + reg_lmap[dst], srcw);
never executed: return emit_do_imm32(compiler, (reg_map[dst] >= 8) ? 0x41 : 0, 0xb8 + reg_lmap[dst], srcw);
0
505#endif -
506 } -
507#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
508 if (!compiler->mode32 && NOT_HALFWORD(srcw)) {
partially evaluated: !compiler->mode32
TRUEFALSE
yes
Evaluation Count:80
no
Evaluation Count:0
partially evaluated: (srcw) > 0x7fffffffll
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:80
partially evaluated: (srcw) < -0x80000000ll
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:80
0-80
509 FAIL_IF(emit_load_imm64(compiler, TMP_REG2, srcw));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_load_imm64(compiler, (11 + 2), srcw)), 0)
never evaluated: 0
0
510 code = emit_x86_instruction(compiler, 1, TMP_REG2, 0, dst, dstw);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, (11 + 2), 0, dst, dstw);
-
511 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
512 *code = 0x89;
never executed (the execution status of this line is deduced): *code = 0x89;
-
513 return SLJIT_SUCCESS;
never executed: return 0;
0
514 } -
515#endif -
516 code = emit_x86_instruction(compiler, 1, SLJIT_IMM, srcw, dst, dstw);
executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, 0x200, srcw, dst, dstw);
-
517 FAIL_IF(!code);
never executed: return compiler->error;
executed: }
Execution Count:80
partially evaluated: __builtin_expect((!code), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:80
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:80
0-80
518 *code = 0xc7;
executed (the execution status of this line is deduced): *code = 0xc7;
-
519 return SLJIT_SUCCESS;
executed: return 0;
Execution Count:80
80
520 } -
521 if (dst >= SLJIT_TEMPORARY_REG1 && dst <= TMP_REGISTER) {
partially evaluated: dst >= 1
TRUEFALSE
yes
Evaluation Count:326
no
Evaluation Count:0
evaluated: dst <= (11 + 1)
TRUEFALSE
yes
Evaluation Count:311
yes
Evaluation Count:15
0-326
522 code = emit_x86_instruction(compiler, 1, dst, 0, src, srcw);
executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, dst, 0, src, srcw);
-
523 FAIL_IF(!code);
never executed: return compiler->error;
executed: }
Execution Count:311
partially evaluated: __builtin_expect((!code), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:311
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:311
0-311
524 *code = 0x8b;
executed (the execution status of this line is deduced): *code = 0x8b;
-
525 return SLJIT_SUCCESS;
executed: return 0;
Execution Count:311
311
526 } -
527 -
528 /* Memory to memory move. Requires two instruction. */ -
529 code = emit_x86_instruction(compiler, 1, TMP_REGISTER, 0, src, srcw);
executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, (11 + 1), 0, src, srcw);
-
530 FAIL_IF(!code);
never executed: return compiler->error;
executed: }
Execution Count:15
partially evaluated: __builtin_expect((!code), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
0-15
531 *code = 0x8b;
executed (the execution status of this line is deduced): *code = 0x8b;
-
532 code = emit_x86_instruction(compiler, 1, TMP_REGISTER, 0, dst, dstw);
executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, (11 + 1), 0, dst, dstw);
-
533 FAIL_IF(!code);
never executed: return compiler->error;
executed: }
Execution Count:15
partially evaluated: __builtin_expect((!code), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
0-15
534 *code = 0x89;
executed (the execution status of this line is deduced): *code = 0x89;
-
535 return SLJIT_SUCCESS;
executed: return 0;
Execution Count:15
15
536} -
537 -
538#define EMIT_MOV(compiler, dst, dstw, src, srcw) \ -
539 FAIL_IF(emit_mov(compiler, dst, dstw, src, srcw)); -
540 -
541SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_op0(struct sljit_compiler *compiler, int op) -
542{ -
543 sljit_ub *buf;
never executed (the execution status of this line is deduced): sljit_ub *buf;
-
544#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
545 int size;
never executed (the execution status of this line is deduced): int size;
-
546#endif -
547 -
548 CHECK_ERROR();
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((compiler->error), 0)
never evaluated: 0
0
549 check_sljit_emit_op0(compiler, op);
never executed (the execution status of this line is deduced): check_sljit_emit_op0(compiler, op);
-
550 -
551 switch (GET_OPCODE(op)) { -
552 case SLJIT_BREAKPOINT: -
553 buf = (sljit_ub*)ensure_buf(compiler, 1 + 1);
never executed (the execution status of this line is deduced): buf = (sljit_ub*)ensure_buf(compiler, 1 + 1);
-
554 FAIL_IF(!buf);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!buf), 0)
never evaluated: 0
0
555 INC_SIZE(1);
never executed (the execution status of this line is deduced): (*buf++ = (1), compiler->size += (1));
-
556 *buf = 0xcc;
never executed (the execution status of this line is deduced): *buf = 0xcc;
-
557 break;
never executed: break;
0
558 case SLJIT_NOP: -
559 buf = (sljit_ub*)ensure_buf(compiler, 1 + 1);
never executed (the execution status of this line is deduced): buf = (sljit_ub*)ensure_buf(compiler, 1 + 1);
-
560 FAIL_IF(!buf);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!buf), 0)
never evaluated: 0
0
561 INC_SIZE(1);
never executed (the execution status of this line is deduced): (*buf++ = (1), compiler->size += (1));
-
562 *buf = 0x90;
never executed (the execution status of this line is deduced): *buf = 0x90;
-
563 break;
never executed: break;
0
564 case SLJIT_UMUL: -
565 case SLJIT_SMUL: -
566 case SLJIT_UDIV: -
567 case SLJIT_SDIV: -
568 compiler->flags_saved = 0;
never executed (the execution status of this line is deduced): compiler->flags_saved = 0;
-
569#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
570#ifdef _WIN64 -
571 SLJIT_COMPILE_ASSERT( -
572 reg_map[SLJIT_TEMPORARY_REG1] == 0 -
573 && reg_map[SLJIT_TEMPORARY_REG2] == 2 -
574 && reg_map[TMP_REGISTER] > 7, -
575 invalid_register_assignment_for_div_mul); -
576#else -
577 SLJIT_COMPILE_ASSERT(
never executed: }
never evaluated: 0
0
578 reg_map[SLJIT_TEMPORARY_REG1] == 0 -
579 && reg_map[SLJIT_TEMPORARY_REG2] < 7 -
580 && reg_map[TMP_REGISTER] == 2, -
581 invalid_register_assignment_for_div_mul); -
582#endif -
583 compiler->mode32 = op & SLJIT_INT_OP;
never executed (the execution status of this line is deduced): compiler->mode32 = op & 0x100;
-
584#endif -
585 -
586 op = GET_OPCODE(op);
never executed (the execution status of this line is deduced): op = ((op) & ~(0x100 | 0x0200 | 0x0400 | 0x0800 | 0x1000 | 0x2000 | 0x4000));
-
587 if (op == SLJIT_UDIV) {
never evaluated: op == 4
0
588#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) || defined(_WIN64) -
589 EMIT_MOV(compiler, TMP_REGISTER, 0, SLJIT_TEMPORARY_REG2, 0); -
590 buf = emit_x86_instruction(compiler, 1, SLJIT_TEMPORARY_REG2, 0, SLJIT_TEMPORARY_REG2, 0); -
591#else -
592 buf = emit_x86_instruction(compiler, 1, TMP_REGISTER, 0, TMP_REGISTER, 0);
never executed (the execution status of this line is deduced): buf = emit_x86_instruction(compiler, 1, (11 + 1), 0, (11 + 1), 0);
-
593#endif -
594 FAIL_IF(!buf);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!buf), 0)
never evaluated: 0
0
595 *buf = 0x33;
never executed (the execution status of this line is deduced): *buf = 0x33;
-
596 }
never executed: }
0
597 -
598 if (op == SLJIT_SDIV) {
never evaluated: op == 5
0
599#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) || defined(_WIN64) -
600 EMIT_MOV(compiler, TMP_REGISTER, 0, SLJIT_TEMPORARY_REG2, 0); -
601#endif -
602 -
603 /* CDQ instruction */ -
604#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
605 buf = (sljit_ub*)ensure_buf(compiler, 1 + 1); -
606 FAIL_IF(!buf); -
607 INC_SIZE(1); -
608 *buf = 0x99; -
609#else -
610 if (compiler->mode32) {
never evaluated: compiler->mode32
0
611 buf = (sljit_ub*)ensure_buf(compiler, 1 + 1);
never executed (the execution status of this line is deduced): buf = (sljit_ub*)ensure_buf(compiler, 1 + 1);
-
612 FAIL_IF(!buf);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!buf), 0)
never evaluated: 0
0
613 INC_SIZE(1);
never executed (the execution status of this line is deduced): (*buf++ = (1), compiler->size += (1));
-
614 *buf = 0x99;
never executed (the execution status of this line is deduced): *buf = 0x99;
-
615 } else {
never executed: }
0
616 buf = (sljit_ub*)ensure_buf(compiler, 1 + 2);
never executed (the execution status of this line is deduced): buf = (sljit_ub*)ensure_buf(compiler, 1 + 2);
-
617 FAIL_IF(!buf);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!buf), 0)
never evaluated: 0
0
618 INC_SIZE(2);
never executed (the execution status of this line is deduced): (*buf++ = (2), compiler->size += (2));
-
619 *buf++ = REX_W;
never executed (the execution status of this line is deduced): *buf++ = 0x48;
-
620 *buf = 0x99;
never executed (the execution status of this line is deduced): *buf = 0x99;
-
621 }
never executed: }
0
622#endif -
623 } -
624 -
625#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
626 buf = (sljit_ub*)ensure_buf(compiler, 1 + 2); -
627 FAIL_IF(!buf); -
628 INC_SIZE(2); -
629 *buf++ = 0xf7; -
630 *buf = 0xc0 | ((op >= SLJIT_UDIV) ? reg_map[TMP_REGISTER] : reg_map[SLJIT_TEMPORARY_REG2]); -
631#else -
632#ifdef _WIN64 -
633 size = (!compiler->mode32 || op >= SLJIT_UDIV) ? 3 : 2; -
634#else -
635 size = (!compiler->mode32) ? 3 : 2;
never evaluated: (!compiler->mode32)
0
636#endif -
637 buf = (sljit_ub*)ensure_buf(compiler, 1 + size);
never executed (the execution status of this line is deduced): buf = (sljit_ub*)ensure_buf(compiler, 1 + size);
-
638 FAIL_IF(!buf);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!buf), 0)
never evaluated: 0
0
639 INC_SIZE(size);
never executed (the execution status of this line is deduced): (*buf++ = (size), compiler->size += (size));
-
640#ifdef _WIN64 -
641 if (!compiler->mode32) -
642 *buf++ = REX_W | ((op >= SLJIT_UDIV) ? REX_B : 0); -
643 else if (op >= SLJIT_UDIV) -
644 *buf++ = REX_B; -
645 *buf++ = 0xf7; -
646 *buf = 0xc0 | ((op >= SLJIT_UDIV) ? reg_lmap[TMP_REGISTER] : reg_lmap[SLJIT_TEMPORARY_REG2]); -
647#else -
648 if (!compiler->mode32)
never evaluated: !compiler->mode32
0
649 *buf++ = REX_W;
never executed: *buf++ = 0x48;
0
650 *buf++ = 0xf7;
never executed (the execution status of this line is deduced): *buf++ = 0xf7;
-
651 *buf = 0xc0 | reg_map[SLJIT_TEMPORARY_REG2];
never executed (the execution status of this line is deduced): *buf = 0xc0 | reg_map[2];
-
652#endif -
653#endif -
654 switch (op) { -
655 case SLJIT_UMUL: -
656 *buf |= 4 << 3;
never executed (the execution status of this line is deduced): *buf |= 4 << 3;
-
657 break;
never executed: break;
0
658 case SLJIT_SMUL: -
659 *buf |= 5 << 3;
never executed (the execution status of this line is deduced): *buf |= 5 << 3;
-
660 break;
never executed: break;
0
661 case SLJIT_UDIV: -
662 *buf |= 6 << 3;
never executed (the execution status of this line is deduced): *buf |= 6 << 3;
-
663 break;
never executed: break;
0
664 case SLJIT_SDIV: -
665 *buf |= 7 << 3;
never executed (the execution status of this line is deduced): *buf |= 7 << 3;
-
666 break;
never executed: break;
0
667 } -
668#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) && !defined(_WIN64) -
669 EMIT_MOV(compiler, SLJIT_TEMPORARY_REG2, 0, TMP_REGISTER, 0);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, 2, 0, (11 + 1), 0)), 0)
never evaluated: 0
0
670#endif -
671 break;
never executed: break;
0
672 } -
673 -
674 return SLJIT_SUCCESS;
never executed: return 0;
0
675} -
676 -
677#define ENCODE_PREFIX(prefix) \ -
678 do { \ -
679 code = (sljit_ub*)ensure_buf(compiler, 1 + 1); \ -
680 FAIL_IF(!code); \ -
681 INC_CSIZE(1); \ -
682 *code = (prefix); \ -
683 } while (0) -
684 -
685static int emit_mov_byte(struct sljit_compiler *compiler, int sign, -
686 int dst, sljit_w dstw, -
687 int src, sljit_w srcw) -
688{ -
689 sljit_ub* code;
executed (the execution status of this line is deduced): sljit_ub* code;
-
690 int dst_r;
executed (the execution status of this line is deduced): int dst_r;
-
691#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
692 int work_r; -
693#endif -
694 -
695#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
696 compiler->mode32 = 0;
executed (the execution status of this line is deduced): compiler->mode32 = 0;
-
697#endif -
698 -
699 if (dst == SLJIT_UNUSED && !(src & SLJIT_MEM))
partially evaluated: dst == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:32
never evaluated: !(src & 0x100)
0-32
700 return SLJIT_SUCCESS; /* Empty instruction. */
never executed: return 0;
0
701 -
702 if (src & SLJIT_IMM) {
partially evaluated: src & 0x200
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:32
0-32
703 if (dst >= SLJIT_TEMPORARY_REG1 && dst <= TMP_REGISTER) {
never evaluated: dst >= 1
never evaluated: dst <= (11 + 1)
0
704#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
705 return emit_do_imm(compiler, 0xb8 + reg_map[dst], srcw); -
706#else -
707 return emit_load_imm64(compiler, dst, srcw);
never executed: return emit_load_imm64(compiler, dst, srcw);
0
708#endif -
709 } -
710 code = emit_x86_instruction(compiler, 1 | EX86_BYTE_ARG | EX86_NO_REXW, SLJIT_IMM, srcw, dst, dstw);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1 | 0x0100 | 0x0080, 0x200, srcw, dst, dstw);
-
711 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
712 *code = 0xc6;
never executed (the execution status of this line is deduced): *code = 0xc6;
-
713 return SLJIT_SUCCESS;
never executed: return 0;
0
714 } -
715 -
716 dst_r = (dst >= SLJIT_TEMPORARY_REG1 && dst <= TMP_REGISTER) ? dst : TMP_REGISTER;
partially evaluated: dst >= 1
TRUEFALSE
yes
Evaluation Count:32
no
Evaluation Count:0
partially evaluated: dst <= (11 + 1)
TRUEFALSE
yes
Evaluation Count:32
no
Evaluation Count:0
0-32
717 -
718 if ((dst & SLJIT_MEM) && src >= SLJIT_TEMPORARY_REG1 && src <= SLJIT_NO_REGISTERS) {
partially evaluated: (dst & 0x100)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:32
never evaluated: src >= 1
never evaluated: src <= 11
0-32
719#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
720 if (reg_map[src] >= 4) { -
721 SLJIT_ASSERT(dst_r == TMP_REGISTER); -
722 EMIT_MOV(compiler, TMP_REGISTER, 0, src, 0); -
723 } else -
724 dst_r = src; -
725#else -
726 dst_r = src;
never executed (the execution status of this line is deduced): dst_r = src;
-
727#endif -
728 }
never executed: }
0
729#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
730 else if (src >= SLJIT_TEMPORARY_REG1 && src <= SLJIT_NO_REGISTERS && reg_map[src] >= 4) { -
731 /* src, dst are registers. */ -
732 SLJIT_ASSERT(dst >= SLJIT_TEMPORARY_REG1 && dst <= TMP_REGISTER); -
733 if (reg_map[dst] < 4) { -
734 if (dst != src) -
735 EMIT_MOV(compiler, dst, 0, src, 0); -
736 code = emit_x86_instruction(compiler, 2, dst, 0, dst, 0); -
737 FAIL_IF(!code); -
738 *code++ = 0x0f; -
739 *code = sign ? 0xbe : 0xb6; -
740 } -
741 else { -
742 if (dst != src) -
743 EMIT_MOV(compiler, dst, 0, src, 0); -
744 if (sign) { -
745 /* shl reg, 24 */ -
746 code = emit_x86_instruction(compiler, 1 | EX86_SHIFT_INS, SLJIT_IMM, 24, dst, 0); -
747 FAIL_IF(!code); -
748 *code |= 0x4 << 3; -
749 code = emit_x86_instruction(compiler, 1 | EX86_SHIFT_INS, SLJIT_IMM, 24, dst, 0); -
750 FAIL_IF(!code); -
751 /* shr/sar reg, 24 */ -
752 *code |= 0x7 << 3; -
753 } -
754 else { -
755 /* and dst, 0xff */ -
756 code = emit_x86_instruction(compiler, 1 | EX86_BIN_INS, SLJIT_IMM, 255, dst, 0); -
757 FAIL_IF(!code); -
758 *(code + 1) |= 0x4 << 3; -
759 } -
760 } -
761 return SLJIT_SUCCESS; -
762 } -
763#endif -
764 else { -
765 /* src can be memory addr or reg_map[src] < 4 on x86_32 architectures. */ -
766 code = emit_x86_instruction(compiler, 2, dst_r, 0, src, srcw);
executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 2, dst_r, 0, src, srcw);
-
767 FAIL_IF(!code);
never executed: return compiler->error;
executed: }
Execution Count:32
partially evaluated: __builtin_expect((!code), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:32
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:32
0-32
768 *code++ = 0x0f;
executed (the execution status of this line is deduced): *code++ = 0x0f;
-
769 *code = sign ? 0xbe : 0xb6;
partially evaluated: sign
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:32
0-32
770 }
executed: }
Execution Count:32
32
771 -
772 if (dst & SLJIT_MEM) {
partially evaluated: dst & 0x100
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:32
0-32
773#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
774 if (dst_r == TMP_REGISTER) { -
775 /* Find a non-used register, whose reg_map[src] < 4. */ -
776 if ((dst & 0xf) == SLJIT_TEMPORARY_REG1) { -
777 if ((dst & 0xf0) == (SLJIT_TEMPORARY_REG2 << 4)) -
778 work_r = SLJIT_TEMPORARY_REG3; -
779 else -
780 work_r = SLJIT_TEMPORARY_REG2; -
781 } -
782 else { -
783 if ((dst & 0xf0) != (SLJIT_TEMPORARY_REG1 << 4)) -
784 work_r = SLJIT_TEMPORARY_REG1; -
785 else if ((dst & 0xf) == SLJIT_TEMPORARY_REG2) -
786 work_r = SLJIT_TEMPORARY_REG3; -
787 else -
788 work_r = SLJIT_TEMPORARY_REG2; -
789 } -
790 -
791 if (work_r == SLJIT_TEMPORARY_REG1) { -
792 ENCODE_PREFIX(0x90 + reg_map[TMP_REGISTER]); -
793 } -
794 else { -
795 code = emit_x86_instruction(compiler, 1, work_r, 0, dst_r, 0); -
796 FAIL_IF(!code); -
797 *code = 0x87; -
798 } -
799 -
800 code = emit_x86_instruction(compiler, 1, work_r, 0, dst, dstw); -
801 FAIL_IF(!code); -
802 *code = 0x88; -
803 -
804 if (work_r == SLJIT_TEMPORARY_REG1) { -
805 ENCODE_PREFIX(0x90 + reg_map[TMP_REGISTER]); -
806 } -
807 else { -
808 code = emit_x86_instruction(compiler, 1, work_r, 0, dst_r, 0); -
809 FAIL_IF(!code); -
810 *code = 0x87; -
811 } -
812 } -
813 else { -
814 code = emit_x86_instruction(compiler, 1, dst_r, 0, dst, dstw); -
815 FAIL_IF(!code); -
816 *code = 0x88; -
817 } -
818#else -
819 code = emit_x86_instruction(compiler, 1 | EX86_REX | EX86_NO_REXW, dst_r, 0, dst, dstw);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1 | 0x0040 | 0x0080, dst_r, 0, dst, dstw);
-
820 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
821 *code = 0x88;
never executed (the execution status of this line is deduced): *code = 0x88;
-
822#endif -
823 }
never executed: }
0
824 -
825 return SLJIT_SUCCESS;
executed: return 0;
Execution Count:32
32
826} -
827 -
828static int emit_mov_half(struct sljit_compiler *compiler, int sign, -
829 int dst, sljit_w dstw, -
830 int src, sljit_w srcw) -
831{ -
832 sljit_ub* code;
executed (the execution status of this line is deduced): sljit_ub* code;
-
833 int dst_r;
executed (the execution status of this line is deduced): int dst_r;
-
834 -
835#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
836 compiler->mode32 = 0;
executed (the execution status of this line is deduced): compiler->mode32 = 0;
-
837#endif -
838 -
839 if (dst == SLJIT_UNUSED && !(src & SLJIT_MEM))
partially evaluated: dst == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:70
never evaluated: !(src & 0x100)
0-70
840 return SLJIT_SUCCESS; /* Empty instruction. */
never executed: return 0;
0
841 -
842 if (src & SLJIT_IMM) {
partially evaluated: src & 0x200
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:70
0-70
843 if (dst >= SLJIT_TEMPORARY_REG1 && dst <= TMP_REGISTER) {
never evaluated: dst >= 1
never evaluated: dst <= (11 + 1)
0
844#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
845 return emit_do_imm(compiler, 0xb8 + reg_map[dst], srcw); -
846#else -
847 return emit_load_imm64(compiler, dst, srcw);
never executed: return emit_load_imm64(compiler, dst, srcw);
0
848#endif -
849 } -
850 code = emit_x86_instruction(compiler, 1 | EX86_HALF_ARG | EX86_NO_REXW | EX86_PREF_66, SLJIT_IMM, srcw, dst, dstw);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1 | 0x0200 | 0x0080 | 0x0400, 0x200, srcw, dst, dstw);
-
851 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
852 *code = 0xc7;
never executed (the execution status of this line is deduced): *code = 0xc7;
-
853 return SLJIT_SUCCESS;
never executed: return 0;
0
854 } -
855 -
856 dst_r = (dst >= SLJIT_TEMPORARY_REG1 && dst <= TMP_REGISTER) ? dst : TMP_REGISTER;
partially evaluated: dst >= 1
TRUEFALSE
yes
Evaluation Count:70
no
Evaluation Count:0
partially evaluated: dst <= (11 + 1)
TRUEFALSE
yes
Evaluation Count:70
no
Evaluation Count:0
0-70
857 -
858 if ((dst & SLJIT_MEM) && (src >= SLJIT_TEMPORARY_REG1 && src <= SLJIT_NO_REGISTERS))
partially evaluated: (dst & 0x100)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:70
never evaluated: src >= 1
never evaluated: src <= 11
0-70
859 dst_r = src;
never executed: dst_r = src;
0
860 else { -
861 code = emit_x86_instruction(compiler, 2, dst_r, 0, src, srcw);
executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 2, dst_r, 0, src, srcw);
-
862 FAIL_IF(!code);
never executed: return compiler->error;
executed: }
Execution Count:70
partially evaluated: __builtin_expect((!code), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:70
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:70
0-70
863 *code++ = 0x0f;
executed (the execution status of this line is deduced): *code++ = 0x0f;
-
864 *code = sign ? 0xbf : 0xb7;
partially evaluated: sign
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:70
0-70
865 }
executed: }
Execution Count:70
70
866 -
867 if (dst & SLJIT_MEM) {
partially evaluated: dst & 0x100
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:70
0-70
868 code = emit_x86_instruction(compiler, 1 | EX86_NO_REXW | EX86_PREF_66, dst_r, 0, dst, dstw);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1 | 0x0080 | 0x0400, dst_r, 0, dst, dstw);
-
869 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
870 *code = 0x89;
never executed (the execution status of this line is deduced): *code = 0x89;
-
871 }
never executed: }
0
872 -
873 return SLJIT_SUCCESS;
executed: return 0;
Execution Count:70
70
874} -
875 -
876static int emit_unary(struct sljit_compiler *compiler, int un_index, -
877 int dst, sljit_w dstw, -
878 int src, sljit_w srcw) -
879{ -
880 sljit_ub* code;
never executed (the execution status of this line is deduced): sljit_ub* code;
-
881 -
882 if (dst == SLJIT_UNUSED) {
never evaluated: dst == 0
0
883 EMIT_MOV(compiler, TMP_REGISTER, 0, src, srcw);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, (11 + 1), 0, src, srcw)), 0)
never evaluated: 0
0
884 code = emit_x86_instruction(compiler, 1, 0, 0, TMP_REGISTER, 0);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, 0, 0, (11 + 1), 0);
-
885 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
886 *code++ = 0xf7;
never executed (the execution status of this line is deduced): *code++ = 0xf7;
-
887 *code |= (un_index) << 3;
never executed (the execution status of this line is deduced): *code |= (un_index) << 3;
-
888 return SLJIT_SUCCESS;
never executed: return 0;
0
889 } -
890 if (dst == src && dstw == srcw) {
never evaluated: dst == src
never evaluated: dstw == srcw
0
891 /* Same input and output */ -
892 code = emit_x86_instruction(compiler, 1, 0, 0, dst, dstw);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, 0, 0, dst, dstw);
-
893 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
894 *code++ = 0xf7;
never executed (the execution status of this line is deduced): *code++ = 0xf7;
-
895 *code |= (un_index) << 3;
never executed (the execution status of this line is deduced): *code |= (un_index) << 3;
-
896 return SLJIT_SUCCESS;
never executed: return 0;
0
897 } -
898 if (dst >= SLJIT_TEMPORARY_REG1 && dst <= SLJIT_NO_REGISTERS) {
never evaluated: dst >= 1
never evaluated: dst <= 11
0
899 EMIT_MOV(compiler, dst, 0, src, srcw);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, dst, 0, src, srcw)), 0)
never evaluated: 0
0
900 code = emit_x86_instruction(compiler, 1, 0, 0, dst, dstw);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, 0, 0, dst, dstw);
-
901 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
902 *code++ = 0xf7;
never executed (the execution status of this line is deduced): *code++ = 0xf7;
-
903 *code |= (un_index) << 3;
never executed (the execution status of this line is deduced): *code |= (un_index) << 3;
-
904 return SLJIT_SUCCESS;
never executed: return 0;
0
905 } -
906 EMIT_MOV(compiler, TMP_REGISTER, 0, src, srcw);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, (11 + 1), 0, src, srcw)), 0)
never evaluated: 0
0
907 code = emit_x86_instruction(compiler, 1, 0, 0, TMP_REGISTER, 0);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, 0, 0, (11 + 1), 0);
-
908 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
909 *code++ = 0xf7;
never executed (the execution status of this line is deduced): *code++ = 0xf7;
-
910 *code |= (un_index) << 3;
never executed (the execution status of this line is deduced): *code |= (un_index) << 3;
-
911 EMIT_MOV(compiler, dst, dstw, TMP_REGISTER, 0);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, dst, dstw, (11 + 1), 0)), 0)
never evaluated: 0
0
912 return SLJIT_SUCCESS;
never executed: return 0;
0
913} -
914 -
915static int emit_not_with_flags(struct sljit_compiler *compiler, -
916 int dst, sljit_w dstw, -
917 int src, sljit_w srcw) -
918{ -
919 sljit_ub* code;
never executed (the execution status of this line is deduced): sljit_ub* code;
-
920 -
921 if (dst == SLJIT_UNUSED) {
never evaluated: dst == 0
0
922 EMIT_MOV(compiler, TMP_REGISTER, 0, src, srcw);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, (11 + 1), 0, src, srcw)), 0)
never evaluated: 0
0
923 code = emit_x86_instruction(compiler, 1, 0, 0, TMP_REGISTER, 0);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, 0, 0, (11 + 1), 0);
-
924 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
925 *code++ = 0xf7;
never executed (the execution status of this line is deduced): *code++ = 0xf7;
-
926 *code |= 0x2 << 3;
never executed (the execution status of this line is deduced): *code |= 0x2 << 3;
-
927 code = emit_x86_instruction(compiler, 1, TMP_REGISTER, 0, TMP_REGISTER, 0);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, (11 + 1), 0, (11 + 1), 0);
-
928 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
929 *code = 0x0b;
never executed (the execution status of this line is deduced): *code = 0x0b;
-
930 return SLJIT_SUCCESS;
never executed: return 0;
0
931 } -
932 if (dst >= SLJIT_TEMPORARY_REG1 && dst <= SLJIT_NO_REGISTERS) {
never evaluated: dst >= 1
never evaluated: dst <= 11
0
933 EMIT_MOV(compiler, dst, 0, src, srcw);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, dst, 0, src, srcw)), 0)
never evaluated: 0
0
934 code = emit_x86_instruction(compiler, 1, 0, 0, dst, dstw);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, 0, 0, dst, dstw);
-
935 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
936 *code++ = 0xf7;
never executed (the execution status of this line is deduced): *code++ = 0xf7;
-
937 *code |= 0x2 << 3;
never executed (the execution status of this line is deduced): *code |= 0x2 << 3;
-
938 code = emit_x86_instruction(compiler, 1, dst, 0, dst, 0);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, dst, 0, dst, 0);
-
939 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
940 *code = 0x0b;
never executed (the execution status of this line is deduced): *code = 0x0b;
-
941 return SLJIT_SUCCESS;
never executed: return 0;
0
942 } -
943 EMIT_MOV(compiler, TMP_REGISTER, 0, src, srcw);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, (11 + 1), 0, src, srcw)), 0)
never evaluated: 0
0
944 code = emit_x86_instruction(compiler, 1, 0, 0, TMP_REGISTER, 0);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, 0, 0, (11 + 1), 0);
-
945 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
946 *code++ = 0xf7;
never executed (the execution status of this line is deduced): *code++ = 0xf7;
-
947 *code |= 0x2 << 3;
never executed (the execution status of this line is deduced): *code |= 0x2 << 3;
-
948 code = emit_x86_instruction(compiler, 1, TMP_REGISTER, 0, TMP_REGISTER, 0);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, (11 + 1), 0, (11 + 1), 0);
-
949 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
950 *code = 0x0b;
never executed (the execution status of this line is deduced): *code = 0x0b;
-
951 EMIT_MOV(compiler, dst, dstw, TMP_REGISTER, 0);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, dst, dstw, (11 + 1), 0)), 0)
never evaluated: 0
0
952 return SLJIT_SUCCESS;
never executed: return 0;
0
953} -
954 -
955static int emit_clz(struct sljit_compiler *compiler, int op, -
956 int dst, sljit_w dstw, -
957 int src, sljit_w srcw) -
958{ -
959 sljit_ub* code;
never executed (the execution status of this line is deduced): sljit_ub* code;
-
960 int dst_r;
never executed (the execution status of this line is deduced): int dst_r;
-
961 -
962 SLJIT_UNUSED_ARG(op);
never executed (the execution status of this line is deduced): (void)op;
-
963 if (SLJIT_UNLIKELY(dst == SLJIT_UNUSED)) {
never evaluated: __builtin_expect((dst == 0), 0)
0
964 /* Just set the zero flag. */ -
965 EMIT_MOV(compiler, TMP_REGISTER, 0, src, srcw);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, (11 + 1), 0, src, srcw)), 0)
never evaluated: 0
0
966 code = emit_x86_instruction(compiler, 1, 0, 0, TMP_REGISTER, 0);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, 0, 0, (11 + 1), 0);
-
967 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
968 *code++ = 0xf7;
never executed (the execution status of this line is deduced): *code++ = 0xf7;
-
969 *code |= 0x2 << 3;
never executed (the execution status of this line is deduced): *code |= 0x2 << 3;
-
970#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
971 code = emit_x86_instruction(compiler, 1 | EX86_SHIFT_INS, SLJIT_IMM, 31, TMP_REGISTER, 0); -
972#else -
973 code = emit_x86_instruction(compiler, 1 | EX86_SHIFT_INS, SLJIT_IMM, !(op & SLJIT_INT_OP) ? 63 : 31, TMP_REGISTER, 0);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1 | 0x0020, 0x200, !(op & 0x100) ? 63 : 31, (11 + 1), 0);
-
974#endif -
975 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
976 *code |= 0x5 << 3;
never executed (the execution status of this line is deduced): *code |= 0x5 << 3;
-
977 return SLJIT_SUCCESS;
never executed: return 0;
0
978 } -
979 -
980 if (SLJIT_UNLIKELY(src & SLJIT_IMM)) {
never evaluated: __builtin_expect((src & 0x200), 0)
0
981 EMIT_MOV(compiler, TMP_REGISTER, 0, src, srcw);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, (11 + 1), 0, src, srcw)), 0)
never evaluated: 0
0
982 src = TMP_REGISTER;
never executed (the execution status of this line is deduced): src = (11 + 1);
-
983 srcw = 0;
never executed (the execution status of this line is deduced): srcw = 0;
-
984 }
never executed: }
0
985 -
986 code = emit_x86_instruction(compiler, 2, TMP_REGISTER, 0, src, srcw);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 2, (11 + 1), 0, src, srcw);
-
987 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
988 *code++ = 0x0f;
never executed (the execution status of this line is deduced): *code++ = 0x0f;
-
989 *code = 0xbd;
never executed (the execution status of this line is deduced): *code = 0xbd;
-
990 -
991#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
992 if (dst >= SLJIT_TEMPORARY_REG1 && dst <= TMP_REGISTER) -
993 dst_r = dst; -
994 else { -
995 /* Find an unused temporary register. */ -
996 if ((dst & 0xf) != SLJIT_TEMPORARY_REG1 && (dst & 0xf0) != (SLJIT_TEMPORARY_REG1 << 4)) -
997 dst_r = SLJIT_TEMPORARY_REG1; -
998 else if ((dst & 0xf) != SLJIT_TEMPORARY_REG2 && (dst & 0xf0) != (SLJIT_TEMPORARY_REG2 << 4)) -
999 dst_r = SLJIT_TEMPORARY_REG2; -
1000 else -
1001 dst_r = SLJIT_TEMPORARY_REG3; -
1002 EMIT_MOV(compiler, dst, dstw, dst_r, 0); -
1003 } -
1004 EMIT_MOV(compiler, dst_r, 0, SLJIT_IMM, 32 + 31); -
1005#else -
1006 dst_r = (dst >= SLJIT_TEMPORARY_REG1 && dst <= TMP_REGISTER) ? dst : TMP_REG2;
never evaluated: dst >= 1
never evaluated: dst <= (11 + 1)
0
1007 compiler->mode32 = 0;
never executed (the execution status of this line is deduced): compiler->mode32 = 0;
-
1008 EMIT_MOV(compiler, dst_r, 0, SLJIT_IMM, !(op & SLJIT_INT_OP) ? 64 + 63 : 32 + 31);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, dst_r, 0, 0x200, !(op & 0x100) ? 64 + 63 : 32 + 31)), 0)
never evaluated: 0
0
1009 compiler->mode32 = op & SLJIT_INT_OP;
never executed (the execution status of this line is deduced): compiler->mode32 = op & 0x100;
-
1010#endif -
1011 -
1012 code = emit_x86_instruction(compiler, 2, dst_r, 0, TMP_REGISTER, 0);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 2, dst_r, 0, (11 + 1), 0);
-
1013 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1014 *code++ = 0x0f;
never executed (the execution status of this line is deduced): *code++ = 0x0f;
-
1015 *code = 0x45;
never executed (the execution status of this line is deduced): *code = 0x45;
-
1016 -
1017#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
1018 code = emit_x86_instruction(compiler, 1 | EX86_BIN_INS, SLJIT_IMM, 31, dst_r, 0); -
1019#else -
1020 code = emit_x86_instruction(compiler, 1 | EX86_BIN_INS, SLJIT_IMM, !(op & SLJIT_INT_OP) ? 63 : 31, dst_r, 0);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1 | 0x0010, 0x200, !(op & 0x100) ? 63 : 31, dst_r, 0);
-
1021#endif -
1022 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1023 *(code + 1) |= 0x6 << 3;
never executed (the execution status of this line is deduced): *(code + 1) |= 0x6 << 3;
-
1024 -
1025#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
1026 if (dst & SLJIT_MEM) { -
1027 code = emit_x86_instruction(compiler, 1, dst_r, 0, dst, dstw); -
1028 FAIL_IF(!code); -
1029 *code = 0x87; -
1030 } -
1031#else -
1032 if (dst & SLJIT_MEM)
never evaluated: dst & 0x100
0
1033 EMIT_MOV(compiler, dst, dstw, TMP_REG2, 0);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, dst, dstw, (11 + 2), 0)), 0)
never evaluated: 0
0
1034#endif -
1035 return SLJIT_SUCCESS;
never executed: return 0;
0
1036} -
1037 -
1038SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_op1(struct sljit_compiler *compiler, int op, -
1039 int dst, sljit_w dstw, -
1040 int src, sljit_w srcw) -
1041{ -
1042 sljit_ub* code;
executed (the execution status of this line is deduced): sljit_ub* code;
-
1043 int update = 0;
executed (the execution status of this line is deduced): int update = 0;
-
1044#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
1045 int dst_is_ereg = 0; -
1046 int src_is_ereg = 0; -
1047#else -
1048 #define src_is_ereg 0 -
1049#endif -
1050 -
1051 CHECK_ERROR();
never executed: return compiler->error;
executed: }
Execution Count:720
partially evaluated: __builtin_expect((compiler->error), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:720
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:720
0-720
1052 check_sljit_emit_op1(compiler, op, dst, dstw, src, srcw);
executed (the execution status of this line is deduced): check_sljit_emit_op1(compiler, op, dst, dstw, src, srcw);
-
1053 -
1054#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
1055 compiler->mode32 = op & SLJIT_INT_OP;
executed (the execution status of this line is deduced): compiler->mode32 = op & 0x100;
-
1056#endif -
1057 CHECK_EXTRA_REGS(dst, dstw, dst_is_ereg = 1); -
1058 CHECK_EXTRA_REGS(src, srcw, src_is_ereg = 1); -
1059 -
1060 if (GET_OPCODE(op) >= SLJIT_MOV && GET_OPCODE(op) <= SLJIT_MOVU_SI) {
partially evaluated: ((op) & ~(0x100 | 0x0200 | 0x0400 | 0x0800 | 0x1000 | 0x2000 | 0x4000)) >= 6
TRUEFALSE
yes
Evaluation Count:720
no
Evaluation Count:0
partially evaluated: ((op) & ~(0x100 | 0x0200 | 0x0400 | 0x0800 | 0x1000 | 0x2000 | 0x4000)) <= 19
TRUEFALSE
yes
Evaluation Count:720
no
Evaluation Count:0
0-720
1061 op = GET_OPCODE(op);
executed (the execution status of this line is deduced): op = ((op) & ~(0x100 | 0x0200 | 0x0400 | 0x0800 | 0x1000 | 0x2000 | 0x4000));
-
1062#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
1063 compiler->mode32 = 0;
executed (the execution status of this line is deduced): compiler->mode32 = 0;
-
1064#endif -
1065 -
1066 SLJIT_COMPILE_ASSERT(SLJIT_MOV + 7 == SLJIT_MOVU, movu_offset);
executed: }
Execution Count:720
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:720
0-720
1067 if (op >= SLJIT_MOVU) {
evaluated: op >= 13
TRUEFALSE
yes
Evaluation Count:15
yes
Evaluation Count:705
15-705
1068 update = 1;
executed (the execution status of this line is deduced): update = 1;
-
1069 op -= 7;
executed (the execution status of this line is deduced): op -= 7;
-
1070 }
executed: }
Execution Count:15
15
1071 -
1072 if (src & SLJIT_IMM) {
evaluated: src & 0x200
TRUEFALSE
yes
Evaluation Count:80
yes
Evaluation Count:640
80-640
1073 switch (op) { -
1074 case SLJIT_MOV_UB: -
1075 srcw = (unsigned char)srcw;
never executed (the execution status of this line is deduced): srcw = (unsigned char)srcw;
-
1076 break;
never executed: break;
0
1077 case SLJIT_MOV_SB: -
1078 srcw = (signed char)srcw;
never executed (the execution status of this line is deduced): srcw = (signed char)srcw;
-
1079 break;
never executed: break;
0
1080 case SLJIT_MOV_UH: -
1081 srcw = (unsigned short)srcw;
never executed (the execution status of this line is deduced): srcw = (unsigned short)srcw;
-
1082 break;
never executed: break;
0
1083 case SLJIT_MOV_SH: -
1084 srcw = (signed short)srcw;
never executed (the execution status of this line is deduced): srcw = (signed short)srcw;
-
1085 break;
never executed: break;
0
1086#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
1087 case SLJIT_MOV_UI: -
1088 srcw = (unsigned int)srcw;
never executed (the execution status of this line is deduced): srcw = (unsigned int)srcw;
-
1089 break;
never executed: break;
0
1090 case SLJIT_MOV_SI: -
1091 srcw = (signed int)srcw;
never executed (the execution status of this line is deduced): srcw = (signed int)srcw;
-
1092 break;
never executed: break;
0
1093#endif -
1094 } -
1095#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
1096 if (SLJIT_UNLIKELY(dst_is_ereg)) -
1097 return emit_mov(compiler, dst, dstw, src, srcw); -
1098#endif -
1099 }
executed: }
Execution Count:80
80
1100 -
1101 if (SLJIT_UNLIKELY(update) && (src & SLJIT_MEM) && !src_is_ereg && (src & 0xf) && (srcw != 0 || (src & 0xf0) != 0)) {
evaluated: __builtin_expect((update), 0)
TRUEFALSE
yes
Evaluation Count:15
yes
Evaluation Count:705
partially evaluated: (src & 0x100)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
never evaluated: !0
never evaluated: (src & 0xf)
never evaluated: srcw != 0
never evaluated: (src & 0xf0) != 0
0-705
1102 code = emit_x86_instruction(compiler, 1, src & 0xf, 0, src, srcw);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, src & 0xf, 0, src, srcw);
-
1103 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1104 *code = 0x8d;
never executed (the execution status of this line is deduced): *code = 0x8d;
-
1105 src &= SLJIT_MEM | 0xf;
never executed (the execution status of this line is deduced): src &= 0x100 | 0xf;
-
1106 srcw = 0;
never executed (the execution status of this line is deduced): srcw = 0;
-
1107 }
never executed: }
0
1108 -
1109#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
1110 if (SLJIT_UNLIKELY(dst_is_ereg) && (!(op == SLJIT_MOV || op == SLJIT_MOV_UI || op == SLJIT_MOV_SI) || (src & SLJIT_MEM))) { -
1111 SLJIT_ASSERT(dst == SLJIT_MEM1(SLJIT_LOCALS_REG)); -
1112 dst = TMP_REGISTER; -
1113 } -
1114#endif -
1115 -
1116 switch (op) { -
1117 case SLJIT_MOV: -
1118#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
1119 case SLJIT_MOV_UI: -
1120 case SLJIT_MOV_SI: -
1121#endif -
1122 FAIL_IF(emit_mov(compiler, dst, dstw, src, srcw));
never executed: return compiler->error;
executed: }
Execution Count:573
partially evaluated: __builtin_expect((emit_mov(compiler, dst, dstw, src, srcw)), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:573
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:573
0-573
1123 break;
executed: break;
Execution Count:573
573
1124 case SLJIT_MOV_UB: -
1125 FAIL_IF(emit_mov_byte(compiler, 0, dst, dstw, src, (src & SLJIT_IMM) ? (unsigned char)srcw : srcw));
never executed: return compiler->error;
executed: }
Execution Count:32
partially evaluated: __builtin_expect((emit_mov_byte(compiler, 0, dst, dstw, src, (src & 0x200) ? (unsigned char)srcw : srcw)), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:32
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:32
0-32
1126 break;
executed: break;
Execution Count:32
32
1127 case SLJIT_MOV_SB: -
1128 FAIL_IF(emit_mov_byte(compiler, 1, dst, dstw, src, (src & SLJIT_IMM) ? (signed char)srcw : srcw));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov_byte(compiler, 1, dst, dstw, src, (src & 0x200) ? (signed char)srcw : srcw)), 0)
never evaluated: 0
0
1129 break;
never executed: break;
0
1130 case SLJIT_MOV_UH: -
1131 FAIL_IF(emit_mov_half(compiler, 0, dst, dstw, src, (src & SLJIT_IMM) ? (unsigned short)srcw : srcw));
never executed: return compiler->error;
executed: }
Execution Count:70
partially evaluated: __builtin_expect((emit_mov_half(compiler, 0, dst, dstw, src, (src & 0x200) ? (unsigned short)srcw : srcw)), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:70
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:70
0-70
1132 break;
executed: break;
Execution Count:70
70
1133 case SLJIT_MOV_SH: -
1134 FAIL_IF(emit_mov_half(compiler, 1, dst, dstw, src, (src & SLJIT_IMM) ? (signed short)srcw : srcw));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov_half(compiler, 1, dst, dstw, src, (src & 0x200) ? (signed short)srcw : srcw)), 0)
never evaluated: 0
0
1135 break;
never executed: break;
0
1136#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
1137 case SLJIT_MOV_UI: -
1138 FAIL_IF(emit_mov_int(compiler, 0, dst, dstw, src, (src & SLJIT_IMM) ? (unsigned int)srcw : srcw));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov_int(compiler, 0, dst, dstw, src, (src & 0x200) ? (unsigned int)srcw : srcw)), 0)
never evaluated: 0
0
1139 break;
never executed: break;
0
1140 case SLJIT_MOV_SI: -
1141 FAIL_IF(emit_mov_int(compiler, 1, dst, dstw, src, (src & SLJIT_IMM) ? (signed int)srcw : srcw));
never executed: return compiler->error;
executed: }
Execution Count:45
partially evaluated: __builtin_expect((emit_mov_int(compiler, 1, dst, dstw, src, (src & 0x200) ? (signed int)srcw : srcw)), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:45
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:45
0-45
1142 break;
executed: break;
Execution Count:45
45
1143#endif -
1144 } -
1145 -
1146#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
1147 if (SLJIT_UNLIKELY(dst_is_ereg) && dst == TMP_REGISTER) -
1148 return emit_mov(compiler, SLJIT_MEM1(SLJIT_LOCALS_REG), dstw, TMP_REGISTER, 0); -
1149#endif -
1150 -
1151 if (SLJIT_UNLIKELY(update) && (dst & SLJIT_MEM) && (dst & 0xf) && (dstw != 0 || (dst & 0xf0) != 0)) {
evaluated: __builtin_expect((update), 0)
TRUEFALSE
yes
Evaluation Count:15
yes
Evaluation Count:705
partially evaluated: (dst & 0x100)
TRUEFALSE
yes
Evaluation Count:15
no
Evaluation Count:0
partially evaluated: (dst & 0xf)
TRUEFALSE
yes
Evaluation Count:15
no
Evaluation Count:0
partially evaluated: dstw != 0
TRUEFALSE
yes
Evaluation Count:15
no
Evaluation Count:0
never evaluated: (dst & 0xf0) != 0
0-705
1152 code = emit_x86_instruction(compiler, 1, dst & 0xf, 0, dst, dstw);
executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, dst & 0xf, 0, dst, dstw);
-
1153 FAIL_IF(!code);
never executed: return compiler->error;
executed: }
Execution Count:15
partially evaluated: __builtin_expect((!code), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
0-15
1154 *code = 0x8d;
executed (the execution status of this line is deduced): *code = 0x8d;
-
1155 }
executed: }
Execution Count:15
15
1156 return SLJIT_SUCCESS;
executed: return 0;
Execution Count:720
720
1157 } -
1158 -
1159 if (SLJIT_UNLIKELY(GET_FLAGS(op)))
never evaluated: __builtin_expect((((op) & (0x0200 | 0x0400 | 0x0800 | 0x1000 | 0x2000))), 0)
0
1160 compiler->flags_saved = 0;
never executed: compiler->flags_saved = 0;
0
1161 -
1162 switch (GET_OPCODE(op)) { -
1163 case SLJIT_NOT: -
1164 if (SLJIT_UNLIKELY(op & SLJIT_SET_E))
never evaluated: __builtin_expect((op & 0x0200), 0)
0
1165 return emit_not_with_flags(compiler, dst, dstw, src, srcw);
never executed: return emit_not_with_flags(compiler, dst, dstw, src, srcw);
0
1166 return emit_unary(compiler, 0x2, dst, dstw, src, srcw);
never executed: return emit_unary(compiler, 0x2, dst, dstw, src, srcw);
0
1167 -
1168 case SLJIT_NEG: -
1169 if (SLJIT_UNLIKELY(op & SLJIT_KEEP_FLAGS) && !compiler->flags_saved)
never evaluated: __builtin_expect((op & 0x4000), 0)
never evaluated: !compiler->flags_saved
0
1170 FAIL_IF(emit_save_flags(compiler));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_save_flags(compiler)), 0)
never evaluated: 0
0
1171 return emit_unary(compiler, 0x3, dst, dstw, src, srcw);
never executed: return emit_unary(compiler, 0x3, dst, dstw, src, srcw);
0
1172 -
1173 case SLJIT_CLZ: -
1174 if (SLJIT_UNLIKELY(op & SLJIT_KEEP_FLAGS) && !compiler->flags_saved)
never evaluated: __builtin_expect((op & 0x4000), 0)
never evaluated: !compiler->flags_saved
0
1175 FAIL_IF(emit_save_flags(compiler));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_save_flags(compiler)), 0)
never evaluated: 0
0
1176 return emit_clz(compiler, op, dst, dstw, src, srcw);
never executed: return emit_clz(compiler, op, dst, dstw, src, srcw);
0
1177 } -
1178 -
1179 return SLJIT_SUCCESS;
never executed: return 0;
0
1180 -
1181#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
1182 #undef src_is_ereg -
1183#endif -
1184} -
1185 -
1186#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
1187 -
1188#define BINARY_IMM(_op_imm_, _op_mr_, immw, arg, argw) \ -
1189 if (IS_HALFWORD(immw) || compiler->mode32) { \ -
1190 code = emit_x86_instruction(compiler, 1 | EX86_BIN_INS, SLJIT_IMM, immw, arg, argw); \ -
1191 FAIL_IF(!code); \ -
1192 *(code + 1) |= (_op_imm_); \ -
1193 } \ -
1194 else { \ -
1195 FAIL_IF(emit_load_imm64(compiler, TMP_REG2, immw)); \ -
1196 code = emit_x86_instruction(compiler, 1, TMP_REG2, 0, arg, argw); \ -
1197 FAIL_IF(!code); \ -
1198 *code = (_op_mr_); \ -
1199 } -
1200 -
1201#define BINARY_EAX_IMM(_op_eax_imm_, immw) \ -
1202 FAIL_IF(emit_do_imm32(compiler, (!compiler->mode32) ? REX_W : 0, (_op_eax_imm_), immw)) -
1203 -
1204#else -
1205 -
1206#define BINARY_IMM(_op_imm_, _op_mr_, immw, arg, argw) \ -
1207 code = emit_x86_instruction(compiler, 1 | EX86_BIN_INS, SLJIT_IMM, immw, arg, argw); \ -
1208 FAIL_IF(!code); \ -
1209 *(code + 1) |= (_op_imm_); -
1210 -
1211#define BINARY_EAX_IMM(_op_eax_imm_, immw) \ -
1212 FAIL_IF(emit_do_imm(compiler, (_op_eax_imm_), immw)) -
1213 -
1214#endif -
1215 -
1216static int emit_cum_binary(struct sljit_compiler *compiler, -
1217 sljit_ub op_rm, sljit_ub op_mr, sljit_ub op_imm, sljit_ub op_eax_imm, -
1218 int dst, sljit_w dstw, -
1219 int src1, sljit_w src1w, -
1220 int src2, sljit_w src2w) -
1221{ -
1222 sljit_ub* code;
executed (the execution status of this line is deduced): sljit_ub* code;
-
1223 -
1224 if (dst == SLJIT_UNUSED) {
evaluated: dst == 0
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:193
1-193
1225 EMIT_MOV(compiler, TMP_REGISTER, 0, src1, src1w);
never executed: return compiler->error;
executed: }
Execution Count:1
partially evaluated: __builtin_expect((emit_mov(compiler, (11 + 1), 0, src1, src1w)), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1226 if (src2 & SLJIT_IMM) {
partially evaluated: src2 & 0x200
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1227 BINARY_IMM(op_imm, op_mr, src2w, TMP_REGISTER, 0);
never executed: return compiler->error;
never executed: }
never executed: }
never executed: return compiler->error;
never executed: }
never executed: return compiler->error;
never executed: }
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: __builtin_expect((emit_load_imm64(compiler, (11 + 2), src2w)), 0)
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
never evaluated: 0
never evaluated: 0
never evaluated: (src2w) <= 0x7fffffffll
never evaluated: (src2w) >= -0x80000000ll
never evaluated: compiler->mode32
0
1228 } -
1229 else { -
1230 code = emit_x86_instruction(compiler, 1, TMP_REGISTER, 0, src2, src2w);
executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, (11 + 1), 0, src2, src2w);
-
1231 FAIL_IF(!code);
never executed: return compiler->error;
executed: }
Execution Count:1
partially evaluated: __builtin_expect((!code), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1232 *code = op_rm;
executed (the execution status of this line is deduced): *code = op_rm;
-
1233 }
executed: }
Execution Count:1
1
1234 return SLJIT_SUCCESS;
executed: return 0;
Execution Count:1
1
1235 } -
1236 -
1237 if (dst == src1 && dstw == src1w) {
evaluated: dst == src1
TRUEFALSE
yes
Evaluation Count:178
yes
Evaluation Count:15
partially evaluated: dstw == src1w
TRUEFALSE
yes
Evaluation Count:178
no
Evaluation Count:0
0-178
1238 if (src2 & SLJIT_IMM) {
evaluated: src2 & 0x200
TRUEFALSE
yes
Evaluation Count:144
yes
Evaluation Count:34
34-144
1239#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
1240 if ((dst == SLJIT_TEMPORARY_REG1) && (src2w > 127 || src2w < -128) && (compiler->mode32 || IS_HALFWORD(src2w))) {
evaluated: (dst == 1)
TRUEFALSE
yes
Evaluation Count:50
yes
Evaluation Count:94
evaluated: src2w > 127
TRUEFALSE
yes
Evaluation Count:47
yes
Evaluation Count:3
partially evaluated: src2w < -128
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
partially evaluated: compiler->mode32
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:47
partially evaluated: (src2w) <= 0x7fffffffll
TRUEFALSE
yes
Evaluation Count:47
no
Evaluation Count:0
partially evaluated: (src2w) >= -0x80000000ll
TRUEFALSE
yes
Evaluation Count:47
no
Evaluation Count:0
0-94
1241#else -
1242 if ((dst == SLJIT_TEMPORARY_REG1) && (src2w > 127 || src2w < -128)) { -
1243#endif -
1244 BINARY_EAX_IMM(op_eax_imm, src2w);
never executed: return compiler->error;
executed: }
Execution Count:47
partially evaluated: __builtin_expect((emit_do_imm32(compiler, (!compiler->mode32) ? 0x48 : 0, (op_eax_imm), src2w)), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:47
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:47
0-47
1245 }
executed: }
Execution Count:47
47
1246 else { -
1247 BINARY_IMM(op_imm, op_mr, src2w, dst, dstw);
never executed: return compiler->error;
executed: }
Execution Count:97
executed: }
Execution Count:97
never executed: return compiler->error;
never executed: }
never executed: return compiler->error;
never executed: }
never executed: }
partially evaluated: __builtin_expect((!code), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:97
never evaluated: __builtin_expect((emit_load_imm64(compiler, (11 + 2), src2w)), 0)
never evaluated: __builtin_expect((!code), 0)
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:97
never evaluated: 0
never evaluated: 0
partially evaluated: (src2w) <= 0x7fffffffll
TRUEFALSE
yes
Evaluation Count:97
no
Evaluation Count:0
partially evaluated: (src2w) >= -0x80000000ll
TRUEFALSE
yes
Evaluation Count:97
no
Evaluation Count:0
never evaluated: compiler->mode32
0-97
1248 } -
1249 } -
1250 else if (dst >= SLJIT_TEMPORARY_REG1 && dst <= SLJIT_NO_REGISTERS) {
partially evaluated: dst >= 1
TRUEFALSE
yes
Evaluation Count:34
no
Evaluation Count:0
partially evaluated: dst <= 11
TRUEFALSE
yes
Evaluation Count:34
no
Evaluation Count:0
0-34
1251 code = emit_x86_instruction(compiler, 1, dst, dstw, src2, src2w);
executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, dst, dstw, src2, src2w);
-
1252 FAIL_IF(!code);
never executed: return compiler->error;
executed: }
Execution Count:34
partially evaluated: __builtin_expect((!code), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:34
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:34
0-34
1253 *code = op_rm;
executed (the execution status of this line is deduced): *code = op_rm;
-
1254 }
executed: }
Execution Count:34
34
1255 else if (src2 >= SLJIT_TEMPORARY_REG1 && src2 <= TMP_REGISTER) {
never evaluated: src2 >= 1
never evaluated: src2 <= (11 + 1)
0
1256 /* Special exception for sljit_emit_cond_value. */ -
1257 code = emit_x86_instruction(compiler, 1, src2, src2w, dst, dstw);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, src2, src2w, dst, dstw);
-
1258 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1259 *code = op_mr;
never executed (the execution status of this line is deduced): *code = op_mr;
-
1260 }
never executed: }
0
1261 else { -
1262 EMIT_MOV(compiler, TMP_REGISTER, 0, src2, src2w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, (11 + 1), 0, src2, src2w)), 0)
never evaluated: 0
0
1263 code = emit_x86_instruction(compiler, 1, TMP_REGISTER, 0, dst, dstw);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, (11 + 1), 0, dst, dstw);
-
1264 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1265 *code = op_mr;
never executed (the execution status of this line is deduced): *code = op_mr;
-
1266 }
never executed: }
0
1267 return SLJIT_SUCCESS;
executed: return 0;
Execution Count:178
178
1268 } -
1269 -
1270 /* Only for cumulative operations. */ -
1271 if (dst == src2 && dstw == src2w) {
partially evaluated: dst == src2
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
never evaluated: dstw == src2w
0-15
1272 if (src1 & SLJIT_IMM) {
never evaluated: src1 & 0x200
0
1273#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
1274 if ((dst == SLJIT_TEMPORARY_REG1) && (src1w > 127 || src1w < -128) && (compiler->mode32 || IS_HALFWORD(src1w))) {
never evaluated: (dst == 1)
never evaluated: src1w > 127
never evaluated: src1w < -128
never evaluated: compiler->mode32
never evaluated: (src1w) <= 0x7fffffffll
never evaluated: (src1w) >= -0x80000000ll
0
1275#else -
1276 if ((dst == SLJIT_TEMPORARY_REG1) && (src1w > 127 || src1w < -128)) { -
1277#endif -
1278 BINARY_EAX_IMM(op_eax_imm, src1w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_do_imm32(compiler, (!compiler->mode32) ? 0x48 : 0, (op_eax_imm), src1w)), 0)
never evaluated: 0
0
1279 }
never executed: }
0
1280 else { -
1281 BINARY_IMM(op_imm, op_mr, src1w, dst, dstw);
never executed: return compiler->error;
never executed: }
never executed: }
never executed: return compiler->error;
never executed: }
never executed: return compiler->error;
never executed: }
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: __builtin_expect((emit_load_imm64(compiler, (11 + 2), src1w)), 0)
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
never evaluated: 0
never evaluated: 0
never evaluated: (src1w) <= 0x7fffffffll
never evaluated: (src1w) >= -0x80000000ll
never evaluated: compiler->mode32
0
1282 } -
1283 } -
1284 else if (dst >= SLJIT_TEMPORARY_REG1 && dst <= SLJIT_NO_REGISTERS) {
never evaluated: dst >= 1
never evaluated: dst <= 11
0
1285 code = emit_x86_instruction(compiler, 1, dst, dstw, src1, src1w);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, dst, dstw, src1, src1w);
-
1286 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1287 *code = op_rm;
never executed (the execution status of this line is deduced): *code = op_rm;
-
1288 }
never executed: }
0
1289 else if (src1 >= SLJIT_TEMPORARY_REG1 && src1 <= SLJIT_NO_REGISTERS) {
never evaluated: src1 >= 1
never evaluated: src1 <= 11
0
1290 code = emit_x86_instruction(compiler, 1, src1, src1w, dst, dstw);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, src1, src1w, dst, dstw);
-
1291 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1292 *code = op_mr;
never executed (the execution status of this line is deduced): *code = op_mr;
-
1293 }
never executed: }
0
1294 else { -
1295 EMIT_MOV(compiler, TMP_REGISTER, 0, src1, src1w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, (11 + 1), 0, src1, src1w)), 0)
never evaluated: 0
0
1296 code = emit_x86_instruction(compiler, 1, TMP_REGISTER, 0, dst, dstw);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, (11 + 1), 0, dst, dstw);
-
1297 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1298 *code = op_mr;
never executed (the execution status of this line is deduced): *code = op_mr;
-
1299 }
never executed: }
0
1300 return SLJIT_SUCCESS;
never executed: return 0;
0
1301 } -
1302 -
1303 /* General version. */ -
1304 if (dst >= SLJIT_TEMPORARY_REG1 && dst <= SLJIT_NO_REGISTERS) {
partially evaluated: dst >= 1
TRUEFALSE
yes
Evaluation Count:15
no
Evaluation Count:0
partially evaluated: dst <= 11
TRUEFALSE
yes
Evaluation Count:15
no
Evaluation Count:0
0-15
1305 EMIT_MOV(compiler, dst, 0, src1, src1w);
never executed: return compiler->error;
executed: }
Execution Count:15
partially evaluated: __builtin_expect((emit_mov(compiler, dst, 0, src1, src1w)), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
0-15
1306 if (src2 & SLJIT_IMM) {
partially evaluated: src2 & 0x200
TRUEFALSE
yes
Evaluation Count:15
no
Evaluation Count:0
0-15
1307 BINARY_IMM(op_imm, op_mr, src2w, dst, 0);
never executed: return compiler->error;
executed: }
Execution Count:15
executed: }
Execution Count:15
never executed: return compiler->error;
never executed: }
never executed: return compiler->error;
never executed: }
never executed: }
partially evaluated: __builtin_expect((!code), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
never evaluated: __builtin_expect((emit_load_imm64(compiler, (11 + 2), src2w)), 0)
never evaluated: __builtin_expect((!code), 0)
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
never evaluated: 0
never evaluated: 0
partially evaluated: (src2w) <= 0x7fffffffll
TRUEFALSE
yes
Evaluation Count:15
no
Evaluation Count:0
partially evaluated: (src2w) >= -0x80000000ll
TRUEFALSE
yes
Evaluation Count:15
no
Evaluation Count:0
never evaluated: compiler->mode32
0-15
1308 } -
1309 else { -
1310 code = emit_x86_instruction(compiler, 1, dst, 0, src2, src2w);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, dst, 0, src2, src2w);
-
1311 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1312 *code = op_rm;
never executed (the execution status of this line is deduced): *code = op_rm;
-
1313 }
never executed: }
0
1314 } -
1315 else { -
1316 /* This version requires less memory writing. */ -
1317 EMIT_MOV(compiler, TMP_REGISTER, 0, src1, src1w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, (11 + 1), 0, src1, src1w)), 0)
never evaluated: 0
0
1318 if (src2 & SLJIT_IMM) {
never evaluated: src2 & 0x200
0
1319 BINARY_IMM(op_imm, op_mr, src2w, TMP_REGISTER, 0);
never executed: return compiler->error;
never executed: }
never executed: }
never executed: return compiler->error;
never executed: }
never executed: return compiler->error;
never executed: }
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: __builtin_expect((emit_load_imm64(compiler, (11 + 2), src2w)), 0)
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
never evaluated: 0
never evaluated: 0
never evaluated: (src2w) <= 0x7fffffffll
never evaluated: (src2w) >= -0x80000000ll
never evaluated: compiler->mode32
0
1320 } -
1321 else { -
1322 code = emit_x86_instruction(compiler, 1, TMP_REGISTER, 0, src2, src2w);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, (11 + 1), 0, src2, src2w);
-
1323 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1324 *code = op_rm;
never executed (the execution status of this line is deduced): *code = op_rm;
-
1325 }
never executed: }
0
1326 EMIT_MOV(compiler, dst, dstw, TMP_REGISTER, 0);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, dst, dstw, (11 + 1), 0)), 0)
never evaluated: 0
0
1327 }
never executed: }
0
1328 -
1329 return SLJIT_SUCCESS;
executed: return 0;
Execution Count:15
15
1330} -
1331 -
1332static int emit_non_cum_binary(struct sljit_compiler *compiler, -
1333 sljit_ub op_rm, sljit_ub op_mr, sljit_ub op_imm, sljit_ub op_eax_imm, -
1334 int dst, sljit_w dstw, -
1335 int src1, sljit_w src1w, -
1336 int src2, sljit_w src2w) -
1337{ -
1338 sljit_ub* code;
executed (the execution status of this line is deduced): sljit_ub* code;
-
1339 -
1340 if (dst == SLJIT_UNUSED) {
partially evaluated: dst == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:113
0-113
1341 EMIT_MOV(compiler, TMP_REGISTER, 0, src1, src1w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, (11 + 1), 0, src1, src1w)), 0)
never evaluated: 0
0
1342 if (src2 & SLJIT_IMM) {
never evaluated: src2 & 0x200
0
1343 BINARY_IMM(op_imm, op_mr, src2w, TMP_REGISTER, 0);
never executed: return compiler->error;
never executed: }
never executed: }
never executed: return compiler->error;
never executed: }
never executed: return compiler->error;
never executed: }
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: __builtin_expect((emit_load_imm64(compiler, (11 + 2), src2w)), 0)
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
never evaluated: 0
never evaluated: 0
never evaluated: (src2w) <= 0x7fffffffll
never evaluated: (src2w) >= -0x80000000ll
never evaluated: compiler->mode32
0
1344 } -
1345 else { -
1346 code = emit_x86_instruction(compiler, 1, TMP_REGISTER, 0, src2, src2w);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, (11 + 1), 0, src2, src2w);
-
1347 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1348 *code = op_rm;
never executed (the execution status of this line is deduced): *code = op_rm;
-
1349 }
never executed: }
0
1350 return SLJIT_SUCCESS;
never executed: return 0;
0
1351 } -
1352 -
1353 if (dst == src1 && dstw == src1w) {
evaluated: dst == src1
TRUEFALSE
yes
Evaluation Count:68
yes
Evaluation Count:45
partially evaluated: dstw == src1w
TRUEFALSE
yes
Evaluation Count:68
no
Evaluation Count:0
0-68
1354 if (src2 & SLJIT_IMM) {
evaluated: src2 & 0x200
TRUEFALSE
yes
Evaluation Count:53
yes
Evaluation Count:15
15-53
1355#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
1356 if ((dst == SLJIT_TEMPORARY_REG1) && (src2w > 127 || src2w < -128) && (compiler->mode32 || IS_HALFWORD(src2w))) {
partially evaluated: (dst == 1)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:53
never evaluated: src2w > 127
never evaluated: src2w < -128
never evaluated: compiler->mode32
never evaluated: (src2w) <= 0x7fffffffll
never evaluated: (src2w) >= -0x80000000ll
0-53
1357#else -
1358 if ((dst == SLJIT_TEMPORARY_REG1) && (src2w > 127 || src2w < -128)) { -
1359#endif -
1360 BINARY_EAX_IMM(op_eax_imm, src2w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_do_imm32(compiler, (!compiler->mode32) ? 0x48 : 0, (op_eax_imm), src2w)), 0)
never evaluated: 0
0
1361 }
never executed: }
0
1362 else { -
1363 BINARY_IMM(op_imm, op_mr, src2w, dst, dstw);
never executed: return compiler->error;
executed: }
Execution Count:53
executed: }
Execution Count:53
never executed: return compiler->error;
never executed: }
never executed: return compiler->error;
never executed: }
never executed: }
partially evaluated: __builtin_expect((!code), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:53
never evaluated: __builtin_expect((emit_load_imm64(compiler, (11 + 2), src2w)), 0)
never evaluated: __builtin_expect((!code), 0)
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:53
never evaluated: 0
never evaluated: 0
partially evaluated: (src2w) <= 0x7fffffffll
TRUEFALSE
yes
Evaluation Count:53
no
Evaluation Count:0
partially evaluated: (src2w) >= -0x80000000ll
TRUEFALSE
yes
Evaluation Count:53
no
Evaluation Count:0
never evaluated: compiler->mode32
0-53
1364 } -
1365 } -
1366 else if (dst >= SLJIT_TEMPORARY_REG1 && dst <= SLJIT_NO_REGISTERS) {
partially evaluated: dst >= 1
TRUEFALSE
yes
Evaluation Count:15
no
Evaluation Count:0
partially evaluated: dst <= 11
TRUEFALSE
yes
Evaluation Count:15
no
Evaluation Count:0
0-15
1367 code = emit_x86_instruction(compiler, 1, dst, dstw, src2, src2w);
executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, dst, dstw, src2, src2w);
-
1368 FAIL_IF(!code);
never executed: return compiler->error;
executed: }
Execution Count:15
partially evaluated: __builtin_expect((!code), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
0-15
1369 *code = op_rm;
executed (the execution status of this line is deduced): *code = op_rm;
-
1370 }
executed: }
Execution Count:15
15
1371 else if (src2 >= SLJIT_TEMPORARY_REG1 && src2 <= SLJIT_NO_REGISTERS) {
never evaluated: src2 >= 1
never evaluated: src2 <= 11
0
1372 code = emit_x86_instruction(compiler, 1, src2, src2w, dst, dstw);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, src2, src2w, dst, dstw);
-
1373 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1374 *code = op_mr;
never executed (the execution status of this line is deduced): *code = op_mr;
-
1375 }
never executed: }
0
1376 else { -
1377 EMIT_MOV(compiler, TMP_REGISTER, 0, src2, src2w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, (11 + 1), 0, src2, src2w)), 0)
never evaluated: 0
0
1378 code = emit_x86_instruction(compiler, 1, TMP_REGISTER, 0, dst, dstw);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, (11 + 1), 0, dst, dstw);
-
1379 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1380 *code = op_mr;
never executed (the execution status of this line is deduced): *code = op_mr;
-
1381 }
never executed: }
0
1382 return SLJIT_SUCCESS;
executed: return 0;
Execution Count:68
68
1383 } -
1384 -
1385 /* General version. */ -
1386 if ((dst >= SLJIT_TEMPORARY_REG1 && dst <= SLJIT_NO_REGISTERS) && dst != src2) {
partially evaluated: dst >= 1
TRUEFALSE
yes
Evaluation Count:45
no
Evaluation Count:0
partially evaluated: dst <= 11
TRUEFALSE
yes
Evaluation Count:45
no
Evaluation Count:0
partially evaluated: dst != src2
TRUEFALSE
yes
Evaluation Count:45
no
Evaluation Count:0
0-45
1387 EMIT_MOV(compiler, dst, 0, src1, src1w);
never executed: return compiler->error;
executed: }
Execution Count:45
partially evaluated: __builtin_expect((emit_mov(compiler, dst, 0, src1, src1w)), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:45
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:45
0-45
1388 if (src2 & SLJIT_IMM) {
evaluated: src2 & 0x200
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:15
15-30
1389 BINARY_IMM(op_imm, op_mr, src2w, dst, 0);
never executed: return compiler->error;
executed: }
Execution Count:30
executed: }
Execution Count:30
never executed: return compiler->error;
never executed: }
never executed: return compiler->error;
never executed: }
never executed: }
partially evaluated: __builtin_expect((!code), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:30
never evaluated: __builtin_expect((emit_load_imm64(compiler, (11 + 2), src2w)), 0)
never evaluated: __builtin_expect((!code), 0)
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:30
never evaluated: 0
never evaluated: 0
partially evaluated: (src2w) <= 0x7fffffffll
TRUEFALSE
yes
Evaluation Count:30
no
Evaluation Count:0
partially evaluated: (src2w) >= -0x80000000ll
TRUEFALSE
yes
Evaluation Count:30
no
Evaluation Count:0
never evaluated: compiler->mode32
0-30
1390 } -
1391 else { -
1392 code = emit_x86_instruction(compiler, 1, dst, 0, src2, src2w);
executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, dst, 0, src2, src2w);
-
1393 FAIL_IF(!code);
never executed: return compiler->error;
executed: }
Execution Count:15
partially evaluated: __builtin_expect((!code), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
0-15
1394 *code = op_rm;
executed (the execution status of this line is deduced): *code = op_rm;
-
1395 }
executed: }
Execution Count:15
15
1396 } -
1397 else { -
1398 /* This version requires less memory writing. */ -
1399 EMIT_MOV(compiler, TMP_REGISTER, 0, src1, src1w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, (11 + 1), 0, src1, src1w)), 0)
never evaluated: 0
0
1400 if (src2 & SLJIT_IMM) {
never evaluated: src2 & 0x200
0
1401 BINARY_IMM(op_imm, op_mr, src2w, TMP_REGISTER, 0);
never executed: return compiler->error;
never executed: }
never executed: }
never executed: return compiler->error;
never executed: }
never executed: return compiler->error;
never executed: }
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: __builtin_expect((emit_load_imm64(compiler, (11 + 2), src2w)), 0)
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
never evaluated: 0
never evaluated: 0
never evaluated: (src2w) <= 0x7fffffffll
never evaluated: (src2w) >= -0x80000000ll
never evaluated: compiler->mode32
0
1402 } -
1403 else { -
1404 code = emit_x86_instruction(compiler, 1, TMP_REGISTER, 0, src2, src2w);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, (11 + 1), 0, src2, src2w);
-
1405 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1406 *code = op_rm;
never executed (the execution status of this line is deduced): *code = op_rm;
-
1407 }
never executed: }
0
1408 EMIT_MOV(compiler, dst, dstw, TMP_REGISTER, 0);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, dst, dstw, (11 + 1), 0)), 0)
never evaluated: 0
0
1409 }
never executed: }
0
1410 -
1411 return SLJIT_SUCCESS;
executed: return 0;
Execution Count:45
45
1412} -
1413 -
1414static int emit_mul(struct sljit_compiler *compiler, -
1415 int dst, sljit_w dstw, -
1416 int src1, sljit_w src1w, -
1417 int src2, sljit_w src2w) -
1418{ -
1419 sljit_ub* code;
never executed (the execution status of this line is deduced): sljit_ub* code;
-
1420 int dst_r;
never executed (the execution status of this line is deduced): int dst_r;
-
1421 -
1422 dst_r = (dst >= SLJIT_TEMPORARY_REG1 && dst <= SLJIT_NO_REGISTERS) ? dst : TMP_REGISTER;
never evaluated: dst >= 1
never evaluated: dst <= 11
0
1423 -
1424 /* Register destination. */ -
1425 if (dst_r == src1 && !(src2 & SLJIT_IMM)) {
never evaluated: dst_r == src1
never evaluated: !(src2 & 0x200)
0
1426 code = emit_x86_instruction(compiler, 2, dst_r, 0, src2, src2w);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 2, dst_r, 0, src2, src2w);
-
1427 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1428 *code++ = 0x0f;
never executed (the execution status of this line is deduced): *code++ = 0x0f;
-
1429 *code = 0xaf;
never executed (the execution status of this line is deduced): *code = 0xaf;
-
1430 }
never executed: }
0
1431 else if (dst_r == src2 && !(src1 & SLJIT_IMM)) {
never evaluated: dst_r == src2
never evaluated: !(src1 & 0x200)
0
1432 code = emit_x86_instruction(compiler, 2, dst_r, 0, src1, src1w);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 2, dst_r, 0, src1, src1w);
-
1433 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1434 *code++ = 0x0f;
never executed (the execution status of this line is deduced): *code++ = 0x0f;
-
1435 *code = 0xaf;
never executed (the execution status of this line is deduced): *code = 0xaf;
-
1436 }
never executed: }
0
1437 else if (src1 & SLJIT_IMM) {
never evaluated: src1 & 0x200
0
1438 if (src2 & SLJIT_IMM) {
never evaluated: src2 & 0x200
0
1439 EMIT_MOV(compiler, dst_r, 0, SLJIT_IMM, src2w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, dst_r, 0, 0x200, src2w)), 0)
never evaluated: 0
0
1440 src2 = dst_r;
never executed (the execution status of this line is deduced): src2 = dst_r;
-
1441 src2w = 0;
never executed (the execution status of this line is deduced): src2w = 0;
-
1442 }
never executed: }
0
1443 -
1444 if (src1w <= 127 && src1w >= -128) {
never evaluated: src1w <= 127
never evaluated: src1w >= -128
0
1445 code = emit_x86_instruction(compiler, 1, dst_r, 0, src2, src2w);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, dst_r, 0, src2, src2w);
-
1446 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1447 *code = 0x6b;
never executed (the execution status of this line is deduced): *code = 0x6b;
-
1448 code = (sljit_ub*)ensure_buf(compiler, 1 + 1);
never executed (the execution status of this line is deduced): code = (sljit_ub*)ensure_buf(compiler, 1 + 1);
-
1449 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1450 INC_CSIZE(1);
never executed (the execution status of this line is deduced): (*code++ = (1), compiler->size += (1));
-
1451 *code = (sljit_b)src1w;
never executed (the execution status of this line is deduced): *code = (sljit_b)src1w;
-
1452 }
never executed: }
0
1453#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
1454 else { -
1455 code = emit_x86_instruction(compiler, 1, dst_r, 0, src2, src2w); -
1456 FAIL_IF(!code); -
1457 *code = 0x69; -
1458 code = (sljit_ub*)ensure_buf(compiler, 1 + 4); -
1459 FAIL_IF(!code); -
1460 INC_CSIZE(4); -
1461 *(sljit_w*)code = src1w; -
1462 } -
1463#else -
1464 else if (IS_HALFWORD(src1w)) {
never evaluated: (src1w) <= 0x7fffffffll
never evaluated: (src1w) >= -0x80000000ll
0
1465 code = emit_x86_instruction(compiler, 1, dst_r, 0, src2, src2w);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, dst_r, 0, src2, src2w);
-
1466 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1467 *code = 0x69;
never executed (the execution status of this line is deduced): *code = 0x69;
-
1468 code = (sljit_ub*)ensure_buf(compiler, 1 + 4);
never executed (the execution status of this line is deduced): code = (sljit_ub*)ensure_buf(compiler, 1 + 4);
-
1469 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1470 INC_CSIZE(4);
never executed (the execution status of this line is deduced): (*code++ = (4), compiler->size += (4));
-
1471 *(sljit_hw*)code = (sljit_hw)src1w;
never executed (the execution status of this line is deduced): *(sljit_hw*)code = (sljit_hw)src1w;
-
1472 }
never executed: }
0
1473 else { -
1474 EMIT_MOV(compiler, TMP_REG2, 0, SLJIT_IMM, src1w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, (11 + 2), 0, 0x200, src1w)), 0)
never evaluated: 0
0
1475 if (dst_r != src2)
never evaluated: dst_r != src2
0
1476 EMIT_MOV(compiler, dst_r, 0, src2, src2w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, dst_r, 0, src2, src2w)), 0)
never evaluated: 0
0
1477 code = emit_x86_instruction(compiler, 2, dst_r, 0, TMP_REG2, 0);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 2, dst_r, 0, (11 + 2), 0);
-
1478 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1479 *code++ = 0x0f;
never executed (the execution status of this line is deduced): *code++ = 0x0f;
-
1480 *code = 0xaf;
never executed (the execution status of this line is deduced): *code = 0xaf;
-
1481 }
never executed: }
0
1482#endif -
1483 } -
1484 else if (src2 & SLJIT_IMM) {
never evaluated: src2 & 0x200
0
1485 /* Note: src1 is NOT immediate. */ -
1486 -
1487 if (src2w <= 127 && src2w >= -128) {
never evaluated: src2w <= 127
never evaluated: src2w >= -128
0
1488 code = emit_x86_instruction(compiler, 1, dst_r, 0, src1, src1w);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, dst_r, 0, src1, src1w);
-
1489 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1490 *code = 0x6b;
never executed (the execution status of this line is deduced): *code = 0x6b;
-
1491 code = (sljit_ub*)ensure_buf(compiler, 1 + 1);
never executed (the execution status of this line is deduced): code = (sljit_ub*)ensure_buf(compiler, 1 + 1);
-
1492 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1493 INC_CSIZE(1);
never executed (the execution status of this line is deduced): (*code++ = (1), compiler->size += (1));
-
1494 *code = (sljit_b)src2w;
never executed (the execution status of this line is deduced): *code = (sljit_b)src2w;
-
1495 }
never executed: }
0
1496#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
1497 else { -
1498 code = emit_x86_instruction(compiler, 1, dst_r, 0, src1, src1w); -
1499 FAIL_IF(!code); -
1500 *code = 0x69; -
1501 code = (sljit_ub*)ensure_buf(compiler, 1 + 4); -
1502 FAIL_IF(!code); -
1503 INC_CSIZE(4); -
1504 *(sljit_w*)code = src2w; -
1505 } -
1506#else -
1507 else if (IS_HALFWORD(src2w)) {
never evaluated: (src2w) <= 0x7fffffffll
never evaluated: (src2w) >= -0x80000000ll
0
1508 code = emit_x86_instruction(compiler, 1, dst_r, 0, src1, src1w);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, dst_r, 0, src1, src1w);
-
1509 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1510 *code = 0x69;
never executed (the execution status of this line is deduced): *code = 0x69;
-
1511 code = (sljit_ub*)ensure_buf(compiler, 1 + 4);
never executed (the execution status of this line is deduced): code = (sljit_ub*)ensure_buf(compiler, 1 + 4);
-
1512 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1513 INC_CSIZE(4);
never executed (the execution status of this line is deduced): (*code++ = (4), compiler->size += (4));
-
1514 *(sljit_hw*)code = (sljit_hw)src2w;
never executed (the execution status of this line is deduced): *(sljit_hw*)code = (sljit_hw)src2w;
-
1515 }
never executed: }
0
1516 else { -
1517 EMIT_MOV(compiler, TMP_REG2, 0, SLJIT_IMM, src1w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, (11 + 2), 0, 0x200, src1w)), 0)
never evaluated: 0
0
1518 if (dst_r != src1)
never evaluated: dst_r != src1
0
1519 EMIT_MOV(compiler, dst_r, 0, src1, src1w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, dst_r, 0, src1, src1w)), 0)
never evaluated: 0
0
1520 code = emit_x86_instruction(compiler, 2, dst_r, 0, TMP_REG2, 0);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 2, dst_r, 0, (11 + 2), 0);
-
1521 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1522 *code++ = 0x0f;
never executed (the execution status of this line is deduced): *code++ = 0x0f;
-
1523 *code = 0xaf;
never executed (the execution status of this line is deduced): *code = 0xaf;
-
1524 }
never executed: }
0
1525#endif -
1526 } -
1527 else { -
1528 /* Neither argument is immediate. */ -
1529 if (ADDRESSING_DEPENDS_ON(src2, dst_r))
never evaluated: ((src2) & 0x100)
never evaluated: ((src2) & 0xf) == dst_r
never evaluated: (((src2) >> 4) & 0xf) == dst_r
0
1530 dst_r = TMP_REGISTER;
never executed: dst_r = (11 + 1);
0
1531 EMIT_MOV(compiler, dst_r, 0, src1, src1w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, dst_r, 0, src1, src1w)), 0)
never evaluated: 0
0
1532 code = emit_x86_instruction(compiler, 2, dst_r, 0, src2, src2w);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 2, dst_r, 0, src2, src2w);
-
1533 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1534 *code++ = 0x0f;
never executed (the execution status of this line is deduced): *code++ = 0x0f;
-
1535 *code = 0xaf;
never executed (the execution status of this line is deduced): *code = 0xaf;
-
1536 }
never executed: }
0
1537 -
1538 if (dst_r == TMP_REGISTER)
never evaluated: dst_r == (11 + 1)
0
1539 EMIT_MOV(compiler, dst, dstw, TMP_REGISTER, 0);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, dst, dstw, (11 + 1), 0)), 0)
never evaluated: 0
0
1540 -
1541 return SLJIT_SUCCESS;
never executed: return 0;
0
1542} -
1543 -
1544static int emit_lea_binary(struct sljit_compiler *compiler, -
1545 int dst, sljit_w dstw, -
1546 int src1, sljit_w src1w, -
1547 int src2, sljit_w src2w) -
1548{ -
1549 sljit_ub* code;
executed (the execution status of this line is deduced): sljit_ub* code;
-
1550 int dst_r, done = 0;
executed (the execution status of this line is deduced): int dst_r, done = 0;
-
1551 -
1552 /* These cases better be left to handled by normal way. */ -
1553 if (dst == src1 && dstw == src1w)
evaluated: dst == src1
TRUEFALSE
yes
Evaluation Count:150
yes
Evaluation Count:60
partially evaluated: dstw == src1w
TRUEFALSE
yes
Evaluation Count:150
no
Evaluation Count:0
0-150
1554 return SLJIT_ERR_UNSUPPORTED;
executed: return 4;
Execution Count:150
150
1555 if (dst == src2 && dstw == src2w)
partially evaluated: dst == src2
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:60
never evaluated: dstw == src2w
0-60
1556 return SLJIT_ERR_UNSUPPORTED;
never executed: return 4;
0
1557 -
1558 dst_r = (dst >= SLJIT_TEMPORARY_REG1 && dst <= SLJIT_NO_REGISTERS) ? dst : TMP_REGISTER;
partially evaluated: dst >= 1
TRUEFALSE
yes
Evaluation Count:60
no
Evaluation Count:0
partially evaluated: dst <= 11
TRUEFALSE
yes
Evaluation Count:60
no
Evaluation Count:0
0-60
1559 -
1560 if (src1 >= SLJIT_TEMPORARY_REG1 && src1 <= SLJIT_NO_REGISTERS) {
partially evaluated: src1 >= 1
TRUEFALSE
yes
Evaluation Count:60
no
Evaluation Count:0
evaluated: src1 <= 11
TRUEFALSE
yes
Evaluation Count:15
yes
Evaluation Count:45
0-60
1561 if (src2 >= SLJIT_TEMPORARY_REG1 && src2 <= SLJIT_NO_REGISTERS) {
partially evaluated: src2 >= 1
TRUEFALSE
yes
Evaluation Count:15
no
Evaluation Count:0
partially evaluated: src2 <= 11
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
0-15
1562 /* It is not possible to be both SLJIT_LOCALS_REG. */ -
1563 if (src1 != SLJIT_LOCALS_REG || src2 != SLJIT_LOCALS_REG) {
never evaluated: src1 != 11
never evaluated: src2 != 11
0
1564 code = emit_x86_instruction(compiler, 1, dst_r, 0, SLJIT_MEM2(src1, src2), 0);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, dst_r, 0, (0x100 | (src1) | ((src2) << 4)), 0);
-
1565 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1566 *code = 0x8d;
never executed (the execution status of this line is deduced): *code = 0x8d;
-
1567 done = 1;
never executed (the execution status of this line is deduced): done = 1;
-
1568 }
never executed: }
0
1569 }
never executed: }
0
1570#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
1571 if ((src2 & SLJIT_IMM) && (compiler->mode32 || IS_HALFWORD(src2w))) {
partially evaluated: (src2 & 0x200)
TRUEFALSE
yes
Evaluation Count:15
no
Evaluation Count:0
partially evaluated: compiler->mode32
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
partially evaluated: (src2w) <= 0x7fffffffll
TRUEFALSE
yes
Evaluation Count:15
no
Evaluation Count:0
partially evaluated: (src2w) >= -0x80000000ll
TRUEFALSE
yes
Evaluation Count:15
no
Evaluation Count:0
0-15
1572 code = emit_x86_instruction(compiler, 1, dst_r, 0, SLJIT_MEM1(src1), (int)src2w);
executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, dst_r, 0, (0x100 | (src1)), (int)src2w);
-
1573#else -
1574 if (src2 & SLJIT_IMM) { -
1575 code = emit_x86_instruction(compiler, 1, dst_r, 0, SLJIT_MEM1(src1), src2w); -
1576#endif -
1577 FAIL_IF(!code);
never executed: return compiler->error;
executed: }
Execution Count:15
partially evaluated: __builtin_expect((!code), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
0-15
1578 *code = 0x8d;
executed (the execution status of this line is deduced): *code = 0x8d;
-
1579 done = 1;
executed (the execution status of this line is deduced): done = 1;
-
1580 }
executed: }
Execution Count:15
15
1581 }
executed: }
Execution Count:15
15
1582 else if (src2 >= SLJIT_TEMPORARY_REG1 && src2 <= SLJIT_NO_REGISTERS) {
partially evaluated: src2 >= 1
TRUEFALSE
yes
Evaluation Count:45
no
Evaluation Count:0
partially evaluated: src2 <= 11
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:45
0-45
1583#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
1584 if ((src1 & SLJIT_IMM) && (compiler->mode32 || IS_HALFWORD(src1w))) {
never evaluated: (src1 & 0x200)
never evaluated: compiler->mode32
never evaluated: (src1w) <= 0x7fffffffll
never evaluated: (src1w) >= -0x80000000ll
0
1585 code = emit_x86_instruction(compiler, 1, dst_r, 0, SLJIT_MEM1(src2), (int)src1w);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, dst_r, 0, (0x100 | (src2)), (int)src1w);
-
1586#else -
1587 if (src1 & SLJIT_IMM) { -
1588 code = emit_x86_instruction(compiler, 1, dst_r, 0, SLJIT_MEM1(src2), src1w); -
1589#endif -
1590 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1591 *code = 0x8d;
never executed (the execution status of this line is deduced): *code = 0x8d;
-
1592 done = 1;
never executed (the execution status of this line is deduced): done = 1;
-
1593 }
never executed: }
0
1594 }
never executed: }
0
1595 -
1596 if (done) {
evaluated: done
TRUEFALSE
yes
Evaluation Count:15
yes
Evaluation Count:45
15-45
1597 if (dst_r == TMP_REGISTER)
partially evaluated: dst_r == (11 + 1)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
0-15
1598 return emit_mov(compiler, dst, dstw, TMP_REGISTER, 0);
never executed: return emit_mov(compiler, dst, dstw, (11 + 1), 0);
0
1599 return SLJIT_SUCCESS;
executed: return 0;
Execution Count:15
15
1600 } -
1601 return SLJIT_ERR_UNSUPPORTED;
executed: return 4;
Execution Count:45
45
1602} -
1603 -
1604static int emit_cmp_binary(struct sljit_compiler *compiler, -
1605 int src1, sljit_w src1w, -
1606 int src2, sljit_w src2w) -
1607{ -
1608 sljit_ub* code;
executed (the execution status of this line is deduced): sljit_ub* code;
-
1609 -
1610#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
1611 if (src1 == SLJIT_TEMPORARY_REG1 && (src2 & SLJIT_IMM) && (src2w > 127 || src2w < -128) && (compiler->mode32 || IS_HALFWORD(src2w))) {
evaluated: src1 == 1
TRUEFALSE
yes
Evaluation Count:128
yes
Evaluation Count:154
partially evaluated: (src2 & 0x200)
TRUEFALSE
yes
Evaluation Count:128
no
Evaluation Count:0
evaluated: src2w > 127
TRUEFALSE
yes
Evaluation Count:75
yes
Evaluation Count:53
partially evaluated: src2w < -128
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:53
partially evaluated: compiler->mode32
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:75
partially evaluated: (src2w) <= 0x7fffffffll
TRUEFALSE
yes
Evaluation Count:75
no
Evaluation Count:0
partially evaluated: (src2w) >= -0x80000000ll
TRUEFALSE
yes
Evaluation Count:75
no
Evaluation Count:0
0-154
1612#else -
1613 if (src1 == SLJIT_TEMPORARY_REG1 && (src2 & SLJIT_IMM) && (src2w > 127 || src2w < -128)) { -
1614#endif -
1615 BINARY_EAX_IMM(0x3d, src2w);
never executed: return compiler->error;
executed: }
Execution Count:75
partially evaluated: __builtin_expect((emit_do_imm32(compiler, (!compiler->mode32) ? 0x48 : 0, (0x3d), src2w)), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:75
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:75
0-75
1616 return SLJIT_SUCCESS;
executed: return 0;
Execution Count:75
75
1617 } -
1618 -
1619 if (src1 >= SLJIT_TEMPORARY_REG1 && src1 <= SLJIT_NO_REGISTERS) {
partially evaluated: src1 >= 1
TRUEFALSE
yes
Evaluation Count:207
no
Evaluation Count:0
evaluated: src1 <= 11
TRUEFALSE
yes
Evaluation Count:199
yes
Evaluation Count:8
0-207
1620 if (src2 & SLJIT_IMM) {
evaluated: src2 & 0x200
TRUEFALSE
yes
Evaluation Count:100
yes
Evaluation Count:99
99-100
1621 BINARY_IMM(0x7 << 3, 0x39, src2w, src1, 0);
never executed: return compiler->error;
executed: }
Execution Count:100
executed: }
Execution Count:100
never executed: return compiler->error;
never executed: }
never executed: return compiler->error;
never executed: }
never executed: }
partially evaluated: __builtin_expect((!code), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:100
never evaluated: __builtin_expect((emit_load_imm64(compiler, (11 + 2), src2w)), 0)
never evaluated: __builtin_expect((!code), 0)
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:100
never evaluated: 0
never evaluated: 0
partially evaluated: (src2w) <= 0x7fffffffll
TRUEFALSE
yes
Evaluation Count:100
no
Evaluation Count:0
partially evaluated: (src2w) >= -0x80000000ll
TRUEFALSE
yes
Evaluation Count:100
no
Evaluation Count:0
never evaluated: compiler->mode32
0-100
1622 } -
1623 else { -
1624 code = emit_x86_instruction(compiler, 1, src1, 0, src2, src2w);
executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, src1, 0, src2, src2w);
-
1625 FAIL_IF(!code);
never executed: return compiler->error;
executed: }
Execution Count:99
partially evaluated: __builtin_expect((!code), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:99
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:99
0-99
1626 *code = 0x3b;
executed (the execution status of this line is deduced): *code = 0x3b;
-
1627 }
executed: }
Execution Count:99
99
1628 return SLJIT_SUCCESS;
executed: return 0;
Execution Count:199
199
1629 } -
1630 -
1631 if (src2 >= SLJIT_TEMPORARY_REG1 && src2 <= SLJIT_NO_REGISTERS && !(src1 & SLJIT_IMM)) {
partially evaluated: src2 >= 1
TRUEFALSE
yes
Evaluation Count:8
no
Evaluation Count:0
partially evaluated: src2 <= 11
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
never evaluated: !(src1 & 0x200)
0-8
1632 code = emit_x86_instruction(compiler, 1, src2, 0, src1, src1w);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, src2, 0, src1, src1w);
-
1633 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1634 *code = 0x39;
never executed (the execution status of this line is deduced): *code = 0x39;
-
1635 return SLJIT_SUCCESS;
never executed: return 0;
0
1636 } -
1637 -
1638 if (src2 & SLJIT_IMM) {
partially evaluated: src2 & 0x200
TRUEFALSE
yes
Evaluation Count:8
no
Evaluation Count:0
0-8
1639 if (src1 & SLJIT_IMM) {
partially evaluated: src1 & 0x200
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
1640 EMIT_MOV(compiler, TMP_REGISTER, 0, src1, src1w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, (11 + 1), 0, src1, src1w)), 0)
never evaluated: 0
0
1641 src1 = TMP_REGISTER;
never executed (the execution status of this line is deduced): src1 = (11 + 1);
-
1642 src1w = 0;
never executed (the execution status of this line is deduced): src1w = 0;
-
1643 }
never executed: }
0
1644 BINARY_IMM(0x7 << 3, 0x39, src2w, src1, src1w);
never executed: return compiler->error;
executed: }
Execution Count:8
executed: }
Execution Count:8
never executed: return compiler->error;
never executed: }
never executed: return compiler->error;
never executed: }
never executed: }
partially evaluated: __builtin_expect((!code), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
never evaluated: __builtin_expect((emit_load_imm64(compiler, (11 + 2), src2w)), 0)
never evaluated: __builtin_expect((!code), 0)
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
never evaluated: 0
never evaluated: 0
partially evaluated: (src2w) <= 0x7fffffffll
TRUEFALSE
yes
Evaluation Count:8
no
Evaluation Count:0
partially evaluated: (src2w) >= -0x80000000ll
TRUEFALSE
yes
Evaluation Count:8
no
Evaluation Count:0
never evaluated: compiler->mode32
0-8
1645 } -
1646 else { -
1647 EMIT_MOV(compiler, TMP_REGISTER, 0, src1, src1w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, (11 + 1), 0, src1, src1w)), 0)
never evaluated: 0
0
1648 code = emit_x86_instruction(compiler, 1, TMP_REGISTER, 0, src2, src2w);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, (11 + 1), 0, src2, src2w);
-
1649 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1650 *code = 0x3b;
never executed (the execution status of this line is deduced): *code = 0x3b;
-
1651 }
never executed: }
0
1652 return SLJIT_SUCCESS;
executed: return 0;
Execution Count:8
8
1653} -
1654 -
1655static int emit_test_binary(struct sljit_compiler *compiler, -
1656 int src1, sljit_w src1w, -
1657 int src2, sljit_w src2w) -
1658{ -
1659 sljit_ub* code;
never executed (the execution status of this line is deduced): sljit_ub* code;
-
1660 -
1661#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
1662 if (src1 == SLJIT_TEMPORARY_REG1 && (src2 & SLJIT_IMM) && (src2w > 127 || src2w < -128) && (compiler->mode32 || IS_HALFWORD(src2w))) {
never evaluated: src1 == 1
never evaluated: (src2 & 0x200)
never evaluated: src2w > 127
never evaluated: src2w < -128
never evaluated: compiler->mode32
never evaluated: (src2w) <= 0x7fffffffll
never evaluated: (src2w) >= -0x80000000ll
0
1663#else -
1664 if (src1 == SLJIT_TEMPORARY_REG1 && (src2 & SLJIT_IMM) && (src2w > 127 || src2w < -128)) { -
1665#endif -
1666 BINARY_EAX_IMM(0xa9, src2w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_do_imm32(compiler, (!compiler->mode32) ? 0x48 : 0, (0xa9), src2w)), 0)
never evaluated: 0
0
1667 return SLJIT_SUCCESS;
never executed: return 0;
0
1668 } -
1669 -
1670#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
1671 if (src2 == SLJIT_TEMPORARY_REG1 && (src2 & SLJIT_IMM) && (src1w > 127 || src1w < -128) && (compiler->mode32 || IS_HALFWORD(src1w))) {
never evaluated: src2 == 1
never evaluated: (src2 & 0x200)
never evaluated: src1w > 127
never evaluated: src1w < -128
never evaluated: compiler->mode32
never evaluated: (src1w) <= 0x7fffffffll
never evaluated: (src1w) >= -0x80000000ll
0
1672#else -
1673 if (src2 == SLJIT_TEMPORARY_REG1 && (src1 & SLJIT_IMM) && (src1w > 127 || src1w < -128)) { -
1674#endif -
1675 BINARY_EAX_IMM(0xa9, src1w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_do_imm32(compiler, (!compiler->mode32) ? 0x48 : 0, (0xa9), src1w)), 0)
never evaluated: 0
0
1676 return SLJIT_SUCCESS;
never executed: return 0;
0
1677 } -
1678 -
1679 if (src1 >= SLJIT_TEMPORARY_REG1 && src1 <= SLJIT_NO_REGISTERS) {
never evaluated: src1 >= 1
never evaluated: src1 <= 11
0
1680 if (src2 & SLJIT_IMM) {
never evaluated: src2 & 0x200
0
1681#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
1682 if (IS_HALFWORD(src2w) || compiler->mode32) {
never evaluated: (src2w) <= 0x7fffffffll
never evaluated: (src2w) >= -0x80000000ll
never evaluated: compiler->mode32
0
1683 code = emit_x86_instruction(compiler, 1, SLJIT_IMM, src2w, src1, 0);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, 0x200, src2w, src1, 0);
-
1684 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1685 *code = 0xf7;
never executed (the execution status of this line is deduced): *code = 0xf7;
-
1686 }
never executed: }
0
1687 else { -
1688 FAIL_IF(emit_load_imm64(compiler, TMP_REG2, src2w));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_load_imm64(compiler, (11 + 2), src2w)), 0)
never evaluated: 0
0
1689 code = emit_x86_instruction(compiler, 1, TMP_REG2, 0, src1, 0);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, (11 + 2), 0, src1, 0);
-
1690 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1691 *code = 0x85;
never executed (the execution status of this line is deduced): *code = 0x85;
-
1692 }
never executed: }
0
1693#else -
1694 code = emit_x86_instruction(compiler, 1, SLJIT_IMM, src2w, src1, 0); -
1695 FAIL_IF(!code); -
1696 *code = 0xf7; -
1697#endif -
1698 } -
1699 else { -
1700 code = emit_x86_instruction(compiler, 1, src1, 0, src2, src2w);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, src1, 0, src2, src2w);
-
1701 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1702 *code = 0x85;
never executed (the execution status of this line is deduced): *code = 0x85;
-
1703 }
never executed: }
0
1704 return SLJIT_SUCCESS;
never executed: return 0;
0
1705 } -
1706 -
1707 if (src2 >= SLJIT_TEMPORARY_REG1 && src2 <= SLJIT_NO_REGISTERS) {
never evaluated: src2 >= 1
never evaluated: src2 <= 11
0
1708 if (src1 & SLJIT_IMM) {
never evaluated: src1 & 0x200
0
1709#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
1710 if (IS_HALFWORD(src1w) || compiler->mode32) {
never evaluated: (src1w) <= 0x7fffffffll
never evaluated: (src1w) >= -0x80000000ll
never evaluated: compiler->mode32
0
1711 code = emit_x86_instruction(compiler, 1, SLJIT_IMM, src1w, src2, 0);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, 0x200, src1w, src2, 0);
-
1712 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1713 *code = 0xf7;
never executed (the execution status of this line is deduced): *code = 0xf7;
-
1714 }
never executed: }
0
1715 else { -
1716 FAIL_IF(emit_load_imm64(compiler, TMP_REG2, src1w));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_load_imm64(compiler, (11 + 2), src1w)), 0)
never evaluated: 0
0
1717 code = emit_x86_instruction(compiler, 1, TMP_REG2, 0, src2, 0);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, (11 + 2), 0, src2, 0);
-
1718 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1719 *code = 0x85;
never executed (the execution status of this line is deduced): *code = 0x85;
-
1720 }
never executed: }
0
1721#else -
1722 code = emit_x86_instruction(compiler, 1, src1, src1w, src2, 0); -
1723 FAIL_IF(!code); -
1724 *code = 0xf7; -
1725#endif -
1726 } -
1727 else { -
1728 code = emit_x86_instruction(compiler, 1, src2, 0, src1, src1w);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, src2, 0, src1, src1w);
-
1729 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1730 *code = 0x85;
never executed (the execution status of this line is deduced): *code = 0x85;
-
1731 }
never executed: }
0
1732 return SLJIT_SUCCESS;
never executed: return 0;
0
1733 } -
1734 -
1735 EMIT_MOV(compiler, TMP_REGISTER, 0, src1, src1w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, (11 + 1), 0, src1, src1w)), 0)
never evaluated: 0
0
1736 if (src2 & SLJIT_IMM) {
never evaluated: src2 & 0x200
0
1737#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
1738 if (IS_HALFWORD(src2w) || compiler->mode32) {
never evaluated: (src2w) <= 0x7fffffffll
never evaluated: (src2w) >= -0x80000000ll
never evaluated: compiler->mode32
0
1739 code = emit_x86_instruction(compiler, 1, SLJIT_IMM, src2w, TMP_REGISTER, 0);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, 0x200, src2w, (11 + 1), 0);
-
1740 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1741 *code = 0xf7;
never executed (the execution status of this line is deduced): *code = 0xf7;
-
1742 }
never executed: }
0
1743 else { -
1744 FAIL_IF(emit_load_imm64(compiler, TMP_REG2, src2w));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_load_imm64(compiler, (11 + 2), src2w)), 0)
never evaluated: 0
0
1745 code = emit_x86_instruction(compiler, 1, TMP_REG2, 0, TMP_REGISTER, 0);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, (11 + 2), 0, (11 + 1), 0);
-
1746 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1747 *code = 0x85;
never executed (the execution status of this line is deduced): *code = 0x85;
-
1748 }
never executed: }
0
1749#else -
1750 code = emit_x86_instruction(compiler, 1, SLJIT_IMM, src2w, TMP_REGISTER, 0); -
1751 FAIL_IF(!code); -
1752 *code = 0xf7; -
1753#endif -
1754 } -
1755 else { -
1756 code = emit_x86_instruction(compiler, 1, TMP_REGISTER, 0, src2, src2w);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, (11 + 1), 0, src2, src2w);
-
1757 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1758 *code = 0x85;
never executed (the execution status of this line is deduced): *code = 0x85;
-
1759 }
never executed: }
0
1760 return SLJIT_SUCCESS;
never executed: return 0;
0
1761} -
1762 -
1763static int emit_shift(struct sljit_compiler *compiler, -
1764 sljit_ub mode, -
1765 int dst, sljit_w dstw, -
1766 int src1, sljit_w src1w, -
1767 int src2, sljit_w src2w) -
1768{ -
1769 sljit_ub* code;
executed (the execution status of this line is deduced): sljit_ub* code;
-
1770 -
1771 if ((src2 & SLJIT_IMM) || (src2 == SLJIT_PREF_SHIFT_REG)) {
partially evaluated: (src2 & 0x200)
TRUEFALSE
yes
Evaluation Count:63
no
Evaluation Count:0
never evaluated: (src2 == 3)
0-63
1772 if (dst == src1 && dstw == src1w) {
partially evaluated: dst == src1
TRUEFALSE
yes
Evaluation Count:63
no
Evaluation Count:0
partially evaluated: dstw == src1w
TRUEFALSE
yes
Evaluation Count:63
no
Evaluation Count:0
0-63
1773 code = emit_x86_instruction(compiler, 1 | EX86_SHIFT_INS, src2, src2w, dst, dstw);
executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1 | 0x0020, src2, src2w, dst, dstw);
-
1774 FAIL_IF(!code);
never executed: return compiler->error;
executed: }
Execution Count:63
partially evaluated: __builtin_expect((!code), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:63
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:63
0-63
1775 *code |= mode;
executed (the execution status of this line is deduced): *code |= mode;
-
1776 return SLJIT_SUCCESS;
executed: return 0;
Execution Count:63
63
1777 } -
1778 if (dst == SLJIT_UNUSED) {
never evaluated: dst == 0
0
1779 EMIT_MOV(compiler, TMP_REGISTER, 0, src1, src1w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, (11 + 1), 0, src1, src1w)), 0)
never evaluated: 0
0
1780 code = emit_x86_instruction(compiler, 1 | EX86_SHIFT_INS, src2, src2w, TMP_REGISTER, 0);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1 | 0x0020, src2, src2w, (11 + 1), 0);
-
1781 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1782 *code |= mode;
never executed (the execution status of this line is deduced): *code |= mode;
-
1783 return SLJIT_SUCCESS;
never executed: return 0;
0
1784 } -
1785 if (dst == SLJIT_PREF_SHIFT_REG && src2 == SLJIT_PREF_SHIFT_REG) {
never evaluated: dst == 3
never evaluated: src2 == 3
0
1786 EMIT_MOV(compiler, TMP_REGISTER, 0, src1, src1w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, (11 + 1), 0, src1, src1w)), 0)
never evaluated: 0
0
1787 code = emit_x86_instruction(compiler, 1 | EX86_SHIFT_INS, SLJIT_PREF_SHIFT_REG, 0, TMP_REGISTER, 0);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1 | 0x0020, 3, 0, (11 + 1), 0);
-
1788 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1789 *code |= mode;
never executed (the execution status of this line is deduced): *code |= mode;
-
1790 EMIT_MOV(compiler, SLJIT_PREF_SHIFT_REG, 0, TMP_REGISTER, 0);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, 3, 0, (11 + 1), 0)), 0)
never evaluated: 0
0
1791 return SLJIT_SUCCESS;
never executed: return 0;
0
1792 } -
1793 if (dst >= SLJIT_TEMPORARY_REG1 && dst <= SLJIT_NO_REGISTERS) {
never evaluated: dst >= 1
never evaluated: dst <= 11
0
1794 EMIT_MOV(compiler, dst, 0, src1, src1w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, dst, 0, src1, src1w)), 0)
never evaluated: 0
0
1795 code = emit_x86_instruction(compiler, 1 | EX86_SHIFT_INS, src2, src2w, dst, 0);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1 | 0x0020, src2, src2w, dst, 0);
-
1796 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1797 *code |= mode;
never executed (the execution status of this line is deduced): *code |= mode;
-
1798 return SLJIT_SUCCESS;
never executed: return 0;
0
1799 } -
1800 -
1801 EMIT_MOV(compiler, TMP_REGISTER, 0, src1, src1w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, (11 + 1), 0, src1, src1w)), 0)
never evaluated: 0
0
1802 code = emit_x86_instruction(compiler, 1 | EX86_SHIFT_INS, src2, src2w, TMP_REGISTER, 0);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1 | 0x0020, src2, src2w, (11 + 1), 0);
-
1803 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1804 *code |= mode;
never executed (the execution status of this line is deduced): *code |= mode;
-
1805 EMIT_MOV(compiler, dst, dstw, TMP_REGISTER, 0);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, dst, dstw, (11 + 1), 0)), 0)
never evaluated: 0
0
1806 return SLJIT_SUCCESS;
never executed: return 0;
0
1807 } -
1808 -
1809 if (dst == SLJIT_PREF_SHIFT_REG) {
never evaluated: dst == 3
0
1810 EMIT_MOV(compiler, TMP_REGISTER, 0, src1, src1w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, (11 + 1), 0, src1, src1w)), 0)
never evaluated: 0
0
1811 EMIT_MOV(compiler, SLJIT_PREF_SHIFT_REG, 0, src2, src2w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, 3, 0, src2, src2w)), 0)
never evaluated: 0
0
1812 code = emit_x86_instruction(compiler, 1 | EX86_SHIFT_INS, SLJIT_PREF_SHIFT_REG, 0, TMP_REGISTER, 0);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1 | 0x0020, 3, 0, (11 + 1), 0);
-
1813 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1814 *code |= mode;
never executed (the execution status of this line is deduced): *code |= mode;
-
1815 EMIT_MOV(compiler, SLJIT_PREF_SHIFT_REG, 0, TMP_REGISTER, 0);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, 3, 0, (11 + 1), 0)), 0)
never evaluated: 0
0
1816 }
never executed: }
0
1817 else if (dst >= SLJIT_TEMPORARY_REG1 && dst <= SLJIT_NO_REGISTERS && dst != src2 && !ADDRESSING_DEPENDS_ON(src2, dst)) {
never evaluated: dst >= 1
never evaluated: dst <= 11
never evaluated: dst != src2
never evaluated: ((src2) & 0x100)
never evaluated: ((src2) & 0xf) == dst
never evaluated: (((src2) >> 4) & 0xf) == dst
0
1818 if (src1 != dst)
never evaluated: src1 != dst
0
1819 EMIT_MOV(compiler, dst, 0, src1, src1w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, dst, 0, src1, src1w)), 0)
never evaluated: 0
0
1820 EMIT_MOV(compiler, TMP_REGISTER, 0, SLJIT_PREF_SHIFT_REG, 0);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, (11 + 1), 0, 3, 0)), 0)
never evaluated: 0
0
1821 EMIT_MOV(compiler, SLJIT_PREF_SHIFT_REG, 0, src2, src2w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, 3, 0, src2, src2w)), 0)
never evaluated: 0
0
1822 code = emit_x86_instruction(compiler, 1 | EX86_SHIFT_INS, SLJIT_PREF_SHIFT_REG, 0, dst, 0);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1 | 0x0020, 3, 0, dst, 0);
-
1823 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1824 *code |= mode;
never executed (the execution status of this line is deduced): *code |= mode;
-
1825 EMIT_MOV(compiler, SLJIT_PREF_SHIFT_REG, 0, TMP_REGISTER, 0);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, 3, 0, (11 + 1), 0)), 0)
never evaluated: 0
0
1826 }
never executed: }
0
1827 else { -
1828 /* This case is really difficult, since ecx itself may used for -
1829 addressing, and we must ensure to work even in that case. */ -
1830 EMIT_MOV(compiler, TMP_REGISTER, 0, src1, src1w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, (11 + 1), 0, src1, src1w)), 0)
never evaluated: 0
0
1831#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
1832 EMIT_MOV(compiler, TMP_REG2, 0, SLJIT_PREF_SHIFT_REG, 0);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, (11 + 2), 0, 3, 0)), 0)
never evaluated: 0
0
1833#else -
1834 /* [esp - 4] is reserved for eflags. */ -
1835 EMIT_MOV(compiler, SLJIT_MEM1(SLJIT_LOCALS_REG), -(int)(2 * sizeof(sljit_w)), SLJIT_PREF_SHIFT_REG, 0); -
1836#endif -
1837 EMIT_MOV(compiler, SLJIT_PREF_SHIFT_REG, 0, src2, src2w);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, 3, 0, src2, src2w)), 0)
never evaluated: 0
0
1838 code = emit_x86_instruction(compiler, 1 | EX86_SHIFT_INS, SLJIT_PREF_SHIFT_REG, 0, TMP_REGISTER, 0);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1 | 0x0020, 3, 0, (11 + 1), 0);
-
1839 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
1840 *code |= mode;
never executed (the execution status of this line is deduced): *code |= mode;
-
1841#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
1842 EMIT_MOV(compiler, SLJIT_PREF_SHIFT_REG, 0, TMP_REG2, 0);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, 3, 0, (11 + 2), 0)), 0)
never evaluated: 0
0
1843#else -
1844 /* [esp - 4] is reserved for eflags. */ -
1845 EMIT_MOV(compiler, SLJIT_PREF_SHIFT_REG, 0, SLJIT_MEM1(SLJIT_LOCALS_REG), -(int)(2 * sizeof(sljit_w))); -
1846#endif -
1847 EMIT_MOV(compiler, dst, dstw, TMP_REGISTER, 0);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, dst, dstw, (11 + 1), 0)), 0)
never evaluated: 0
0
1848 }
never executed: }
0
1849 -
1850 return SLJIT_SUCCESS;
never executed: return 0;
0
1851} -
1852 -
1853static int emit_shift_with_flags(struct sljit_compiler *compiler, -
1854 sljit_ub mode, int set_flags, -
1855 int dst, sljit_w dstw, -
1856 int src1, sljit_w src1w, -
1857 int src2, sljit_w src2w) -
1858{ -
1859 /* The CPU does not set flags if the shift count is 0. */ -
1860 if (src2 & SLJIT_IMM) {
partially evaluated: src2 & 0x200
TRUEFALSE
yes
Evaluation Count:63
no
Evaluation Count:0
0-63
1861#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
1862 if ((src2w & 0x3f) != 0 || (compiler->mode32 && (src2w & 0x1f) != 0))
partially evaluated: (src2w & 0x3f) != 0
TRUEFALSE
yes
Evaluation Count:63
no
Evaluation Count:0
never evaluated: compiler->mode32
never evaluated: (src2w & 0x1f) != 0
0-63
1863 return emit_shift(compiler, mode, dst, dstw, src1, src1w, src2, src2w);
executed: return emit_shift(compiler, mode, dst, dstw, src1, src1w, src2, src2w);
Execution Count:63
63
1864#else -
1865 if ((src2w & 0x1f) != 0) -
1866 return emit_shift(compiler, mode, dst, dstw, src1, src1w, src2, src2w); -
1867#endif -
1868 if (!set_flags)
never evaluated: !set_flags
0
1869 return emit_mov(compiler, dst, dstw, src1, src1w);
never executed: return emit_mov(compiler, dst, dstw, src1, src1w);
0
1870 /* OR dst, src, 0 */ -
1871 return emit_cum_binary(compiler, 0x0b, 0x09, 0x1 << 3, 0x0d,
never executed: return emit_cum_binary(compiler, 0x0b, 0x09, 0x1 << 3, 0x0d, dst, dstw, src1, src1w, 0x200, 0);
0
1872 dst, dstw, src1, src1w, SLJIT_IMM, 0);
never executed: return emit_cum_binary(compiler, 0x0b, 0x09, 0x1 << 3, 0x0d, dst, dstw, src1, src1w, 0x200, 0);
0
1873 } -
1874 -
1875 if (!set_flags)
never evaluated: !set_flags
0
1876 return emit_shift(compiler, mode, dst, dstw, src1, src1w, src2, src2w);
never executed: return emit_shift(compiler, mode, dst, dstw, src1, src1w, src2, src2w);
0
1877 -
1878 if (!(dst >= SLJIT_TEMPORARY_REG1 && dst <= SLJIT_NO_REGISTERS))
never evaluated: dst >= 1
never evaluated: dst <= 11
0
1879 FAIL_IF(emit_cmp_binary(compiler, src1, src1w, SLJIT_IMM, 0));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_cmp_binary(compiler, src1, src1w, 0x200, 0)), 0)
never evaluated: 0
0
1880 -
1881 FAIL_IF(emit_shift(compiler,mode, dst, dstw, src1, src1w, src2, src2w));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_shift(compiler,mode, dst, dstw, src1, src1w, src2, src2w)), 0)
never evaluated: 0
0
1882 -
1883 if (dst >= SLJIT_TEMPORARY_REG1 && dst <= SLJIT_NO_REGISTERS)
never evaluated: dst >= 1
never evaluated: dst <= 11
0
1884 return emit_cmp_binary(compiler, dst, dstw, SLJIT_IMM, 0);
never executed: return emit_cmp_binary(compiler, dst, dstw, 0x200, 0);
0
1885 return SLJIT_SUCCESS;
never executed: return 0;
0
1886} -
1887 -
1888SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_op2(struct sljit_compiler *compiler, int op, -
1889 int dst, sljit_w dstw, -
1890 int src1, sljit_w src1w, -
1891 int src2, sljit_w src2w) -
1892{ -
1893 CHECK_ERROR();
never executed: return compiler->error;
executed: }
Execution Count:667
partially evaluated: __builtin_expect((compiler->error), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:667
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:667
0-667
1894 check_sljit_emit_op2(compiler, op, dst, dstw, src1, src1w, src2, src2w);
executed (the execution status of this line is deduced): check_sljit_emit_op2(compiler, op, dst, dstw, src1, src1w, src2, src2w);
-
1895 -
1896#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
1897 compiler->mode32 = op & SLJIT_INT_OP;
executed (the execution status of this line is deduced): compiler->mode32 = op & 0x100;
-
1898#endif -
1899 CHECK_EXTRA_REGS(dst, dstw, (void)0); -
1900 CHECK_EXTRA_REGS(src1, src1w, (void)0); -
1901 CHECK_EXTRA_REGS(src2, src2w, (void)0); -
1902 -
1903 if (GET_OPCODE(op) >= SLJIT_MUL) {
evaluated: ((op) & ~(0x100 | 0x0200 | 0x0400 | 0x0800 | 0x1000 | 0x2000 | 0x4000)) >= 27
TRUEFALSE
yes
Evaluation Count:122
yes
Evaluation Count:545
122-545
1904 if (SLJIT_UNLIKELY(GET_FLAGS(op)))
evaluated: __builtin_expect((((op) & (0x0200 | 0x0400 | 0x0800 | 0x1000 | 0x2000))), 0)
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:119
3-119
1905 compiler->flags_saved = 0;
executed: compiler->flags_saved = 0;
Execution Count:3
3
1906 else if (SLJIT_UNLIKELY(op & SLJIT_KEEP_FLAGS) && !compiler->flags_saved)
partially evaluated: __builtin_expect((op & 0x4000), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:119
never evaluated: !compiler->flags_saved
0-119
1907 FAIL_IF(emit_save_flags(compiler));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_save_flags(compiler)), 0)
never evaluated: 0
0
1908 } -
1909 -
1910 switch (GET_OPCODE(op)) { -
1911 case SLJIT_ADD: -
1912 if (!GET_FLAGS(op)) {
partially evaluated: !((op) & (0x0200 | 0x0400 | 0x0800 | 0x1000 | 0x2000))
TRUEFALSE
yes
Evaluation Count:150
no
Evaluation Count:0
0-150
1913 if (emit_lea_binary(compiler, dst, dstw, src1, src1w, src2, src2w) != SLJIT_ERR_UNSUPPORTED)
evaluated: emit_lea_binary(compiler, dst, dstw, src1, src1w, src2, src2w) != 4
TRUEFALSE
yes
Evaluation Count:15
yes
Evaluation Count:135
15-135
1914 return compiler->error;
executed: return compiler->error;
Execution Count:15
15
1915 }
executed: }
Execution Count:135
135
1916 else -
1917 compiler->flags_saved = 0;
never executed: compiler->flags_saved = 0;
0
1918 if (SLJIT_UNLIKELY(op & SLJIT_KEEP_FLAGS) && !compiler->flags_saved)
partially evaluated: __builtin_expect((op & 0x4000), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:135
never evaluated: !compiler->flags_saved
0-135
1919 FAIL_IF(emit_save_flags(compiler));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_save_flags(compiler)), 0)
never evaluated: 0
0
1920 return emit_cum_binary(compiler, 0x03, 0x01, 0x0 << 3, 0x05,
executed: return emit_cum_binary(compiler, 0x03, 0x01, 0x0 << 3, 0x05, dst, dstw, src1, src1w, src2, src2w);
Execution Count:135
135
1921 dst, dstw, src1, src1w, src2, src2w);
executed: return emit_cum_binary(compiler, 0x03, 0x01, 0x0 << 3, 0x05, dst, dstw, src1, src1w, src2, src2w);
Execution Count:135
135
1922 case SLJIT_ADDC: -
1923 if (SLJIT_UNLIKELY(compiler->flags_saved)) /* C flag must be restored. */
never evaluated: __builtin_expect((compiler->flags_saved), 0)
0
1924 FAIL_IF(emit_restore_flags(compiler, 1));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_restore_flags(compiler, 1)), 0)
never evaluated: 0
0
1925 else if (SLJIT_UNLIKELY(op & SLJIT_KEEP_FLAGS))
never evaluated: __builtin_expect((op & 0x4000), 0)
0
1926 FAIL_IF(emit_save_flags(compiler));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_save_flags(compiler)), 0)
never evaluated: 0
0
1927 if (SLJIT_UNLIKELY(GET_FLAGS(op)))
never evaluated: __builtin_expect((((op) & (0x0200 | 0x0400 | 0x0800 | 0x1000 | 0x2000))), 0)
0
1928 compiler->flags_saved = 0;
never executed: compiler->flags_saved = 0;
0
1929 return emit_cum_binary(compiler, 0x13, 0x11, 0x2 << 3, 0x15,
never executed: return emit_cum_binary(compiler, 0x13, 0x11, 0x2 << 3, 0x15, dst, dstw, src1, src1w, src2, src2w);
0
1930 dst, dstw, src1, src1w, src2, src2w);
never executed: return emit_cum_binary(compiler, 0x13, 0x11, 0x2 << 3, 0x15, dst, dstw, src1, src1w, src2, src2w);
0
1931 case SLJIT_SUB: -
1932 if (!GET_FLAGS(op)) {
evaluated: !((op) & (0x0200 | 0x0400 | 0x0800 | 0x1000 | 0x2000))
TRUEFALSE
yes
Evaluation Count:90
yes
Evaluation Count:305
90-305
1933 if ((src2 & SLJIT_IMM) && emit_lea_binary(compiler, dst, dstw, src1, src1w, SLJIT_IMM, -src2w) != SLJIT_ERR_UNSUPPORTED)
evaluated: (src2 & 0x200)
TRUEFALSE
yes
Evaluation Count:60
yes
Evaluation Count:30
partially evaluated: emit_lea_binary(compiler, dst, dstw, src1, src1w, 0x200, -src2w) != 4
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:60
0-60
1934 return compiler->error;
never executed: return compiler->error;
0
1935 }
executed: }
Execution Count:90
90
1936 else -
1937 compiler->flags_saved = 0;
executed: compiler->flags_saved = 0;
Execution Count:305
305
1938 if (SLJIT_UNLIKELY(op & SLJIT_KEEP_FLAGS) && !compiler->flags_saved)
partially evaluated: __builtin_expect((op & 0x4000), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:395
never evaluated: !compiler->flags_saved
0-395
1939 FAIL_IF(emit_save_flags(compiler));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_save_flags(compiler)), 0)
never evaluated: 0
0
1940 if (dst == SLJIT_UNUSED)
evaluated: dst == 0
TRUEFALSE
yes
Evaluation Count:282
yes
Evaluation Count:113
113-282
1941 return emit_cmp_binary(compiler, src1, src1w, src2, src2w);
executed: return emit_cmp_binary(compiler, src1, src1w, src2, src2w);
Execution Count:282
282
1942 return emit_non_cum_binary(compiler, 0x2b, 0x29, 0x5 << 3, 0x2d,
executed: return emit_non_cum_binary(compiler, 0x2b, 0x29, 0x5 << 3, 0x2d, dst, dstw, src1, src1w, src2, src2w);
Execution Count:113
113
1943 dst, dstw, src1, src1w, src2, src2w);
executed: return emit_non_cum_binary(compiler, 0x2b, 0x29, 0x5 << 3, 0x2d, dst, dstw, src1, src1w, src2, src2w);
Execution Count:113
113
1944 case SLJIT_SUBC: -
1945 if (SLJIT_UNLIKELY(compiler->flags_saved)) /* C flag must be restored. */
never evaluated: __builtin_expect((compiler->flags_saved), 0)
0
1946 FAIL_IF(emit_restore_flags(compiler, 1));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_restore_flags(compiler, 1)), 0)
never evaluated: 0
0
1947 else if (SLJIT_UNLIKELY(op & SLJIT_KEEP_FLAGS))
never evaluated: __builtin_expect((op & 0x4000), 0)
0
1948 FAIL_IF(emit_save_flags(compiler));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_save_flags(compiler)), 0)
never evaluated: 0
0
1949 if (SLJIT_UNLIKELY(GET_FLAGS(op)))
never evaluated: __builtin_expect((((op) & (0x0200 | 0x0400 | 0x0800 | 0x1000 | 0x2000))), 0)
0
1950 compiler->flags_saved = 0;
never executed: compiler->flags_saved = 0;
0
1951 return emit_non_cum_binary(compiler, 0x1b, 0x19, 0x3 << 3, 0x1d,
never executed: return emit_non_cum_binary(compiler, 0x1b, 0x19, 0x3 << 3, 0x1d, dst, dstw, src1, src1w, src2, src2w);
0
1952 dst, dstw, src1, src1w, src2, src2w);
never executed: return emit_non_cum_binary(compiler, 0x1b, 0x19, 0x3 << 3, 0x1d, dst, dstw, src1, src1w, src2, src2w);
0
1953 case SLJIT_MUL: -
1954 return emit_mul(compiler, dst, dstw, src1, src1w, src2, src2w);
never executed: return emit_mul(compiler, dst, dstw, src1, src1w, src2, src2w);
0
1955 case SLJIT_AND: -
1956 if (dst == SLJIT_UNUSED)
partially evaluated: dst == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:49
0-49
1957 return emit_test_binary(compiler, src1, src1w, src2, src2w);
never executed: return emit_test_binary(compiler, src1, src1w, src2, src2w);
0
1958 return emit_cum_binary(compiler, 0x23, 0x21, 0x4 << 3, 0x25,
executed: return emit_cum_binary(compiler, 0x23, 0x21, 0x4 << 3, 0x25, dst, dstw, src1, src1w, src2, src2w);
Execution Count:49
49
1959 dst, dstw, src1, src1w, src2, src2w);
executed: return emit_cum_binary(compiler, 0x23, 0x21, 0x4 << 3, 0x25, dst, dstw, src1, src1w, src2, src2w);
Execution Count:49
49
1960 case SLJIT_OR: -
1961 return emit_cum_binary(compiler, 0x0b, 0x09, 0x1 << 3, 0x0d,
executed: return emit_cum_binary(compiler, 0x0b, 0x09, 0x1 << 3, 0x0d, dst, dstw, src1, src1w, src2, src2w);
Execution Count:9
9
1962 dst, dstw, src1, src1w, src2, src2w);
executed: return emit_cum_binary(compiler, 0x0b, 0x09, 0x1 << 3, 0x0d, dst, dstw, src1, src1w, src2, src2w);
Execution Count:9
9
1963 case SLJIT_XOR: -
1964 return emit_cum_binary(compiler, 0x33, 0x31, 0x6 << 3, 0x35,
executed: return emit_cum_binary(compiler, 0x33, 0x31, 0x6 << 3, 0x35, dst, dstw, src1, src1w, src2, src2w);
Execution Count:1
1
1965 dst, dstw, src1, src1w, src2, src2w);
executed: return emit_cum_binary(compiler, 0x33, 0x31, 0x6 << 3, 0x35, dst, dstw, src1, src1w, src2, src2w);
Execution Count:1
1
1966 case SLJIT_SHL: -
1967 return emit_shift_with_flags(compiler, 0x4 << 3, GET_FLAGS(op),
executed: return emit_shift_with_flags(compiler, 0x4 << 3, ((op) & (0x0200 | 0x0400 | 0x0800 | 0x1000 | 0x2000)), dst, dstw, src1, src1w, src2, src2w);
Execution Count:46
46
1968 dst, dstw, src1, src1w, src2, src2w);
executed: return emit_shift_with_flags(compiler, 0x4 << 3, ((op) & (0x0200 | 0x0400 | 0x0800 | 0x1000 | 0x2000)), dst, dstw, src1, src1w, src2, src2w);
Execution Count:46
46
1969 case SLJIT_LSHR: -
1970 return emit_shift_with_flags(compiler, 0x5 << 3, GET_FLAGS(op),
executed: return emit_shift_with_flags(compiler, 0x5 << 3, ((op) & (0x0200 | 0x0400 | 0x0800 | 0x1000 | 0x2000)), dst, dstw, src1, src1w, src2, src2w);
Execution Count:2
2
1971 dst, dstw, src1, src1w, src2, src2w);
executed: return emit_shift_with_flags(compiler, 0x5 << 3, ((op) & (0x0200 | 0x0400 | 0x0800 | 0x1000 | 0x2000)), dst, dstw, src1, src1w, src2, src2w);
Execution Count:2
2
1972 case SLJIT_ASHR: -
1973 return emit_shift_with_flags(compiler, 0x7 << 3, GET_FLAGS(op),
executed: return emit_shift_with_flags(compiler, 0x7 << 3, ((op) & (0x0200 | 0x0400 | 0x0800 | 0x1000 | 0x2000)), dst, dstw, src1, src1w, src2, src2w);
Execution Count:15
15
1974 dst, dstw, src1, src1w, src2, src2w);
executed: return emit_shift_with_flags(compiler, 0x7 << 3, ((op) & (0x0200 | 0x0400 | 0x0800 | 0x1000 | 0x2000)), dst, dstw, src1, src1w, src2, src2w);
Execution Count:15
15
1975 } -
1976 -
1977 return SLJIT_SUCCESS;
never executed: return 0;
0
1978} -
1979 -
1980SLJIT_API_FUNC_ATTRIBUTE int sljit_get_register_index(int reg) -
1981{ -
1982 check_sljit_get_register_index(reg);
never executed (the execution status of this line is deduced): check_sljit_get_register_index(reg);
-
1983#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
1984 if (reg == SLJIT_TEMPORARY_EREG1 || reg == SLJIT_TEMPORARY_EREG2 -
1985 || reg == SLJIT_SAVED_EREG1 || reg == SLJIT_SAVED_EREG2) -
1986 return -1; -
1987#endif -
1988 return reg_map[reg];
never executed: return reg_map[reg];
0
1989} -
1990 -
1991SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_op_custom(struct sljit_compiler *compiler, -
1992 void *instruction, int size) -
1993{ -
1994 sljit_ub *buf;
never executed (the execution status of this line is deduced): sljit_ub *buf;
-
1995 -
1996 CHECK_ERROR();
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((compiler->error), 0)
never evaluated: 0
0
1997 check_sljit_emit_op_custom(compiler, instruction, size);
never executed (the execution status of this line is deduced): check_sljit_emit_op_custom(compiler, instruction, size);
-
1998 SLJIT_ASSERT(size > 0 && size < 16);
never executed: }
never evaluated: 0
0
1999 -
2000 buf = (sljit_ub*)ensure_buf(compiler, 1 + size);
never executed (the execution status of this line is deduced): buf = (sljit_ub*)ensure_buf(compiler, 1 + size);
-
2001 FAIL_IF(!buf);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!buf), 0)
never evaluated: 0
0
2002 INC_SIZE(size);
never executed (the execution status of this line is deduced): (*buf++ = (size), compiler->size += (size));
-
2003 SLJIT_MEMMOVE(buf, instruction, size);
never executed (the execution status of this line is deduced): memmove(buf, instruction, size);
-
2004 return SLJIT_SUCCESS;
never executed: return 0;
0
2005} -
2006 -
2007/* --------------------------------------------------------------------- */ -
2008/* Floating point operators */ -
2009/* --------------------------------------------------------------------- */ -
2010 -
2011#if (defined SLJIT_SSE2_AUTO && SLJIT_SSE2_AUTO) -
2012static int sse2_available = 0; -
2013#endif -
2014 -
2015#if (defined SLJIT_SSE2 && SLJIT_SSE2) -
2016 -
2017/* Alignment + 2 * 16 bytes. */ -
2018static sljit_i sse2_data[3 + 4 + 4]; -
2019static sljit_i *sse2_buffer; -
2020 -
2021static void init_compiler() -
2022{ -
2023#if (defined SLJIT_SSE2_AUTO && SLJIT_SSE2_AUTO) -
2024 int features = 0; -
2025#endif -
2026 -
2027 sse2_buffer = (sljit_i*)(((sljit_uw)sse2_data + 15) & ~0xf);
executed (the execution status of this line is deduced): sse2_buffer = (sljit_i*)(((sljit_uw)sse2_data + 15) & ~0xf);
-
2028 sse2_buffer[0] = 0;
executed (the execution status of this line is deduced): sse2_buffer[0] = 0;
-
2029 sse2_buffer[1] = 0x80000000;
executed (the execution status of this line is deduced): sse2_buffer[1] = 0x80000000;
-
2030 sse2_buffer[4] = 0xffffffff;
executed (the execution status of this line is deduced): sse2_buffer[4] = 0xffffffff;
-
2031 sse2_buffer[5] = 0x7fffffff;
executed (the execution status of this line is deduced): sse2_buffer[5] = 0x7fffffff;
-
2032 -
2033#if (defined SLJIT_SSE2_AUTO && SLJIT_SSE2_AUTO) -
2034#ifdef __GNUC__ -
2035 /* AT&T syntax. */ -
2036 asm ( -
2037 "pushl %%ebx\n" -
2038 "movl $0x1, %%eax\n" -
2039 "cpuid\n" -
2040 "popl %%ebx\n" -
2041 "movl %%edx, %0\n" -
2042 : "=g" (features) -
2043 : -
2044 : "%eax", "%ecx", "%edx" -
2045 ); -
2046#elif defined(_MSC_VER) || defined(__BORLANDC__) -
2047 /* Intel syntax. */ -
2048 __asm { -
2049 mov eax, 1 -
2050 push ebx -
2051 cpuid -
2052 pop ebx -
2053 mov features, edx -
2054 } -
2055#else -
2056 #error "SLJIT_SSE2_AUTO is not implemented for this C compiler" -
2057#endif -
2058 sse2_available = (features >> 26) & 0x1; -
2059#endif -
2060}
executed: }
Execution Count:2
2
2061 -
2062#endif -
2063 -
2064SLJIT_API_FUNC_ATTRIBUTE int sljit_is_fpu_available(void) -
2065{ -
2066 /* Always available. */ -
2067 return 1;
never executed: return 1;
0
2068} -
2069 -
2070#if (defined SLJIT_SSE2 && SLJIT_SSE2) -
2071 -
2072static int emit_sse2(struct sljit_compiler *compiler, sljit_ub opcode, -
2073 int xmm1, int xmm2, sljit_w xmm2w) -
2074{ -
2075 sljit_ub *buf;
never executed (the execution status of this line is deduced): sljit_ub *buf;
-
2076 -
2077 buf = emit_x86_instruction(compiler, 2 | EX86_PREF_F2 | EX86_SSE2, xmm1, 0, xmm2, xmm2w);
never executed (the execution status of this line is deduced): buf = emit_x86_instruction(compiler, 2 | 0x0800 | 0x1000, xmm1, 0, xmm2, xmm2w);
-
2078 FAIL_IF(!buf);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!buf), 0)
never evaluated: 0
0
2079 *buf++ = 0x0f;
never executed (the execution status of this line is deduced): *buf++ = 0x0f;
-
2080 *buf = opcode;
never executed (the execution status of this line is deduced): *buf = opcode;
-
2081 return SLJIT_SUCCESS;
never executed: return 0;
0
2082} -
2083 -
2084static int emit_sse2_logic(struct sljit_compiler *compiler, sljit_ub opcode, -
2085 int xmm1, int xmm2, sljit_w xmm2w) -
2086{ -
2087 sljit_ub *buf;
never executed (the execution status of this line is deduced): sljit_ub *buf;
-
2088 -
2089 buf = emit_x86_instruction(compiler, 2 | EX86_PREF_66 | EX86_SSE2, xmm1, 0, xmm2, xmm2w);
never executed (the execution status of this line is deduced): buf = emit_x86_instruction(compiler, 2 | 0x0400 | 0x1000, xmm1, 0, xmm2, xmm2w);
-
2090 FAIL_IF(!buf);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!buf), 0)
never evaluated: 0
0
2091 *buf++ = 0x0f;
never executed (the execution status of this line is deduced): *buf++ = 0x0f;
-
2092 *buf = opcode;
never executed (the execution status of this line is deduced): *buf = opcode;
-
2093 return SLJIT_SUCCESS;
never executed: return 0;
0
2094} -
2095 -
2096static SLJIT_INLINE int emit_sse2_load(struct sljit_compiler *compiler, -
2097 int dst, int src, sljit_w srcw) -
2098{ -
2099 return emit_sse2(compiler, 0x10, dst, src, srcw);
never executed: return emit_sse2(compiler, 0x10, dst, src, srcw);
0
2100} -
2101 -
2102static SLJIT_INLINE int emit_sse2_store(struct sljit_compiler *compiler, -
2103 int dst, sljit_w dstw, int src) -
2104{ -
2105 return emit_sse2(compiler, 0x11, src, dst, dstw);
never executed: return emit_sse2(compiler, 0x11, src, dst, dstw);
0
2106} -
2107 -
2108#if !(defined SLJIT_SSE2_AUTO && SLJIT_SSE2_AUTO) -
2109SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_fop1(struct sljit_compiler *compiler, int op, -
2110#else -
2111static int sljit_emit_sse2_fop1(struct sljit_compiler *compiler, int op, -
2112#endif -
2113 int dst, sljit_w dstw, -
2114 int src, sljit_w srcw) -
2115{ -
2116 int dst_r;
never executed (the execution status of this line is deduced): int dst_r;
-
2117 -
2118 CHECK_ERROR();
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((compiler->error), 0)
never evaluated: 0
0
2119 check_sljit_emit_fop1(compiler, op, dst, dstw, src, srcw);
never executed (the execution status of this line is deduced): check_sljit_emit_fop1(compiler, op, dst, dstw, src, srcw);
-
2120 -
2121#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
2122 compiler->mode32 = 1;
never executed (the execution status of this line is deduced): compiler->mode32 = 1;
-
2123#endif -
2124 -
2125 if (GET_OPCODE(op) == SLJIT_FCMP) {
never evaluated: ((op) & ~(0x100 | 0x0200 | 0x0400 | 0x0800 | 0x1000 | 0x2000 | 0x4000)) == 34
0
2126 compiler->flags_saved = 0;
never executed (the execution status of this line is deduced): compiler->flags_saved = 0;
-
2127 if (dst >= SLJIT_FLOAT_REG1 && dst <= SLJIT_FLOAT_REG4)
never evaluated: dst >= 1
never evaluated: dst <= 4
0
2128 dst_r = dst;
never executed: dst_r = dst;
0
2129 else { -
2130 dst_r = TMP_FREG;
never executed (the execution status of this line is deduced): dst_r = (4 + 1);
-
2131 FAIL_IF(emit_sse2_load(compiler, dst_r, dst, dstw));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_sse2_load(compiler, dst_r, dst, dstw)), 0)
never evaluated: 0
0
2132 }
never executed: }
0
2133 return emit_sse2_logic(compiler, 0x2e, dst_r, src, srcw);
never executed: return emit_sse2_logic(compiler, 0x2e, dst_r, src, srcw);
0
2134 } -
2135 -
2136 if (op == SLJIT_FMOV) {
never evaluated: op == 35
0
2137 if (dst >= SLJIT_FLOAT_REG1 && dst <= SLJIT_FLOAT_REG4)
never evaluated: dst >= 1
never evaluated: dst <= 4
0
2138 return emit_sse2_load(compiler, dst, src, srcw);
never executed: return emit_sse2_load(compiler, dst, src, srcw);
0
2139 if (src >= SLJIT_FLOAT_REG1 && src <= SLJIT_FLOAT_REG4)
never evaluated: src >= 1
never evaluated: src <= 4
0
2140 return emit_sse2_store(compiler, dst, dstw, src);
never executed: return emit_sse2_store(compiler, dst, dstw, src);
0
2141 FAIL_IF(emit_sse2_load(compiler, TMP_FREG, src, srcw));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_sse2_load(compiler, (4 + 1), src, srcw)), 0)
never evaluated: 0
0
2142 return emit_sse2_store(compiler, dst, dstw, TMP_FREG);
never executed: return emit_sse2_store(compiler, dst, dstw, (4 + 1));
0
2143 } -
2144 -
2145 if (dst >= SLJIT_FLOAT_REG1 && dst <= SLJIT_FLOAT_REG4) {
never evaluated: dst >= 1
never evaluated: dst <= 4
0
2146 dst_r = dst;
never executed (the execution status of this line is deduced): dst_r = dst;
-
2147 if (dst != src)
never evaluated: dst != src
0
2148 FAIL_IF(emit_sse2_load(compiler, dst_r, src, srcw));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_sse2_load(compiler, dst_r, src, srcw)), 0)
never evaluated: 0
0
2149 }
never executed: }
0
2150 else { -
2151 dst_r = TMP_FREG;
never executed (the execution status of this line is deduced): dst_r = (4 + 1);
-
2152 FAIL_IF(emit_sse2_load(compiler, dst_r, src, srcw));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_sse2_load(compiler, dst_r, src, srcw)), 0)
never evaluated: 0
0
2153 }
never executed: }
0
2154 -
2155 switch (op) { -
2156 case SLJIT_FNEG: -
2157 FAIL_IF(emit_sse2_logic(compiler, 0x57, dst_r, SLJIT_MEM0(), (sljit_w)sse2_buffer));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_sse2_logic(compiler, 0x57, dst_r, (0x100), (sljit_w)sse2_buffer)), 0)
never evaluated: 0
0
2158 break;
never executed: break;
0
2159 -
2160 case SLJIT_FABS: -
2161 FAIL_IF(emit_sse2_logic(compiler, 0x54, dst_r, SLJIT_MEM0(), (sljit_w)(sse2_buffer + 4)));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_sse2_logic(compiler, 0x54, dst_r, (0x100), (sljit_w)(sse2_buffer + 4))), 0)
never evaluated: 0
0
2162 break;
never executed: break;
0
2163 } -
2164 -
2165 if (dst_r == TMP_FREG)
never evaluated: dst_r == (4 + 1)
0
2166 return emit_sse2_store(compiler, dst, dstw, TMP_FREG);
never executed: return emit_sse2_store(compiler, dst, dstw, (4 + 1));
0
2167 return SLJIT_SUCCESS;
never executed: return 0;
0
2168} -
2169 -
2170#if !(defined SLJIT_SSE2_AUTO && SLJIT_SSE2_AUTO) -
2171SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_fop2(struct sljit_compiler *compiler, int op, -
2172#else -
2173static int sljit_emit_sse2_fop2(struct sljit_compiler *compiler, int op, -
2174#endif -
2175 int dst, sljit_w dstw, -
2176 int src1, sljit_w src1w, -
2177 int src2, sljit_w src2w) -
2178{ -
2179 int dst_r;
never executed (the execution status of this line is deduced): int dst_r;
-
2180 -
2181 CHECK_ERROR();
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((compiler->error), 0)
never evaluated: 0
0
2182 check_sljit_emit_fop2(compiler, op, dst, dstw, src1, src1w, src2, src2w);
never executed (the execution status of this line is deduced): check_sljit_emit_fop2(compiler, op, dst, dstw, src1, src1w, src2, src2w);
-
2183 -
2184#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
2185 compiler->mode32 = 1;
never executed (the execution status of this line is deduced): compiler->mode32 = 1;
-
2186#endif -
2187 -
2188 if (dst >= SLJIT_FLOAT_REG1 && dst <= SLJIT_FLOAT_REG4) {
never evaluated: dst >= 1
never evaluated: dst <= 4
0
2189 dst_r = dst;
never executed (the execution status of this line is deduced): dst_r = dst;
-
2190 if (dst == src1)
never evaluated: dst == src1
0
2191 ; /* Do nothing here. */
never executed: ;
0
2192 else if (dst == src2 && (op == SLJIT_FADD || op == SLJIT_FMUL)) {
never evaluated: dst == src2
never evaluated: op == 38
never evaluated: op == 40
0
2193 /* Swap arguments. */ -
2194 src2 = src1;
never executed (the execution status of this line is deduced): src2 = src1;
-
2195 src2w = src1w;
never executed (the execution status of this line is deduced): src2w = src1w;
-
2196 }
never executed: }
0
2197 else if (dst != src2)
never evaluated: dst != src2
0
2198 FAIL_IF(emit_sse2_load(compiler, dst_r, src1, src1w));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_sse2_load(compiler, dst_r, src1, src1w)), 0)
never evaluated: 0
0
2199 else { -
2200 dst_r = TMP_FREG;
never executed (the execution status of this line is deduced): dst_r = (4 + 1);
-
2201 FAIL_IF(emit_sse2_load(compiler, TMP_FREG, src1, src1w));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_sse2_load(compiler, (4 + 1), src1, src1w)), 0)
never evaluated: 0
0
2202 }
never executed: }
0
2203 } -
2204 else { -
2205 dst_r = TMP_FREG;
never executed (the execution status of this line is deduced): dst_r = (4 + 1);
-
2206 FAIL_IF(emit_sse2_load(compiler, TMP_FREG, src1, src1w));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_sse2_load(compiler, (4 + 1), src1, src1w)), 0)
never evaluated: 0
0
2207 }
never executed: }
0
2208 -
2209 switch (op) { -
2210 case SLJIT_FADD: -
2211 FAIL_IF(emit_sse2(compiler, 0x58, dst_r, src2, src2w));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_sse2(compiler, 0x58, dst_r, src2, src2w)), 0)
never evaluated: 0
0
2212 break;
never executed: break;
0
2213 -
2214 case SLJIT_FSUB: -
2215 FAIL_IF(emit_sse2(compiler, 0x5c, dst_r, src2, src2w));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_sse2(compiler, 0x5c, dst_r, src2, src2w)), 0)
never evaluated: 0
0
2216 break;
never executed: break;
0
2217 -
2218 case SLJIT_FMUL: -
2219 FAIL_IF(emit_sse2(compiler, 0x59, dst_r, src2, src2w));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_sse2(compiler, 0x59, dst_r, src2, src2w)), 0)
never evaluated: 0
0
2220 break;
never executed: break;
0
2221 -
2222 case SLJIT_FDIV: -
2223 FAIL_IF(emit_sse2(compiler, 0x5e, dst_r, src2, src2w));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_sse2(compiler, 0x5e, dst_r, src2, src2w)), 0)
never evaluated: 0
0
2224 break;
never executed: break;
0
2225 } -
2226 -
2227 if (dst_r == TMP_FREG)
never evaluated: dst_r == (4 + 1)
0
2228 return emit_sse2_store(compiler, dst, dstw, TMP_FREG);
never executed: return emit_sse2_store(compiler, dst, dstw, (4 + 1));
0
2229 return SLJIT_SUCCESS;
never executed: return 0;
0
2230} -
2231 -
2232#endif -
2233 -
2234#if (defined SLJIT_SSE2_AUTO && SLJIT_SSE2_AUTO) || !(defined SLJIT_SSE2 && SLJIT_SSE2) -
2235 -
2236static int emit_fld(struct sljit_compiler *compiler, -
2237 int src, sljit_w srcw) -
2238{ -
2239 sljit_ub *buf; -
2240 -
2241 if (src >= SLJIT_FLOAT_REG1 && src <= SLJIT_FLOAT_REG4) { -
2242 buf = (sljit_ub*)ensure_buf(compiler, 1 + 2); -
2243 FAIL_IF(!buf); -
2244 INC_SIZE(2); -
2245 *buf++ = 0xd9; -
2246 *buf = 0xc0 + src - 1; -
2247 return SLJIT_SUCCESS; -
2248 } -
2249 -
2250 buf = emit_x86_instruction(compiler, 1, 0, 0, src, srcw); -
2251 FAIL_IF(!buf); -
2252 *buf = 0xdd; -
2253 return SLJIT_SUCCESS; -
2254} -
2255 -
2256static int emit_fop(struct sljit_compiler *compiler, -
2257 sljit_ub st_arg, sljit_ub st_arg2, -
2258 sljit_ub m64fp_arg, sljit_ub m64fp_arg2, -
2259 int src, sljit_w srcw) -
2260{ -
2261 sljit_ub *buf; -
2262 -
2263 if (src >= SLJIT_FLOAT_REG1 && src <= SLJIT_FLOAT_REG4) { -
2264 buf = (sljit_ub*)ensure_buf(compiler, 1 + 2); -
2265 FAIL_IF(!buf); -
2266 INC_SIZE(2); -
2267 *buf++ = st_arg; -
2268 *buf = st_arg2 + src; -
2269 return SLJIT_SUCCESS; -
2270 } -
2271 -
2272 buf = emit_x86_instruction(compiler, 1, 0, 0, src, srcw); -
2273 FAIL_IF(!buf); -
2274 *buf++ = m64fp_arg; -
2275 *buf |= m64fp_arg2; -
2276 return SLJIT_SUCCESS; -
2277} -
2278 -
2279static int emit_fop_regs(struct sljit_compiler *compiler, -
2280 sljit_ub st_arg, sljit_ub st_arg2, -
2281 int src) -
2282{ -
2283 sljit_ub *buf; -
2284 -
2285 buf = (sljit_ub*)ensure_buf(compiler, 1 + 2); -
2286 FAIL_IF(!buf); -
2287 INC_SIZE(2); -
2288 *buf++ = st_arg; -
2289 *buf = st_arg2 + src; -
2290 return SLJIT_SUCCESS; -
2291} -
2292 -
2293#if !(defined SLJIT_SSE2_AUTO && SLJIT_SSE2_AUTO) -
2294SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_fop1(struct sljit_compiler *compiler, int op, -
2295#else -
2296static int sljit_emit_fpu_fop1(struct sljit_compiler *compiler, int op, -
2297#endif -
2298 int dst, sljit_w dstw, -
2299 int src, sljit_w srcw) -
2300{ -
2301#if !(defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
2302 sljit_ub *buf; -
2303#endif -
2304 -
2305 CHECK_ERROR(); -
2306 check_sljit_emit_fop1(compiler, op, dst, dstw, src, srcw); -
2307 -
2308#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
2309 compiler->mode32 = 1; -
2310#endif -
2311 -
2312 if (GET_OPCODE(op) == SLJIT_FCMP) { -
2313 compiler->flags_saved = 0; -
2314#if !(defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
2315 FAIL_IF(emit_fld(compiler, dst, dstw)); -
2316 FAIL_IF(emit_fop(compiler, 0xd8, 0xd8, 0xdc, 0x3 << 3, src, srcw)); -
2317 -
2318 /* Copy flags. */ -
2319 EMIT_MOV(compiler, TMP_REGISTER, 0, SLJIT_TEMPORARY_REG1, 0); -
2320 buf = (sljit_ub*)ensure_buf(compiler, 1 + 3); -
2321 FAIL_IF(!buf); -
2322 INC_SIZE(3); -
2323 *buf++ = 0xdf; -
2324 *buf++ = 0xe0; -
2325 /* Note: lahf is not supported on all x86-64 architectures. */ -
2326 *buf++ = 0x9e; -
2327 EMIT_MOV(compiler, SLJIT_TEMPORARY_REG1, 0, TMP_REGISTER, 0); -
2328#else -
2329 if (src >= SLJIT_FLOAT_REG1 && src <= SLJIT_FLOAT_REG4) { -
2330 FAIL_IF(emit_fld(compiler, dst, dstw)); -
2331 FAIL_IF(emit_fop_regs(compiler, 0xdf, 0xe8, src)); -
2332 } else { -
2333 FAIL_IF(emit_fld(compiler, src, srcw)); -
2334 FAIL_IF(emit_fld(compiler, dst + ((dst >= SLJIT_FLOAT_REG1 && dst <= SLJIT_FLOAT_REG4) ? 1 : 0), dstw)); -
2335 FAIL_IF(emit_fop_regs(compiler, 0xdf, 0xe8, src)); -
2336 FAIL_IF(emit_fop_regs(compiler, 0xdd, 0xd8, 0)); -
2337 } -
2338#endif -
2339 return SLJIT_SUCCESS; -
2340 } -
2341 -
2342 FAIL_IF(emit_fld(compiler, src, srcw)); -
2343 -
2344 switch (op) { -
2345 case SLJIT_FNEG: -
2346 FAIL_IF(emit_fop_regs(compiler, 0xd9, 0xe0, 0)); -
2347 break; -
2348 case SLJIT_FABS: -
2349 FAIL_IF(emit_fop_regs(compiler, 0xd9, 0xe1, 0)); -
2350 break; -
2351 } -
2352 -
2353 FAIL_IF(emit_fop(compiler, 0xdd, 0xd8, 0xdd, 0x3 << 3, dst, dstw)); -
2354 -
2355 return SLJIT_SUCCESS; -
2356} -
2357 -
2358#if !(defined SLJIT_SSE2_AUTO && SLJIT_SSE2_AUTO) -
2359SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_fop2(struct sljit_compiler *compiler, int op, -
2360#else -
2361static int sljit_emit_fpu_fop2(struct sljit_compiler *compiler, int op, -
2362#endif -
2363 int dst, sljit_w dstw, -
2364 int src1, sljit_w src1w, -
2365 int src2, sljit_w src2w) -
2366{ -
2367 CHECK_ERROR(); -
2368 check_sljit_emit_fop2(compiler, op, dst, dstw, src1, src1w, src2, src2w); -
2369 -
2370#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
2371 compiler->mode32 = 1; -
2372#endif -
2373 -
2374 if (src1 >= SLJIT_FLOAT_REG1 && src1 <= SLJIT_FLOAT_REG4 && dst == src1) { -
2375 FAIL_IF(emit_fld(compiler, src2, src2w)); -
2376 -
2377 switch (op) { -
2378 case SLJIT_FADD: -
2379 FAIL_IF(emit_fop_regs(compiler, 0xde, 0xc0, src1)); -
2380 break; -
2381 case SLJIT_FSUB: -
2382 FAIL_IF(emit_fop_regs(compiler, 0xde, 0xe8, src1)); -
2383 break; -
2384 case SLJIT_FMUL: -
2385 FAIL_IF(emit_fop_regs(compiler, 0xde, 0xc8, src1)); -
2386 break; -
2387 case SLJIT_FDIV: -
2388 FAIL_IF(emit_fop_regs(compiler, 0xde, 0xf8, src1)); -
2389 break; -
2390 } -
2391 return SLJIT_SUCCESS; -
2392 } -
2393 -
2394 FAIL_IF(emit_fld(compiler, src1, src1w)); -
2395 -
2396 if (src2 >= SLJIT_FLOAT_REG1 && src2 <= SLJIT_FLOAT_REG4 && dst == src2) { -
2397 switch (op) { -
2398 case SLJIT_FADD: -
2399 FAIL_IF(emit_fop_regs(compiler, 0xde, 0xc0, src2)); -
2400 break; -
2401 case SLJIT_FSUB: -
2402 FAIL_IF(emit_fop_regs(compiler, 0xde, 0xe0, src2)); -
2403 break; -
2404 case SLJIT_FMUL: -
2405 FAIL_IF(emit_fop_regs(compiler, 0xde, 0xc8, src2)); -
2406 break; -
2407 case SLJIT_FDIV: -
2408 FAIL_IF(emit_fop_regs(compiler, 0xde, 0xf0, src2)); -
2409 break; -
2410 } -
2411 return SLJIT_SUCCESS; -
2412 } -
2413 -
2414 switch (op) { -
2415 case SLJIT_FADD: -
2416 FAIL_IF(emit_fop(compiler, 0xd8, 0xc0, 0xdc, 0x0 << 3, src2, src2w)); -
2417 break; -
2418 case SLJIT_FSUB: -
2419 FAIL_IF(emit_fop(compiler, 0xd8, 0xe0, 0xdc, 0x4 << 3, src2, src2w)); -
2420 break; -
2421 case SLJIT_FMUL: -
2422 FAIL_IF(emit_fop(compiler, 0xd8, 0xc8, 0xdc, 0x1 << 3, src2, src2w)); -
2423 break; -
2424 case SLJIT_FDIV: -
2425 FAIL_IF(emit_fop(compiler, 0xd8, 0xf0, 0xdc, 0x6 << 3, src2, src2w)); -
2426 break; -
2427 } -
2428 -
2429 FAIL_IF(emit_fop(compiler, 0xdd, 0xd8, 0xdd, 0x3 << 3, dst, dstw)); -
2430 -
2431 return SLJIT_SUCCESS; -
2432} -
2433#endif -
2434 -
2435#if (defined SLJIT_SSE2_AUTO && SLJIT_SSE2_AUTO) -
2436 -
2437SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_fop1(struct sljit_compiler *compiler, int op, -
2438 int dst, sljit_w dstw, -
2439 int src, sljit_w srcw) -
2440{ -
2441 if (sse2_available) -
2442 return sljit_emit_sse2_fop1(compiler, op, dst, dstw, src, srcw); -
2443 else -
2444 return sljit_emit_fpu_fop1(compiler, op, dst, dstw, src, srcw); -
2445} -
2446 -
2447SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_fop2(struct sljit_compiler *compiler, int op, -
2448 int dst, sljit_w dstw, -
2449 int src1, sljit_w src1w, -
2450 int src2, sljit_w src2w) -
2451{ -
2452 if (sse2_available) -
2453 return sljit_emit_sse2_fop2(compiler, op, dst, dstw, src1, src1w, src2, src2w); -
2454 else -
2455 return sljit_emit_fpu_fop2(compiler, op, dst, dstw, src1, src1w, src2, src2w); -
2456} -
2457 -
2458#endif -
2459 -
2460/* --------------------------------------------------------------------- */ -
2461/* Conditional instructions */ -
2462/* --------------------------------------------------------------------- */ -
2463 -
2464SLJIT_API_FUNC_ATTRIBUTE struct sljit_label* sljit_emit_label(struct sljit_compiler *compiler) -
2465{ -
2466 sljit_ub *buf;
executed (the execution status of this line is deduced): sljit_ub *buf;
-
2467 struct sljit_label *label;
executed (the execution status of this line is deduced): struct sljit_label *label;
-
2468 -
2469 CHECK_ERROR_PTR();
never executed: return ((void *)0);
executed: }
Execution Count:340
partially evaluated: __builtin_expect((compiler->error), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:340
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:340
0-340
2470 check_sljit_emit_label(compiler);
never executed (the execution status of this line is deduced): check_sljit_emit_label(compiler);
-
2471 -
2472 /* We should restore the flags before the label, -
2473 since other taken jumps has their own flags as well. */ -
2474 if (SLJIT_UNLIKELY(compiler->flags_saved))
partially evaluated: __builtin_expect((compiler->flags_saved), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:340
0-340
2475 PTR_FAIL_IF(emit_restore_flags(compiler, 0));
never executed: return ((void *)0);
never executed: }
never evaluated: __builtin_expect((emit_restore_flags(compiler, 0)), 0)
never evaluated: 0
0
2476 -
2477 if (compiler->last_label && compiler->last_label->size == compiler->size)
evaluated: compiler->last_label
TRUEFALSE
yes
Evaluation Count:325
yes
Evaluation Count:15
evaluated: compiler->last_label->size == compiler->size
TRUEFALSE
yes
Evaluation Count:69
yes
Evaluation Count:256
15-325
2478 return compiler->last_label;
executed: return compiler->last_label;
Execution Count:69
69
2479 -
2480 label = (struct sljit_label*)ensure_abuf(compiler, sizeof(struct sljit_label));
executed (the execution status of this line is deduced): label = (struct sljit_label*)ensure_abuf(compiler, sizeof(struct sljit_label));
-
2481 PTR_FAIL_IF(!label);
never executed: return ((void *)0);
executed: }
Execution Count:271
partially evaluated: __builtin_expect((!label), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:271
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:271
0-271
2482 set_label(label, compiler);
executed (the execution status of this line is deduced): set_label(label, compiler);
-
2483 -
2484 buf = (sljit_ub*)ensure_buf(compiler, 2);
executed (the execution status of this line is deduced): buf = (sljit_ub*)ensure_buf(compiler, 2);
-
2485 PTR_FAIL_IF(!buf);
never executed: return ((void *)0);
executed: }
Execution Count:271
partially evaluated: __builtin_expect((!buf), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:271
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:271
0-271
2486 -
2487 *buf++ = 0;
executed (the execution status of this line is deduced): *buf++ = 0;
-
2488 *buf++ = 0;
executed (the execution status of this line is deduced): *buf++ = 0;
-
2489 -
2490 return label;
executed: return label;
Execution Count:271
271
2491} -
2492 -
2493SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_jump(struct sljit_compiler *compiler, int type) -
2494{ -
2495 sljit_ub *buf;
executed (the execution status of this line is deduced): sljit_ub *buf;
-
2496 struct sljit_jump *jump;
executed (the execution status of this line is deduced): struct sljit_jump *jump;
-
2497 -
2498 CHECK_ERROR_PTR();
never executed: return ((void *)0);
executed: }
Execution Count:401
partially evaluated: __builtin_expect((compiler->error), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:401
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:401
0-401
2499 check_sljit_emit_jump(compiler, type);
executed (the execution status of this line is deduced): check_sljit_emit_jump(compiler, type);
-
2500 -
2501 if (SLJIT_UNLIKELY(compiler->flags_saved)) {
partially evaluated: __builtin_expect((compiler->flags_saved), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:401
0-401
2502 if ((type & 0xff) <= SLJIT_JUMP)
never evaluated: (type & 0xff) <= 22
0
2503 PTR_FAIL_IF(emit_restore_flags(compiler, 0));
never executed: return ((void *)0);
never executed: }
never evaluated: __builtin_expect((emit_restore_flags(compiler, 0)), 0)
never evaluated: 0
0
2504 compiler->flags_saved = 0;
never executed (the execution status of this line is deduced): compiler->flags_saved = 0;
-
2505 }
never executed: }
0
2506 -
2507 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump));
executed (the execution status of this line is deduced): jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump));
-
2508 PTR_FAIL_IF_NULL(jump);
never executed: return ((void *)0);
executed: }
Execution Count:401
partially evaluated: __builtin_expect((!(jump)), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:401
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:401
0-401
2509 set_jump(jump, compiler, type & SLJIT_REWRITABLE_JUMP);
never executed (the execution status of this line is deduced): set_jump(jump, compiler, type & 0x1000);
-
2510 type &= 0xff;
never executed (the execution status of this line is deduced): type &= 0xff;
-
2511 -
2512 if (type >= SLJIT_CALL1)
partially evaluated: type >= 25
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:401
0-401
2513 PTR_FAIL_IF(call_with_args(compiler, type));
never executed: return ((void *)0);
never executed: }
never evaluated: __builtin_expect((call_with_args(compiler, type)), 0)
never evaluated: 0
0
2514 -
2515 /* Worst case size. */ -
2516#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
2517 compiler->size += (type >= SLJIT_JUMP) ? 5 : 6; -
2518#else -
2519 compiler->size += (type >= SLJIT_JUMP) ? (10 + 3) : (2 + 10 + 3);
evaluated: (type >= 22)
TRUEFALSE
yes
Evaluation Count:136
yes
Evaluation Count:265
136-265
2520#endif -
2521 -
2522 buf = (sljit_ub*)ensure_buf(compiler, 2);
executed (the execution status of this line is deduced): buf = (sljit_ub*)ensure_buf(compiler, 2);
-
2523 PTR_FAIL_IF_NULL(buf);
never executed: return ((void *)0);
executed: }
Execution Count:401
partially evaluated: __builtin_expect((!(buf)), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:401
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:401
0-401
2524 -
2525 *buf++ = 0;
executed (the execution status of this line is deduced): *buf++ = 0;
-
2526 *buf++ = type + 4;
executed (the execution status of this line is deduced): *buf++ = type + 4;
-
2527 return jump;
executed: return jump;
Execution Count:401
401
2528} -
2529 -
2530SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_ijump(struct sljit_compiler *compiler, int type, int src, sljit_w srcw) -
2531{ -
2532 sljit_ub *code;
executed (the execution status of this line is deduced): sljit_ub *code;
-
2533 struct sljit_jump *jump;
executed (the execution status of this line is deduced): struct sljit_jump *jump;
-
2534 -
2535 CHECK_ERROR();
never executed: return compiler->error;
executed: }
Execution Count:15
partially evaluated: __builtin_expect((compiler->error), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
0-15
2536 check_sljit_emit_ijump(compiler, type, src, srcw);
executed (the execution status of this line is deduced): check_sljit_emit_ijump(compiler, type, src, srcw);
-
2537 -
2538 CHECK_EXTRA_REGS(src, srcw, (void)0); -
2539 if (SLJIT_UNLIKELY(compiler->flags_saved)) {
partially evaluated: __builtin_expect((compiler->flags_saved), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
0-15
2540 if (type <= SLJIT_JUMP)
never evaluated: type <= 22
0
2541 FAIL_IF(emit_restore_flags(compiler, 0));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_restore_flags(compiler, 0)), 0)
never evaluated: 0
0
2542 compiler->flags_saved = 0;
never executed (the execution status of this line is deduced): compiler->flags_saved = 0;
-
2543 }
never executed: }
0
2544 -
2545 if (type >= SLJIT_CALL1) {
partially evaluated: type >= 25
TRUEFALSE
yes
Evaluation Count:15
no
Evaluation Count:0
0-15
2546#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
2547#if (defined SLJIT_X86_32_FASTCALL && SLJIT_X86_32_FASTCALL) -
2548 if (src == SLJIT_TEMPORARY_REG3) { -
2549 EMIT_MOV(compiler, TMP_REGISTER, 0, src, 0); -
2550 src = TMP_REGISTER; -
2551 } -
2552 if ((src & SLJIT_MEM) && (src & 0xf) == SLJIT_LOCALS_REG && type >= SLJIT_CALL3) { -
2553 if (src & 0xf0) { -
2554 EMIT_MOV(compiler, TMP_REGISTER, 0, src, srcw); -
2555 src = TMP_REGISTER; -
2556 } -
2557 else -
2558 srcw += sizeof(sljit_w); -
2559 } -
2560#else -
2561 if ((src & SLJIT_MEM) && (src & 0xf) == SLJIT_LOCALS_REG) { -
2562 if (src & 0xf0) { -
2563 EMIT_MOV(compiler, TMP_REGISTER, 0, src, srcw); -
2564 src = TMP_REGISTER; -
2565 } -
2566 else -
2567 srcw += sizeof(sljit_w) * (type - SLJIT_CALL0); -
2568 } -
2569#endif -
2570#endif -
2571#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) && defined(_WIN64) -
2572 if (src == SLJIT_TEMPORARY_REG3) { -
2573 EMIT_MOV(compiler, TMP_REGISTER, 0, src, 0); -
2574 src = TMP_REGISTER; -
2575 } -
2576#endif -
2577 FAIL_IF(call_with_args(compiler, type));
never executed: return compiler->error;
executed: }
Execution Count:15
partially evaluated: __builtin_expect((call_with_args(compiler, type)), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
0-15
2578 }
executed: }
Execution Count:15
15
2579 -
2580 if (src == SLJIT_IMM) {
partially evaluated: src == 0x200
TRUEFALSE
yes
Evaluation Count:15
no
Evaluation Count:0
0-15
2581 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump));
executed (the execution status of this line is deduced): jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump));
-
2582 FAIL_IF_NULL(jump);
never executed: return 2;
executed: }
Execution Count:15
partially evaluated: __builtin_expect((!(jump)), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
0-15
2583 set_jump(jump, compiler, JUMP_ADDR);
executed (the execution status of this line is deduced): set_jump(jump, compiler, 0x2);
-
2584 jump->u.target = srcw;
executed (the execution status of this line is deduced): jump->u.target = srcw;
-
2585 -
2586 /* Worst case size. */ -
2587#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
2588 compiler->size += 5; -
2589#else -
2590 compiler->size += 10 + 3;
executed (the execution status of this line is deduced): compiler->size += 10 + 3;
-
2591#endif -
2592 -
2593 code = (sljit_ub*)ensure_buf(compiler, 2);
executed (the execution status of this line is deduced): code = (sljit_ub*)ensure_buf(compiler, 2);
-
2594 FAIL_IF_NULL(code);
never executed: return 2;
executed: }
Execution Count:15
partially evaluated: __builtin_expect((!(code)), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
0-15
2595 -
2596 *code++ = 0;
executed (the execution status of this line is deduced): *code++ = 0;
-
2597 *code++ = type + 4;
executed (the execution status of this line is deduced): *code++ = type + 4;
-
2598 }
executed: }
Execution Count:15
15
2599 else { -
2600#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
2601 /* REX_W is not necessary (src is not immediate). */ -
2602 compiler->mode32 = 1;
never executed (the execution status of this line is deduced): compiler->mode32 = 1;
-
2603#endif -
2604 code = emit_x86_instruction(compiler, 1, 0, 0, src, srcw);
never executed (the execution status of this line is deduced): code = emit_x86_instruction(compiler, 1, 0, 0, src, srcw);
-
2605 FAIL_IF(!code);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((!code), 0)
never evaluated: 0
0
2606 *code++ = 0xff;
never executed (the execution status of this line is deduced): *code++ = 0xff;
-
2607 *code |= (type >= SLJIT_FAST_CALL) ? (2 << 3) : (4 << 3);
never evaluated: (type >= 23)
0
2608 }
never executed: }
0
2609 return SLJIT_SUCCESS;
executed: return 0;
Execution Count:15
15
2610} -
2611 -
2612SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_cond_value(struct sljit_compiler *compiler, int op, int dst, sljit_w dstw, int type) -
2613{ -
2614 sljit_ub *buf;
executed (the execution status of this line is deduced): sljit_ub *buf;
-
2615 sljit_ub cond_set = 0;
executed (the execution status of this line is deduced): sljit_ub cond_set = 0;
-
2616#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
2617 int reg;
executed (the execution status of this line is deduced): int reg;
-
2618#endif -
2619 -
2620 CHECK_ERROR();
never executed: return compiler->error;
executed: }
Execution Count:43
partially evaluated: __builtin_expect((compiler->error), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:43
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:43
0-43
2621 check_sljit_emit_cond_value(compiler, op, dst, dstw, type);
executed (the execution status of this line is deduced): check_sljit_emit_cond_value(compiler, op, dst, dstw, type);
-
2622 -
2623 if (dst == SLJIT_UNUSED)
partially evaluated: dst == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:43
0-43
2624 return SLJIT_SUCCESS;
never executed: return 0;
0
2625 -
2626 CHECK_EXTRA_REGS(dst, dstw, (void)0); -
2627 if (SLJIT_UNLIKELY(compiler->flags_saved))
partially evaluated: __builtin_expect((compiler->flags_saved), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:43
0-43
2628 FAIL_IF(emit_restore_flags(compiler, 0));
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_restore_flags(compiler, 0)), 0)
never evaluated: 0
0
2629 -
2630 switch (type) { -
2631 case SLJIT_C_EQUAL: -
2632 case SLJIT_C_FLOAT_EQUAL: -
2633 cond_set = 0x94;
executed (the execution status of this line is deduced): cond_set = 0x94;
-
2634 break;
executed: break;
Execution Count:41
41
2635 -
2636 case SLJIT_C_NOT_EQUAL: -
2637 case SLJIT_C_FLOAT_NOT_EQUAL: -
2638 cond_set = 0x95;
never executed (the execution status of this line is deduced): cond_set = 0x95;
-
2639 break;
never executed: break;
0
2640 -
2641 case SLJIT_C_LESS: -
2642 case SLJIT_C_FLOAT_LESS: -
2643 cond_set = 0x92;
never executed (the execution status of this line is deduced): cond_set = 0x92;
-
2644 break;
never executed: break;
0
2645 -
2646 case SLJIT_C_GREATER_EQUAL: -
2647 case SLJIT_C_FLOAT_GREATER_EQUAL: -
2648 cond_set = 0x93;
executed (the execution status of this line is deduced): cond_set = 0x93;
-
2649 break;
executed: break;
Execution Count:2
2
2650 -
2651 case SLJIT_C_GREATER: -
2652 case SLJIT_C_FLOAT_GREATER: -
2653 cond_set = 0x97;
never executed (the execution status of this line is deduced): cond_set = 0x97;
-
2654 break;
never executed: break;
0
2655 -
2656 case SLJIT_C_LESS_EQUAL: -
2657 case SLJIT_C_FLOAT_LESS_EQUAL: -
2658 cond_set = 0x96;
never executed (the execution status of this line is deduced): cond_set = 0x96;
-
2659 break;
never executed: break;
0
2660 -
2661 case SLJIT_C_SIG_LESS: -
2662 cond_set = 0x9c;
never executed (the execution status of this line is deduced): cond_set = 0x9c;
-
2663 break;
never executed: break;
0
2664 -
2665 case SLJIT_C_SIG_GREATER_EQUAL: -
2666 cond_set = 0x9d;
never executed (the execution status of this line is deduced): cond_set = 0x9d;
-
2667 break;
never executed: break;
0
2668 -
2669 case SLJIT_C_SIG_GREATER: -
2670 cond_set = 0x9f;
never executed (the execution status of this line is deduced): cond_set = 0x9f;
-
2671 break;
never executed: break;
0
2672 -
2673 case SLJIT_C_SIG_LESS_EQUAL: -
2674 cond_set = 0x9e;
never executed (the execution status of this line is deduced): cond_set = 0x9e;
-
2675 break;
never executed: break;
0
2676 -
2677 case SLJIT_C_OVERFLOW: -
2678 case SLJIT_C_MUL_OVERFLOW: -
2679 cond_set = 0x90;
never executed (the execution status of this line is deduced): cond_set = 0x90;
-
2680 break;
never executed: break;
0
2681 -
2682 case SLJIT_C_NOT_OVERFLOW: -
2683 case SLJIT_C_MUL_NOT_OVERFLOW: -
2684 cond_set = 0x91;
never executed (the execution status of this line is deduced): cond_set = 0x91;
-
2685 break;
never executed: break;
0
2686 -
2687 case SLJIT_C_FLOAT_NAN: -
2688 cond_set = 0x9a;
never executed (the execution status of this line is deduced): cond_set = 0x9a;
-
2689 break;
never executed: break;
0
2690 -
2691 case SLJIT_C_FLOAT_NOT_NAN: -
2692 cond_set = 0x9b;
never executed (the execution status of this line is deduced): cond_set = 0x9b;
-
2693 break;
never executed: break;
0
2694 } -
2695 -
2696#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
2697 reg = (op == SLJIT_MOV && dst >= SLJIT_TEMPORARY_REG1 && dst <= SLJIT_NO_REGISTERS) ? dst : TMP_REGISTER;
evaluated: op == 6
TRUEFALSE
yes
Evaluation Count:41
yes
Evaluation Count:2
partially evaluated: dst >= 1
TRUEFALSE
yes
Evaluation Count:41
no
Evaluation Count:0
partially evaluated: dst <= 11
TRUEFALSE
yes
Evaluation Count:41
no
Evaluation Count:0
0-41
2698 -
2699 buf = (sljit_ub*)ensure_buf(compiler, 1 + 4 + 4);
executed (the execution status of this line is deduced): buf = (sljit_ub*)ensure_buf(compiler, 1 + 4 + 4);
-
2700 FAIL_IF(!buf);
never executed: return compiler->error;
executed: }
Execution Count:43
partially evaluated: __builtin_expect((!buf), 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:43
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:43
0-43
2701 INC_SIZE(4 + 4);
executed (the execution status of this line is deduced): (*buf++ = (4 + 4), compiler->size += (4 + 4));
-
2702 /* Set low register to conditional flag. */ -
2703 *buf++ = (reg_map[reg] <= 7) ? 0x40 : REX_B;
partially evaluated: (reg_map[reg] <= 7)
TRUEFALSE
yes
Evaluation Count:43
no
Evaluation Count:0
0-43
2704 *buf++ = 0x0f;
executed (the execution status of this line is deduced): *buf++ = 0x0f;
-
2705 *buf++ = cond_set;
executed (the execution status of this line is deduced): *buf++ = cond_set;
-
2706 *buf++ = 0xC0 | reg_lmap[reg];
executed (the execution status of this line is deduced): *buf++ = 0xC0 | reg_lmap[reg];
-
2707 *buf++ = REX_W | (reg_map[reg] <= 7 ? 0 : (REX_B | REX_R));
executed (the execution status of this line is deduced): *buf++ = 0x48 | (reg_map[reg] <= 7 ? 0 : (0x41 | 0x44));
-
2708 *buf++ = 0x0f;
executed (the execution status of this line is deduced): *buf++ = 0x0f;
-
2709 *buf++ = 0xb6;
executed (the execution status of this line is deduced): *buf++ = 0xb6;
-
2710 *buf = 0xC0 | (reg_lmap[reg] << 3) | reg_lmap[reg];
executed (the execution status of this line is deduced): *buf = 0xC0 | (reg_lmap[reg] << 3) | reg_lmap[reg];
-
2711 -
2712 if (reg == TMP_REGISTER) {
evaluated: reg == (11 + 1)
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:41
2-41
2713 if (op == SLJIT_MOV) {
partially evaluated: op == 6
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
2714 compiler->mode32 = 0;
never executed (the execution status of this line is deduced): compiler->mode32 = 0;
-
2715 EMIT_MOV(compiler, dst, dstw, TMP_REGISTER, 0);
never executed: return compiler->error;
never executed: }
never evaluated: __builtin_expect((emit_mov(compiler, dst, dstw, (11 + 1), 0)), 0)
never evaluated: 0
0
2716 }
never executed: }
0
2717 else { -
2718#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) || (defined SLJIT_DEBUG && SLJIT_DEBUG) -
2719 compiler->skip_checks = 1; -
2720#endif -
2721 return sljit_emit_op2(compiler, op, dst, dstw, dst, dstw, TMP_REGISTER, 0);
executed: return sljit_emit_op2(compiler, op, dst, dstw, dst, dstw, (11 + 1), 0);
Execution Count:2
2
2722 } -
2723 } -
2724#else -
2725 if (op == SLJIT_MOV) { -
2726 if (dst >= SLJIT_TEMPORARY_REG1 && dst <= SLJIT_TEMPORARY_REG3) { -
2727 buf = (sljit_ub*)ensure_buf(compiler, 1 + 3 + 3); -
2728 FAIL_IF(!buf); -
2729 INC_SIZE(3 + 3); -
2730 /* Set low byte to conditional flag. */ -
2731 *buf++ = 0x0f; -
2732 *buf++ = cond_set; -
2733 *buf++ = 0xC0 | reg_map[dst]; -
2734 -
2735 *buf++ = 0x0f; -
2736 *buf++ = 0xb6; -
2737 *buf = 0xC0 | (reg_map[dst] << 3) | reg_map[dst]; -
2738 } -
2739 else { -
2740 EMIT_MOV(compiler, TMP_REGISTER, 0, SLJIT_TEMPORARY_REG1, 0); -
2741 -
2742 buf = (sljit_ub*)ensure_buf(compiler, 1 + 3 + 3); -
2743 FAIL_IF(!buf); -
2744 INC_SIZE(3 + 3); -
2745 /* Set al to conditional flag. */ -
2746 *buf++ = 0x0f; -
2747 *buf++ = cond_set; -
2748 *buf++ = 0xC0; -
2749 -
2750 *buf++ = 0x0f; -
2751 *buf++ = 0xb6; -
2752 if (dst >= SLJIT_SAVED_REG1 && dst <= SLJIT_NO_REGISTERS) -
2753 *buf = 0xC0 | (reg_map[dst] << 3); -
2754 else { -
2755 *buf = 0xC0; -
2756 EMIT_MOV(compiler, dst, dstw, SLJIT_TEMPORARY_REG1, 0); -
2757 } -
2758 -
2759 EMIT_MOV(compiler, SLJIT_TEMPORARY_REG1, 0, TMP_REGISTER, 0); -
2760 } -
2761 } -
2762 else { -
2763 if (dst >= SLJIT_TEMPORARY_REG1 && dst <= SLJIT_TEMPORARY_REG3) { -
2764 EMIT_MOV(compiler, TMP_REGISTER, 0, dst, 0); -
2765 buf = (sljit_ub*)ensure_buf(compiler, 1 + 3); -
2766 FAIL_IF(!buf); -
2767 INC_SIZE(3); -
2768 -
2769 *buf++ = 0x0f; -
2770 *buf++ = cond_set; -
2771 *buf++ = 0xC0 | reg_map[dst]; -
2772 } -
2773 else { -
2774 EMIT_MOV(compiler, TMP_REGISTER, 0, SLJIT_TEMPORARY_REG1, 0); -
2775 -
2776 buf = (sljit_ub*)ensure_buf(compiler, 1 + 3 + 3 + 1); -
2777 FAIL_IF(!buf); -
2778 INC_SIZE(3 + 3 + 1); -
2779 /* Set al to conditional flag. */ -
2780 *buf++ = 0x0f; -
2781 *buf++ = cond_set; -
2782 *buf++ = 0xC0; -
2783 -
2784 *buf++ = 0x0f; -
2785 *buf++ = 0xb6; -
2786 *buf++ = 0xC0; -
2787 -
2788 *buf++ = 0x90 + reg_map[TMP_REGISTER]; -
2789 } -
2790#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) || (defined SLJIT_DEBUG && SLJIT_DEBUG) -
2791 compiler->skip_checks = 1; -
2792#endif -
2793 return sljit_emit_op2(compiler, op, dst, dstw, dst, dstw, TMP_REGISTER, 0); -
2794 } -
2795#endif -
2796 -
2797 return SLJIT_SUCCESS;
executed: return 0;
Execution Count:41
41
2798} -
2799 -
2800SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compiler *compiler, int dst, sljit_w dstw, sljit_w init_value) -
2801{ -
2802 sljit_ub *buf;
never executed (the execution status of this line is deduced): sljit_ub *buf;
-
2803 struct sljit_const *const_;
never executed (the execution status of this line is deduced): struct sljit_const *const_;
-
2804#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
2805 int reg;
never executed (the execution status of this line is deduced): int reg;
-
2806#endif -
2807 -
2808 CHECK_ERROR_PTR();
never executed: return ((void *)0);
never executed: }
never evaluated: __builtin_expect((compiler->error), 0)
never evaluated: 0
0
2809 check_sljit_emit_const(compiler, dst, dstw, init_value);
never executed (the execution status of this line is deduced): check_sljit_emit_const(compiler, dst, dstw, init_value);
-
2810 -
2811 CHECK_EXTRA_REGS(dst, dstw, (void)0); -
2812 -
2813 const_ = (struct sljit_const*)ensure_abuf(compiler, sizeof(struct sljit_const));
never executed (the execution status of this line is deduced): const_ = (struct sljit_const*)ensure_abuf(compiler, sizeof(struct sljit_const));
-
2814 PTR_FAIL_IF(!const_);
never executed: return ((void *)0);
never executed: }
never evaluated: __builtin_expect((!const_), 0)
never evaluated: 0
0
2815 set_const(const_, compiler);
never executed (the execution status of this line is deduced): set_const(const_, compiler);
-
2816 -
2817#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
2818 compiler->mode32 = 0;
never executed (the execution status of this line is deduced): compiler->mode32 = 0;
-
2819 reg = (dst >= SLJIT_TEMPORARY_REG1 && dst <= SLJIT_NO_REGISTERS) ? dst : TMP_REGISTER;
never evaluated: dst >= 1
never evaluated: dst <= 11
0
2820 -
2821 if (emit_load_imm64(compiler, reg, init_value))
never evaluated: emit_load_imm64(compiler, reg, init_value)
0
2822 return NULL;
never executed: return ((void *)0);
0
2823#else -
2824 if (dst == SLJIT_UNUSED) -
2825 dst = TMP_REGISTER; -
2826 -
2827 if (emit_mov(compiler, dst, dstw, SLJIT_IMM, init_value)) -
2828 return NULL; -
2829#endif -
2830 -
2831 buf = (sljit_ub*)ensure_buf(compiler, 2);
never executed (the execution status of this line is deduced): buf = (sljit_ub*)ensure_buf(compiler, 2);
-
2832 PTR_FAIL_IF(!buf);
never executed: return ((void *)0);
never executed: }
never evaluated: __builtin_expect((!buf), 0)
never evaluated: 0
0
2833 -
2834 *buf++ = 0;
never executed (the execution status of this line is deduced): *buf++ = 0;
-
2835 *buf++ = 1;
never executed (the execution status of this line is deduced): *buf++ = 1;
-
2836 -
2837#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) -
2838 if (reg == TMP_REGISTER && dst != SLJIT_UNUSED)
never evaluated: reg == (11 + 1)
never evaluated: dst != 0
0
2839 if (emit_mov(compiler, dst, dstw, TMP_REGISTER, 0))
never evaluated: emit_mov(compiler, dst, dstw, (11 + 1), 0)
0
2840 return NULL;
never executed: return ((void *)0);
0
2841#endif -
2842 -
2843 return const_;
never executed: return const_;
0
2844} -
2845 -
2846SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_addr) -
2847{ -
2848#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -
2849 *(sljit_w*)addr = new_addr - (addr + 4); -
2850#else -
2851 *(sljit_uw*)addr = new_addr;
never executed (the execution status of this line is deduced): *(sljit_uw*)addr = new_addr;
-
2852#endif -
2853}
never executed: }
0
2854 -
2855SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_w new_constant) -
2856{ -
2857 *(sljit_w*)addr = new_constant;
never executed (the execution status of this line is deduced): *(sljit_w*)addr = new_constant;
-
2858}
never executed: }
0
2859 -
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial