| 7 | #include "pcode.h" |
| 8 | |
| 9 | int decode_spec(context *ctx, Instruction *dec) |
| 10 | { |
| 11 | uint32_t op0, op1, op2, op3, op4; |
| 12 | |
| 13 | dec->insword = ctx->insword; |
| 14 | /* GROUP: root */ |
| 15 | op0 = INSWORD>>31; |
| 16 | op1 = (INSWORD>>25)&15; |
| 17 | if(!op0 && !op1) { |
| 18 | /* GROUP: reserved */ |
| 19 | op0 = (INSWORD>>29)&3; |
| 20 | op1 = (INSWORD>>16)&0x1ff; |
| 21 | if(!op0 && !op1) |
| 22 | return decode_iclass_perm_undef(ctx, dec); |
| 23 | if(op1) |
| 24 | UNALLOCATED(ENC_UNKNOWN); // iclass: unallocate3 |
| 25 | if(op0) |
| 26 | UNALLOCATED(ENC_UNKNOWN); // iclass: unallocate4 |
| 27 | RESERVED(ENC_UNKNOWN); // group: reserved |
| 28 | } |
| 29 | if(op0 && !op1) { |
| 30 | /* GROUP: sme */ |
| 31 | op0 = (INSWORD>>29)&3; |
| 32 | op1 = (INSWORD>>19)&0x3f; |
| 33 | op2 = (INSWORD>>17)&1; |
| 34 | op3 = (INSWORD>>9)&1; |
| 35 | op4 = (INSWORD>>2)&7; |
| 36 | if(!(op0&2) && (op1&0x18)==0x10 && !(op4&1)) { |
| 37 | /* GROUP: mortlach_32bit_prod */ |
| 38 | op0 = (INSWORD>>29)&1; |
| 39 | op1 = (INSWORD>>24)&1; |
| 40 | op2 = (INSWORD>>21)&1; |
| 41 | op3 = (INSWORD>>3)&1; |
| 42 | if(!op0 && !op1 && !op2 && !op3) |
| 43 | return decode_iclass_mortlach_f32f32_prod(ctx, dec); |
| 44 | if(!op0 && !op1 && !op2 && op3) |
| 45 | UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_48 |
| 46 | if(!op0 && !op1 && op2) |
| 47 | UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_49 |
| 48 | if(!op0 && op1 && !op2 && !op3) |
| 49 | return decode_iclass_mortlach_b16f32_prod(ctx, dec); |
| 50 | if(!op0 && op1 && op2 && !op3) |
| 51 | return decode_iclass_mortlach_f16f32_prod(ctx, dec); |
| 52 | if(!op0 && op1 && op3) |
| 53 | UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_51 |
| 54 | if(op0 && !op3) |
| 55 | return decode_iclass_mortlach_i8i32_prod(ctx, dec); |
| 56 | if(op0 && op3) |
| 57 | UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_58 |
| 58 | UNMATCHED; |
| 59 | } |
| 60 | if(!(op0&2) && (op1&0x18)==0x18 && !(op4&2)) { |
| 61 | /* GROUP: mortlach_64bit_prod */ |
| 62 | op0 = (INSWORD>>29)&1; |
| 63 | op1 = (INSWORD>>24)&1; |
| 64 | op2 = (INSWORD>>21)&1; |
| 65 | if(!op0 && !op1 && !op2) |
| 66 | return decode_iclass_mortlach_f64f64_prod(ctx, dec); |
no test coverage detected