diff --git a/model/riscv_insts_dext.sail b/model/riscv_insts_dext.sail index c89e9f33b..2cb453fbc 100644 --- a/model/riscv_insts_dext.sail +++ b/model/riscv_insts_dext.sail @@ -934,18 +934,14 @@ function clause execute (F_UN_TYPE_D(rs1, rd, FCLASS_D)) = { } function clause execute (F_UN_TYPE_D(rs1, rd, FMV_X_D)) = { - assert(xlen >= 64); - let rs1_val_D = F(rs1)[63..0]; - let rd_val_X : xlenbits = sign_extend(rs1_val_D); - X(rd) = rd_val_X; + assert(xlen >= 64 & flen >= 64); + X(rd) = sign_extend(F(rs1)[63..0]); RETIRE_SUCCESS } function clause execute (F_UN_TYPE_D(rs1, rd, FMV_D_X)) = { - assert(xlen >= 64); - let rs1_val_X = X(rs1); - let rd_val_D = rs1_val_X [63..0]; - F(rd) = rd_val_D; + assert(xlen >= 64 & flen >= 64); + F(rd) = nan_box(X(rs1)[63..0]); RETIRE_SUCCESS } diff --git a/model/riscv_insts_fext.sail b/model/riscv_insts_fext.sail index e42fed4c7..3e6b575e3 100644 --- a/model/riscv_insts_fext.sail +++ b/model/riscv_insts_fext.sail @@ -1061,16 +1061,12 @@ function clause execute (F_UN_TYPE_S(rs1, rd, FCLASS_S)) = { } function clause execute (F_UN_TYPE_S(rs1, rd, FMV_X_W)) = { - let rs1_val_S = F(rs1)[31..0]; - let rd_val_X : xlenbits = sign_extend(rs1_val_S); - X(rd) = rd_val_X; + X(rd) = sign_extend(F(rs1)[31 .. 0]); RETIRE_SUCCESS } function clause execute (F_UN_TYPE_S(rs1, rd, FMV_W_X)) = { - let rs1_val_X = X(rs1); - let rd_val_S = rs1_val_X [31..0]; - F(rd) = nan_box (rd_val_S); + F(rd) = nan_box(X(rs1)[31..0]); RETIRE_SUCCESS }