Branch Coverage

blib/lib/CPU/x86_64/InstructionWriter.pm
Criterion Covered Total %
branch 282 404 69.8


line true false branch
103 61 78 unless (defined $name and defined $labels->{$name})
105 0 61 unless defined $name
114 0 61 unless @_ == 2
118 0 61 unless defined $_[1]
123 61 0 unless ref $label
127 0 61 if defined $label->{'offset'}
159 0 1 if $bytes & $bytes - 1
166 0 4 unless length $fill == 1
182 0 9 unless $bits ||= $register_bits{$dst} || $register_bits{$src}
188 8 0 $register_bits{$dst} ? :
0 8 ref $dst && ref($dst)->can('value') ? :
1 8 ref $dst eq 'ARRAY' ? :
0 9 &looks_like_number($dst) ? :
193 3 0 $register_bits{$src} ? :
0 3 ref $src && ref($src)->can('value') ? :
5 3 ref $src eq 'ARRAY' ? :
1 8 &looks_like_number($src) ? :
203 0 0 unless $bits ||= $opr_type
206 0 0 &looks_like_number($operand) ? :
0 0 ref $operand eq 'ARRAY' ? :
0 0 $opr_type ? :
217 35 82 defined $_[1] ? :
222 0 0 defined $_[1] ? :
228 0 2 unless @_ == 2
229 0 2 unless defined $_[1]
233 2 0 unless ref $label
239 0 2 unless defined $label->{'offset'}
241 0 2 unless $ofs >> 31 == $ofs >> 31 >> 1
250 0 0 ref $immed ? :
251 0 0 if ref $immed
269 2 1 if ($pop_bytes) { }
270 0 2 ref $pop_bytes ? :
271 0 2 if ref $pop_bytes
282 0 4 unless @_ == 2
283 0 4 unless defined $_[1]
287 4 0 unless ref $label
293 0 10 unless defined $label->{'offset'}
296 5 5 $short ? :
410 16 169 if (CORE::not defined $mem->[0] and $mem->[1] and CORE::not defined $mem->[2] and $mem->[1] > 2147483647 || ref $mem->[1])
412 4 4 $bits == 16 ? :
4 8 $bits == 32 ? :
4 12 $bits == 64 ? :
16 0 if (lc $reg eq ($bits == 64 ? "rax" : ($bits == 32 ? "eax" : ($bits == 16 ? "ax" : "al"))))
414 4 12 if $bits == 64
415 4 12 if $bits == 16
417 8 8 &looks_like_number($disp) ? :
418 8 8 if (CORE::not defined $val) { }
423 0 14 unless defined $v
424 2 6 $bits == 16 ? :
2 6 $bits == 64 ? :
6 8 $v > 2147483647 ? :
436 884 2648 if $bits == 64
437 884 1764 if $bits == 32
438 882 882 if $bits == 16
439 882 0 if $bits == 8
453 28 35 if ($immed >> 31 >> 1 == 0) { }
21 14 elsif ($immed >> 31 == -1) { }
454 12 16 $reg > 7 ? :
470 24 33 if $reg > 7
478 21 28 if $reg > 7
486 20 35 if (CORE::not defined $reg) { }
489 25 10 if $reg > 3
941 3 4 $reg > 7 ? :
948 0 8 ref $imm ? :
949 6 2 $val >> 7 == $val >> 8 ? :
950 0 8 if ref $imm
964 3 4 $reg > 7 ? :
974 28 0 if (CORE::not ref $varspace || ref $nesting) { }
978 0 0 ref $varspace ? :
979 0 0 if ref $varspace
981 0 0 ref $nesting ? :
982 0 0 if ref $nesting
1081 0 6 defined $immed ? :
0 8 defined $immed ? :
6 8 $rex ? :
1108 372 274 $rex ? :
1119 354 248 $rex ? :
1131 0 420 if (CORE::not defined $reg1 && defined $reg2) { }
1136 0 0 if ($old_reg1 and $old_reg1 > 3 or $old_reg2 and $old_reg2 > 3)
1142 380 40 $reg1 > 3 || $reg2 > 3 ? :
1157 72 140 if (CORE::not defined $reg2) { }
1163 100 40 $reg2 > 3 ? :
1180 9263 0 if defined $reg
1182 7058 2205 if defined $base_reg
1184 7057 2206 if defined $index_reg
1193 9013 0 if defined $reg
1195 6867 2146 if defined $base_reg
1197 6865 2148 if defined $index_reg
1205 9009 0 if defined $reg
1207 6864 2145 if defined $base_reg
1209 6864 2145 if defined $index_reg
1218 5568 1740 if defined $base_reg
1220 5568 1740 if defined $index_reg
1224 0 7308 if (CORE::not defined $reg) { }
5040 2268 elsif ($reg > 3) { }
1226 0 0 unless CORE::not $rex and ($base_reg // 0) < 8 and ($index_reg // 0) < 8
1240 960 300 if defined $base_reg
1242 960 300 if defined $index_reg
1257 48 15 if defined $base_reg
1259 48 15 if defined $index_reg
1261 0 63 ref $disp ? :
63 0 defined $disp ? :
1266 48 15 if defined $base_reg
1268 48 15 if defined $index_reg
1271 0 63 ref $disp ? :
63 0 defined $disp ? :
1276 48 15 if defined $base_reg
1278 48 15 if defined $index_reg
1280 0 63 ref $disp ? :
63 0 defined $disp ? :
1285 48 15 if defined $base_reg
1287 48 15 if defined $index_reg
1289 0 63 ref $disp ? :
63 0 defined $disp ? :
1307 38261 11964 if (defined $base_reg) { }
1311 3188 6380 ($base_reg & 7) == 5 ? :
9564 0 $disp >> 31 == $disp >> 31 >> 1 ? :
19129 9564 $disp >> 7 == $disp >> 8 ? :
9568 28693 !$disp ? :
1316 28694 9567 if (defined $index_reg) { }
3188 6379 elsif (($base_reg & 7) == 4) { }
1318 0 28694 unless $index_reg != 4
1333 0 11964 unless $disp >> 31 == $disp >> 31 >> 1
1336 9564 2400 if (defined $index_reg) { }
1338 0 9564 unless $index_reg != 4
1347 4284 45941 if defined $immed
1350 31086 19139 $rex ? :
1386 132 22 $reg ? :
154 0 $value >> 31 == $value >> 31 >> 1 ? :
294 154 defined $opcode8 && $value >> 7 == $value >> 8 ? :
1410 126 168 $rex ? :
66 22 $reg ? :
66 88 $rex ? :
154 0 $value >> 31 >> 1 == $value >> 31 >> 2 ? :
294 154 defined $opcode8 && ($value >> 7 == $value >> 8 || $value >> 8 == 16777215) ? :
1436 105 140 $rex ? :
63 21 $reg ? :
63 84 $rex ? :
147 0 $value >> 16 == $value >> 17 ? :
245 147 defined $opcode8 && ($value >> 7 == $value >> 8 || $value >> 8 == 255) ? :
1465 0 280 ref $immed ? :
1466 0 280 unless $value >> 8 == $value >> 9
1467 0 280 if (CORE::not defined $reg) { }
40 240 elsif (CORE::not $reg) { }
200 40 elsif ($reg > 3) { }
1477 0 280 if ref $immed
1485 3072 960 if defined $base_reg
1487 3072 960 if defined $index_reg
1489 4032 0 defined $disp ? :
1494 1386 0 $value >> 31 == $value >> 31 >> 1 ? :
2646 1386 defined $opcode8 && $value >> 7 == $value >> 8 ? :
1504 3072 960 if defined $base_reg
1506 3072 960 if defined $index_reg
1508 4032 0 defined $disp ? :
1513 1386 0 $value >> 30 >> 2 == $value >> 30 >> 3 ? :
2646 1386 defined $opcode8 && ($value >> 7 == $value >> 8 || $value >> 8 == 16777215) ? :
1523 2688 840 if defined $base_reg
1525 2688 840 if defined $index_reg
1528 3528 0 defined $disp ? :
1533 1323 0 $value >> 16 == $value >> 17 ? :
2205 1323 defined $opcode8 && ($value >> 7 == $value >> 8 || $value >> 8 == 255) ? :
1543 1920 600 if defined $base_reg
1545 1920 600 if defined $index_reg
1547 2520 0 defined $disp ? :
1552 0 2520 unless $value >> 8 == $value >> 9
1571 96 636 $immed eq 1 ? :
1573 147 165 $bits == 16 ? :
189 312 $bits == 32 ? :
231 501 $bits == 64 ? :
1579 636 96 unless ($immed eq 1)
1580 0 636 ref $immed ? :
1581 0 636 if ref $immed
1598 756 3024 $immed eq 1 ? :
1600 945 945 $bits == 16 ? :
945 1890 $bits == 32 ? :
945 2835 $bits == 64 ? :
1606 3024 756 unless ($immed eq 1)
1607 0 3024 ref $immed ? :
1608 0 3024 if ref $immed
1626 0 64 unless defined $_[2]
1630 64 0 unless ref $label
1636 0 160 unless defined $label->{'offset'}
1639 80 80 $short ? :
1657 8 0 unless ref $label
1663 0 8 unless defined $label->{'offset'}
1665 0 8 unless $ofs >> 7 == $ofs >> 8
1675 0 51729 if (ref $u and ref $u ne 'SCALAR' and CORE::not &looks_like_number($u)) { }
1676 0 0 unless ref($u)->can("value")
1718 0 90 if ($location < 0) { }
1728 0 90 if ($self->{'debug'})
1732 0 0 if $caller[0] ne "CPU::x86_64::InstructionWriter"
1744 0 0 unless defined $v
1746 0 0 $bits <= 64 ? :
0 0 $bits <= 32 ? :
0 0 $bits <= 16 ? :
0 0 $bits <= 8 ? :
1747 0 0 unless $bits == 64 or $v >> $bits == $v >> $bits + 1
1772 17 326 if $ofs
1776 129 214 unless my $fn = $p->{'encode'}
1784 44 170 if (length $enc != $p->{'len'})
1791 0 214 if ($@)
1792 0 0 if ($p->{'caller'}) { }