From: Luke Kenneth Casson Leighton Date: Fri, 19 Oct 2018 12:17:51 +0000 (+0100) Subject: remove unneeded get_data calls X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e2f852668ab66d892254a53519dacda3a49770d5;p=riscv-isa-sim.git remove unneeded get_data calls --- diff --git a/riscv/sv_insn_redirect.cc b/riscv/sv_insn_redirect.cc index f4d7711..d49ef60 100644 --- a/riscv/sv_insn_redirect.cc +++ b/riscv/sv_insn_redirect.cc @@ -29,50 +29,50 @@ void (sv_proc_t::WRITE_FRD)(freg_t value) // //void (sv_proc_t::WRITE_RD)(sv_reg_t value) //{ -// WRITE_REG( _insn->rd(), value/*.get_data()*/ ); +// WRITE_REG( _insn->rd(), value ); //} //void (sv_proc_t::WRITE_RVC_RS1S)(sv_sreg_t value) //{ -// WRITE_REG(_insn->rvc_rs1s(), value/*.get_data()*/ ); +// WRITE_REG(_insn->rvc_rs1s(), value ); //} void (sv_proc_t::WRITE_RVC_RS1S)(sv_reg_t value) { - WRITE_REG(_insn->rvc_rs1s(), value/*.get_data()*/ ); + WRITE_REG(_insn->rvc_rs1s(), value ); } void (sv_proc_t::WRITE_RVC_RS2S)(sv_reg_t value) { - WRITE_REG(_insn->rvc_rs2s(), value/*.get_data()*/ ); + WRITE_REG(_insn->rvc_rs2s(), value ); } //void (sv_proc_t::WRITE_RVC_RS2S)(sv_sreg_t value) //{ -// WRITE_REG(_insn->rvc_rs2s(), value/*.get_data()*/ ); +// WRITE_REG(_insn->rvc_rs2s(), value ); //} void (sv_proc_t::WRITE_RD)(sv_reg_t value) { - WRITE_REG( _insn->rd(), value/*.get_data()*/ ); // XXX TODO: replace properly + WRITE_REG( _insn->rd(), value ); // XXX TODO: replace properly } //void (sv_proc_t::WRITE_RD)(sv_sreg_t value) //{ -// WRITE_REG( _insn->rd(), value/*.get_data()*/ ); // XXX TODO: replace properly +// WRITE_REG( _insn->rd(), value ); // XXX TODO: replace properly //} //void (sv_proc_t::WRITE_REG)(reg_t reg, sv_sreg_t value) //{ -// //WRITE_REG( reg, value/*.get_data()*/ ); // XXX TODO: replace properly -// STATE.XPR.write(reg, value/*.get_data()*/); +// //WRITE_REG( reg, value ); // XXX TODO: replace properly +// STATE.XPR.write(reg, value); //} void (sv_proc_t::WRITE_REG)(reg_t reg, sv_reg_t value) { - //WRITE_REG( reg, value/*.get_data()*/ ); // XXX TODO: replace properly - STATE.XPR.write(reg, value/*.get_data()*/); + //WRITE_REG( reg, value ); // XXX TODO: replace properly + STATE.XPR.write(reg, value); } //void (sv_proc_t::WRITE_REG)(reg_t reg, uint64_t value) @@ -122,7 +122,7 @@ sv_reg_t sv_proc_t::get_rvc_rs1s() sv_reg_t sv_proc_t::get_shamt() { - return sv_reg_t(_insn->i_imm()/*.get_data()*/ & 0x3F); + return sv_reg_t(_insn->i_imm() & 0x3F); } sv_reg_t sv_proc_t::get_rvc_rs2s() @@ -164,21 +164,21 @@ sv_reg_t (sv_proc_t::sext_xlen)(uint64_t x) */ sv_sreg_t (sv_proc_t::sext_xlen)(sv_sreg_t v) { - int64_t x = v/*.get_data()*/; + int64_t x = v; x = (((sreg_t)(x) << (64-xlen)) >> (64-xlen)); return sv_sreg_t(x); } sv_sreg_t (sv_proc_t::sext_xlen)(sv_reg_t v) { - uint64_t x = v/*.get_data()*/; + uint64_t x = v; x = (((sreg_t)(x) << (64-xlen)) >> (64-xlen)); return sv_sreg_t((sreg_t)x); } sv_reg_t (sv_proc_t::zext_xlen)(sv_reg_t v) { - uint64_t x = v/*.get_data()*/; + uint64_t x = v; x = (((reg_t)(x) << (64-xlen)) >> (64-xlen)); return sv_reg_t(x); } @@ -191,21 +191,21 @@ sv_reg_t (sv_proc_t::sext32)(uint_fast32_t v) */ sv_sreg_t (sv_proc_t::sext32)(sv_reg_t v) { - uint64_t x = v/*.get_data()*/; + uint64_t x = v; x = ((sreg_t)(int32_t)(x)); return sv_sreg_t((int64_t)x); } //sv_sreg_t (sv_proc_t::sext32)(sv_sreg_t v) //{ -// int64_t x = v/*.get_data()*/; +// int64_t x = v; // x = ((sreg_t)(int32_t)(x)); // return sv_sreg_t(x); //} sv_reg_t (sv_proc_t::zext32)(sv_reg_t v) { - uint64_t x = v/*.get_data()*/; + uint64_t x = v; x = ((reg_t)(uint32_t)(x)); return sv_reg_t(x); } @@ -285,134 +285,134 @@ sv_reg_t::operator sv_reg_t () */ sv_reg_t sv_proc_t::rv_add(sv_reg_t lhs, sv_reg_t rhs) { - return lhs/*.get_data()*/ + rhs/*.get_data()*/; + return lhs + rhs; } sv_reg_t sv_proc_t::rv_sub(sv_reg_t lhs, sv_reg_t rhs) { - return lhs/*.get_data()*/ - rhs/*.get_data()*/; + return lhs - rhs; } sv_sreg_t sv_proc_t::rv_div(sv_sreg_t lhs, sv_sreg_t rhs) { - return lhs/*.get_data()*/ / rhs/*.get_data()*/; + return lhs / rhs; } sv_reg_t sv_proc_t::rv_div(sv_reg_t lhs, sv_reg_t rhs) { - return lhs/*.get_data()*/ / rhs/*.get_data()*/; + return lhs / rhs; } sv_sreg_t sv_proc_t::rv_rem(sv_sreg_t lhs, sv_sreg_t rhs) { - return lhs/*.get_data()*/ % rhs/*.get_data()*/; + return lhs % rhs; } sv_reg_t sv_proc_t::rv_rem(sv_reg_t lhs, sv_reg_t rhs) { - return lhs/*.get_data()*/ % rhs/*.get_data()*/; + return lhs % rhs; } sv_reg_t sv_proc_t::rv_mul(sv_reg_t lhs, sv_reg_t rhs) { - return lhs/*.get_data()*/ * rhs/*.get_data()*/; + return lhs * rhs; } sv_sreg_t sv_proc_t::rv_mul(sv_sreg_t lhs, sv_reg_t rhs) { - return lhs/*.get_data()*/ * rhs/*.get_data()*/; + return lhs * rhs; } sv_sreg_t sv_proc_t::rv_mul(sv_sreg_t lhs, sv_sreg_t rhs) { - return lhs/*.get_data()*/ * rhs/*.get_data()*/; + return lhs * rhs; } sv_reg_t sv_proc_t::rv_and(sv_reg_t lhs, sv_reg_t rhs) { - return lhs/*.get_data()*/ & rhs/*.get_data()*/; + return lhs & rhs; } sv_reg_t sv_proc_t::rv_or(sv_reg_t lhs, sv_reg_t rhs) { - return lhs/*.get_data()*/ | rhs/*.get_data()*/; + return lhs | rhs; } sv_reg_t sv_proc_t::rv_xor(sv_reg_t lhs, sv_reg_t rhs) { - return lhs/*.get_data()*/ ^ rhs/*.get_data()*/; + return lhs ^ rhs; } sv_reg_t sv_proc_t::rv_sl(sv_reg_t lhs, sv_reg_t rhs) { - return lhs/*.get_data()*/ << rhs/*.get_data()*/; + return lhs << rhs; } //sv_sreg_t sv_proc_t::rv_sr(sv_sreg_t lhs, sv_reg_t rhs) //{ -// return lhs/*.get_data()*/ >> rhs/*.get_data()*/; +// return lhs >> rhs; //} sv_reg_t sv_proc_t::rv_sr(sv_reg_t lhs, sv_reg_t rhs) { - return lhs/*.get_data()*/ >> rhs/*.get_data()*/; + return lhs >> rhs; } bool sv_proc_t::rv_lt(sv_reg_t lhs, sv_reg_t rhs) { - return lhs/*.get_data()*/ < rhs/*.get_data()*/; + return lhs < rhs; } bool sv_proc_t::rv_lt(sv_sreg_t lhs, sv_sreg_t rhs) { - return lhs/*.get_data()*/ < rhs/*.get_data()*/; + return lhs < rhs; } bool sv_proc_t::rv_gt(sv_reg_t lhs, sv_reg_t rhs) { - return lhs/*.get_data()*/ > rhs/*.get_data()*/; + return lhs > rhs; } bool sv_proc_t::rv_gt(sv_sreg_t lhs, sv_sreg_t rhs) { - return lhs/*.get_data()*/ > rhs/*.get_data()*/; + return lhs > rhs; } bool sv_proc_t::rv_ge(sv_reg_t lhs, sv_reg_t rhs) { - return lhs/*.get_data()*/ >= rhs/*.get_data()*/; + return lhs >= rhs; } bool sv_proc_t::rv_ge(sv_sreg_t lhs, sv_sreg_t rhs) { - return lhs/*.get_data()*/ >= rhs/*.get_data()*/; + return lhs >= rhs; } bool sv_proc_t::rv_eq(sv_reg_t lhs, sv_reg_t rhs) { - return lhs/*.get_data()*/ == rhs/*.get_data()*/; + return lhs == rhs; } bool sv_proc_t::rv_ne(sv_reg_t lhs, sv_reg_t rhs) { - return (lhs/*.get_data()*/ != rhs/*.get_data()*/); + return (lhs != rhs); } sv_sreg_t sv_proc_t::sv_reg_to_sreg(sv_reg_t v) { - uint64_t x = v/*.get_data()*/; + uint64_t x = v; return sv_sreg_t(sreg_t(x)); } sv_reg_t sv_proc_t::sv_reg_int32(sv_reg_t v) { - int32_t x = (int32_t)v/*.get_data()*/; + int32_t x = (int32_t)v; return sv_reg_t((uint64_t)x); } sv_reg_t sv_proc_t::sv_reg_uint32(sv_reg_t v) { - uint32_t x = (uint32_t)v/*.get_data()*/; + uint32_t x = (uint32_t)v; return sv_reg_t((uint64_t)x); } @@ -422,7 +422,7 @@ float32_t (sv_proc_t::f32)(freg_t x) } float32_t (sv_proc_t::f32)(sv_reg_t v) { - uint64_t x = v/*.get_data()*/; + uint64_t x = v; return ::f32(x); } @@ -433,7 +433,7 @@ float64_t (sv_proc_t::f64)(freg_t v) float64_t (sv_proc_t::f64)(sv_reg_t v) { - uint64_t x = v/*.get_data()*/; + uint64_t x = v; return ::f64(x); } @@ -454,73 +454,73 @@ sv_reg_t (sv_proc_t::f128_classify)(float128_t a) float32_t (sv_proc_t::i32_to_f32)( sv_reg_t v ) { - uint64_t x = v/*.get_data()*/; + uint64_t x = v; return ::i32_to_f32(x); } float64_t (sv_proc_t::ui32_to_f64)( sv_reg_t v ) { - uint64_t x = v/*.get_data()*/; + uint64_t x = v; return ::ui32_to_f64(x); } float64_t (sv_proc_t::i32_to_f64)( sv_reg_t v ) { - uint64_t x = v/*.get_data()*/; + uint64_t x = v; return ::i32_to_f64(x); } float32_t (sv_proc_t::ui32_to_f32)( sv_reg_t v ) { - uint64_t x = v/*.get_data()*/; + uint64_t x = v; return ::ui32_to_f32(x); } float32_t (sv_proc_t::i64_to_f32)( sv_reg_t v ) { - uint64_t x = v/*.get_data()*/; + uint64_t x = v; return ::i64_to_f32(x); } float32_t (sv_proc_t::ui64_to_f32)( sv_reg_t v ) { - uint64_t x = v/*.get_data()*/; + uint64_t x = v; return ::ui64_to_f32(x); } float64_t (sv_proc_t::i64_to_f64)( sv_reg_t v ) { - uint64_t x = v/*.get_data()*/; + uint64_t x = v; return ::i64_to_f64(x); } float64_t (sv_proc_t::ui64_to_f64)( sv_reg_t v ) { - uint64_t x = v/*.get_data()*/; + uint64_t x = v; return ::ui64_to_f64(x); } float128_t (sv_proc_t::ui64_to_f128)( sv_reg_t v ) { - uint64_t x = v/*.get_data()*/; + uint64_t x = v; return ::ui64_to_f128(x); } float128_t (sv_proc_t::i64_to_f128)( sv_reg_t v ) { - uint64_t x = v/*.get_data()*/; + uint64_t x = v; return ::i64_to_f128(x); } float128_t (sv_proc_t::i32_to_f128)( sv_reg_t v ) { - uint64_t x = v/*.get_data()*/; + uint64_t x = v; return ::i32_to_f128(x); } float128_t (sv_proc_t::ui32_to_f128)( sv_reg_t v ) { - uint64_t x = v/*.get_data()*/; + uint64_t x = v; return ::ui32_to_f128(x); } @@ -598,17 +598,17 @@ sv_reg_t (sv_proc_t::f128_to_i64)( float128_t a, uint_fast8_t roundingMode, sv_sreg_t (sv_proc_t::mulhsu)(sv_sreg_t a, sv_reg_t b) { - return sv_sreg_t(::mulhsu(a/*.get_data()*/, b/*.get_data()*/)); + return sv_sreg_t(::mulhsu(a, b)); } sv_sreg_t (sv_proc_t::mulh)(sv_sreg_t a, sv_sreg_t b) { - return sv_sreg_t(::mulh(a/*.get_data()*/, b/*.get_data()*/)); + return sv_sreg_t(::mulh(a, b)); } sv_reg_t (sv_proc_t::mulhu)(sv_reg_t a, sv_reg_t b) { - return sv_reg_t(::mulhu(a/*.get_data()*/, b/*.get_data()*/)); + return sv_reg_t(::mulhu(a, b)); }