| 9 | #include "pcode.h" |
| 10 | |
| 11 | int decode_iclass_barriers(context *ctx, Instruction *dec) |
| 12 | { |
| 13 | uint32_t CRm=(INSWORD>>8)&15, op2=(INSWORD>>5)&7, Rt=INSWORD&0x1f; |
| 14 | if(!CRm && op2==3 && Rt==0x1f && HasTME()) return TCOMMIT(ctx, dec); // -> TCOMMIT_only_barriers |
| 15 | if((CRm&3)==2 && op2==1 && Rt==0x1f && HasXS()) return DSB(ctx, dec); // -> DSB_BOn_barriers |
| 16 | if((CRm&3)==3 && op2==1 && Rt==0x1f) UNALLOCATED(ENC_UNALLOCATED_14_BARRIERS); |
| 17 | if(!(CRm&2) && op2==1 && Rt==0x1f) UNALLOCATED(ENC_UNALLOCATED_12_BARRIERS); |
| 18 | if(op2==1 && Rt!=0x1f) UNALLOCATED(ENC_UNALLOCATED_11_BARRIERS); |
| 19 | if(op2==2 && Rt==0x1f) return CLREX(ctx, dec); // -> CLREX_BN_barriers |
| 20 | if(op2==4 && Rt==0x1f) return DSB(ctx, dec); // -> DSB_BO_barriers |
| 21 | if(op2==5 && Rt==0x1f) return DMB(ctx, dec); // -> DMB_BO_barriers |
| 22 | if(op2==6 && Rt==0x1f) return ISB(ctx, dec); // -> ISB_BI_barriers |
| 23 | if(op2==7 && Rt!=0x1f) UNALLOCATED(ENC_UNALLOCATED_25_BARRIERS); |
| 24 | if(op2==7 && Rt==0x1f) return SB(ctx, dec); // -> SB_only_barriers |
| 25 | if(CRm==1 && op2==3) UNALLOCATED(ENC_UNALLOCATED_17_BARRIERS); |
| 26 | if((CRm&14)==2 && op2==3) UNALLOCATED(ENC_UNALLOCATED_18_BARRIERS); |
| 27 | if((CRm&12)==4 && op2==3) UNALLOCATED(ENC_UNALLOCATED_19_BARRIERS); |
| 28 | if((CRm&8)==8 && op2==3) UNALLOCATED(ENC_UNALLOCATED_20_BARRIERS); |
| 29 | if(!op2) UNALLOCATED(ENC_UNALLOCATED_10_BARRIERS); |
| 30 | UNMATCHED; |
| 31 | } |
| 32 | |
| 33 | int decode_iclass_compbranch(context *ctx, Instruction *dec) |
| 34 | { |