Skip to content

Commit 363379c

Browse files
committed
simplify CSR function
1 parent 8726cf4 commit 363379c

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

include/insns/Zicsr.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,7 @@ class Zicsr : public RevExt {
8181
// This calls the 32/64-bit ModCSR depending on the current XLEN
8282
template<OpKind OPKIND, CSROp OP>
8383
static bool ModCSR( RevFeature* F, RevRegFile* R, RevMem* M, const RevInst& Inst ) {
84-
bool ret;
85-
if( R->IsRV32 ) {
86-
ret = ModCSRImpl<uint32_t, OPKIND, OP>( F, R, M, Inst );
87-
} else {
88-
ret = ModCSRImpl<uint64_t, OPKIND, OP>( F, R, M, Inst );
89-
}
90-
return ret;
84+
return R->IsRV32 ? ModCSRImpl<uint32_t, OPKIND, OP>( F, R, M, Inst ) : ModCSRImpl<uint64_t, OPKIND, OP>( F, R, M, Inst );
9185
}
9286

9387
static constexpr auto& csrrw = ModCSR<OpKind::Reg, CSROp::Write>;

0 commit comments

Comments
 (0)