1// -*- mode:c++ -*-
2
3// Copyright (c) 2015 RISC-V Foundation
4// Copyright (c) 2017 The University of Virginia
5// All rights reserved.
6//
7// Redistribution and use in source and binary forms, with or without
8// modification, are permitted provided that the following conditions are

--- 198 unchanged lines hidden (view full) ---

207 CJUMPIMM<5:5> << 6 |
208 CJUMPIMM<4:4> << 7 |
209 CJUMPIMM<8:7> << 8 |
210 CJUMPIMM<6:6> << 10;
211 if (CJUMPIMM<10:10> > 0)
212 offset |= ~((int64_t)0x7FF);
213 NPC = PC + offset;
214 }}, IsIndirectControl, IsUncondControl, IsCall);
215 format BOp {
215 format CBOp {
216 0x6: c_beqz({{
217 int64_t offset = CIMM5<2:1> << 1 |
218 CIMM3<1:0> << 3 |
219 CIMM5<0:0> << 5 |
220 CIMM5<4:3> << 6;
221 if (CIMM3<2:2> > 0)
222 offset |= ~((int64_t)0xFF);
223
217 if (Rp1 == 0)
225 NPC = PC + offset;
218 NPC = PC + imm;
219 else
220 NPC = NPC;
221 }}, IsDirectControl, IsCondControl);
222 0x7: c_bnez({{
230 int64_t offset = CIMM5<2:1> << 1 |
231 CIMM3<1:0> << 3 |
232 CIMM5<0:0> << 5 |
233 CIMM5<4:3> << 6;
234 if (CIMM3<2:2> > 0)
235 offset |= ~((int64_t)0xFF);
236
223 if (Rp1 != 0)
238 NPC = PC + offset;
224 NPC = PC + imm;
225 else
226 NPC = NPC;
227 }}, IsDirectControl, IsCondControl);
228 }
229 }
230 0x2: decode COPCODE {
231 0x0: CIOp::c_slli({{
232 imm = CIMM5 | (CIMM1 << 5);

--- 1465 unchanged lines hidden ---