Lines Matching +full:0 +full:x0fffff
1 // SPDX-License-Identifier: 0BSD
69 * PowerPC 4 0
70 * IA-64 16 0
71 * ARM 4 0
73 * SPARC 4 0
86 return b == 0x00 || b == 0xFF; in bcj_x86_test_msbyte()
94 static const uint8_t mask_to_bit_num[8] = { 0, 1, 2, 2, 3, 3, 3, 3 }; in bcj_x86()
105 return 0; in bcj_x86()
108 for (i = 0; i < size; ++i) { in bcj_x86()
109 if ((buf[i] & 0xFE) != 0xE8) in bcj_x86()
114 prev_mask = 0; in bcj_x86()
117 if (prev_mask != 0) { in bcj_x86()
134 if (prev_mask == 0) in bcj_x86()
145 dest &= 0x01FFFFFF; in bcj_x86()
146 dest |= (uint32_t)0 - (dest & 0x01000000); in bcj_x86()
155 s->x86_prev_mask = prev_pos > 3 ? 0 : prev_mask << (prev_pos - 1); in bcj_x86()
168 for (i = 0; i < size; i += 4) { in bcj_powerpc()
170 if ((instr & 0xFC000003) == 0x48000001) { in bcj_powerpc()
171 instr &= 0x03FFFFFC; in bcj_powerpc()
173 instr &= 0x03FFFFFC; in bcj_powerpc()
174 instr |= 0x48000001; in bcj_powerpc()
187 0, 0, 0, 0, 0, 0, 0, 0, in bcj_ia64()
188 0, 0, 0, 0, 0, 0, 0, 0, in bcj_ia64()
189 4, 4, 6, 6, 0, 0, 7, 7, in bcj_ia64()
190 4, 4, 0, 0, 4, 4, 0, 0 in bcj_ia64()
203 /* Instruction slot (0, 1, or 2) in the 128-bit instruction word */ in bcj_ia64()
227 for (i = 0; i < size; i += 16) { in bcj_ia64()
228 mask = branch_table[buf[i] & 0x1F]; in bcj_ia64()
229 for (slot = 0, bit_pos = 5; slot < 3; ++slot, bit_pos += 41) { in bcj_ia64()
230 if (((mask >> slot) & 1) == 0) in bcj_ia64()
235 instr = 0; in bcj_ia64()
236 for (j = 0; j < 6; ++j) in bcj_ia64()
242 if (((norm >> 37) & 0x0F) == 0x05 in bcj_ia64()
243 && ((norm >> 9) & 0x07) == 0) { in bcj_ia64()
244 addr = (norm >> 13) & 0x0FFFFF; in bcj_ia64()
250 norm &= ~((uint64_t)0x8FFFFF << 13); in bcj_ia64()
251 norm |= (uint64_t)(addr & 0x0FFFFF) << 13; in bcj_ia64()
252 norm |= (uint64_t)(addr & 0x100000) in bcj_ia64()
258 for (j = 0; j < 6; j++) in bcj_ia64()
277 for (i = 0; i < size; i += 4) { in bcj_arm()
278 if (buf[i + 3] == 0xEB) { in bcj_arm()
301 return 0; in bcj_armthumb()
305 for (i = 0; i <= size; i += 2) { in bcj_armthumb()
306 if ((buf[i + 1] & 0xF8) == 0xF0 in bcj_armthumb()
307 && (buf[i + 3] & 0xF8) == 0xF8) { in bcj_armthumb()
308 addr = (((uint32_t)buf[i + 1] & 0x07) << 19) in bcj_armthumb()
310 | (((uint32_t)buf[i + 3] & 0x07) << 8) in bcj_armthumb()
315 buf[i + 1] = (uint8_t)(0xF0 | ((addr >> 19) & 0x07)); in bcj_armthumb()
317 buf[i + 3] = (uint8_t)(0xF8 | ((addr >> 8) & 0x07)); in bcj_armthumb()
335 for (i = 0; i < size; i += 4) { in bcj_sparc()
337 if ((instr >> 22) == 0x100 || (instr >> 22) == 0x1FF) { in bcj_sparc()
341 instr = ((uint32_t)0x40000000 - (instr & 0x400000)) in bcj_sparc()
342 | 0x40000000 | (instr & 0x3FFFFF); in bcj_sparc()
360 for (i = 0; i < size; i += 4) { in bcj_arm64()
363 if ((instr >> 26) == 0x25) { in bcj_arm64()
366 instr = 0x94000000 | (addr & 0x03FFFFFF); in bcj_arm64()
369 } else if ((instr & 0x9F000000) == 0x90000000) { in bcj_arm64()
371 addr = ((instr >> 29) & 3) | ((instr >> 3) & 0x1FFFFC); in bcj_arm64()
374 if ((addr + 0x020000) & 0x1C0000) in bcj_arm64()
379 instr &= 0x9000001F; in bcj_arm64()
381 instr |= (addr & 0x03FFFC) << 3; in bcj_arm64()
382 instr |= (0U - (addr & 0x020000)) & 0xE00000; in bcj_arm64()
405 return 0; in bcj_riscv()
409 for (i = 0; i <= size; i += 2) { in bcj_riscv()
412 if (instr == 0xEF) { in bcj_riscv()
415 if ((b1 & 0x0D) != 0) in bcj_riscv()
421 addr = ((b1 & 0xF0) << 13) | (b2 << 9) | (b3 << 1); in bcj_riscv()
424 buf[i + 1] = (uint8_t)((b1 & 0x0F) in bcj_riscv()
425 | ((addr >> 8) & 0xF0)); in bcj_riscv()
427 buf[i + 2] = (uint8_t)(((addr >> 16) & 0x0F) in bcj_riscv()
428 | ((addr >> 7) & 0x10) in bcj_riscv()
429 | ((addr << 4) & 0xE0)); in bcj_riscv()
431 buf[i + 3] = (uint8_t)(((addr >> 4) & 0x7F) in bcj_riscv()
432 | ((addr >> 13) & 0x80)); in bcj_riscv()
436 } else if ((instr & 0x7F) == 0x17) { in bcj_riscv()
442 if (instr & 0xE80) { in bcj_riscv()
446 if (((instr << 8) ^ (instr2 - 3)) & 0xF8003) { in bcj_riscv()
451 addr = (instr & 0xFFFFF000) + (instr2 >> 20); in bcj_riscv()
453 instr = 0x17 | (2 << 7) | (instr2 << 12); in bcj_riscv()
459 if ((uint32_t)((instr - 0x3117) << 18) in bcj_riscv()
460 >= (instr2_rs1 & 0x1D)) { in bcj_riscv()
470 instr = 0x17 | (instr2_rs1 << 7) in bcj_riscv()
471 | ((addr + 0x800) & 0xFFFFF000); in bcj_riscv()
544 filtered = 0; in bcj_apply()
585 if (s->temp.filtered > 0) { in xz_dec_bcj_run()
587 if (s->temp.filtered > 0) in xz_dec_bcj_run()
602 * This needs to be always run when temp.size == 0 to handle a special in xz_dec_bcj_run()
606 if (s->temp.size < b->out_size - b->out_pos || s->temp.size == 0) { in xz_dec_bcj_run()
677 if (s->temp.filtered > 0) in xz_dec_bcj_run()
729 s->pos = 0; in xz_dec_bcj_reset()
730 s->x86_prev_mask = 0; in xz_dec_bcj_reset()
731 s->temp.filtered = 0; in xz_dec_bcj_reset()
732 s->temp.size = 0; in xz_dec_bcj_reset()