-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for RV64SI tests and RV64D instructions
- Loading branch information
Showing
5 changed files
with
83 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,42 @@ | ||
use super::*; | ||
|
||
#[rustfmt::skip] | ||
fn rv32f() -> Vec<InstPattern> { | ||
fn rv32d() -> Vec<InstPattern> { | ||
vec![ | ||
InstPattern::new("fadd.d", "0000000 ????? ????? ??? ????? 1010011", Instruction::Register(RegisterType::FADD_D)), | ||
InstPattern::new("fsub.d", "0000100 ????? ????? ??? ????? 1010011", Instruction::Register(RegisterType::FSUB_D)), | ||
InstPattern::new("fmul.d", "0001000 ????? ????? ??? ????? 1010011", Instruction::Register(RegisterType::FMUL_D)), | ||
InstPattern::new("fdiv.d", "0001100 ????? ????? ??? ????? 1010011", Instruction::Register(RegisterType::FDIV_D)), | ||
InstPattern::new("fsqrt.d", "0001100 00000 ????? ??? ????? 1010011", Instruction::Register(RegisterType::FSQRT_D)), | ||
InstPattern::new("fsgnj.d", "0010000 ????? ????? 000 ????? 1010011", Instruction::Register(RegisterType::FSGNJ_D)), | ||
InstPattern::new("fsgnjn.d", "0010000 ????? ????? 001 ????? 1010011", Instruction::Register(RegisterType::FSGNJN_D)), | ||
InstPattern::new("fsgnjx.d", "0010000 ????? ????? 010 ????? 1010011", Instruction::Register(RegisterType::FSGNJX_D)), | ||
InstPattern::new("fmin.d", "0010100 ????? ????? 000 ????? 1010011", Instruction::Register(RegisterType::FMIN_D)), | ||
InstPattern::new("fmax.d", "0010100 ????? ????? 001 ????? 1010011", Instruction::Register(RegisterType::FMAX_D)), | ||
InstPattern::new("fcvt.w.d", "1100000 ????? ????? ??? ????? 1010011", Instruction::Register(RegisterType::FCVT_W_D)), | ||
InstPattern::new("fmv.x.w", "1110000 00000 ????? 000 ????? 1010011", Instruction::Register(RegisterType::FMV_X_W)), | ||
InstPattern::new("feq.d", "1010000 ????? ????? 010 ????? 1010011", Instruction::Register(RegisterType::FEQ_D)), | ||
InstPattern::new("flt.d", "1010000 ????? ????? 001 ????? 1010011", Instruction::Register(RegisterType::FLT_D)), | ||
InstPattern::new("fle.d", "1010000 ????? ????? 000 ????? 1010011", Instruction::Register(RegisterType::FLE_D)), | ||
InstPattern::new("fclass.d", "1110000 00000 ????? 001 ????? 1010011", Instruction::Register(RegisterType::FCLASS_D)), | ||
InstPattern::new("fcvt.d.w", "1101000 00000 ????? ??? ????? 1010011", Instruction::Register(RegisterType::FCVT_D_W)), | ||
InstPattern::new("fmv.w.x", "1111000 00000 ????? 000 ????? 1010011", Instruction::Register(RegisterType::FMV_X_W)), | ||
InstPattern::new("fld", "??????? ????? ????? 011 ????? 0000111", Instruction::Immediate(ImmediateType::FLD)), | ||
InstPattern::new("fsd", "??????? ????? ????? 011 ????? 0100111", Instruction::Store(StoreType::FSD)), | ||
InstPattern::new("fadd.d", "0000001 ????? ????? ??? ????? 1010011", Instruction::Register(RegisterType::FADD_D)), | ||
InstPattern::new("fsub.d", "0000101 ????? ????? ??? ????? 1010011", Instruction::Register(RegisterType::FSUB_D)), | ||
InstPattern::new("fmul.d", "0001001 ????? ????? ??? ????? 1010011", Instruction::Register(RegisterType::FMUL_D)), | ||
InstPattern::new("fdiv.d", "0001101 ????? ????? ??? ????? 1010011", Instruction::Register(RegisterType::FDIV_D)), | ||
InstPattern::new("fsqrt.d", "0001101 00000 ????? ??? ????? 1010011", Instruction::Register(RegisterType::FSQRT_D)), | ||
InstPattern::new("fsgnj.d", "0010001 ????? ????? 000 ????? 1010011", Instruction::Register(RegisterType::FSGNJ_D)), | ||
InstPattern::new("fsgnjn.d", "0010001 ????? ????? 001 ????? 1010011", Instruction::Register(RegisterType::FSGNJN_D)), | ||
InstPattern::new("fsgnjx.d", "0010001 ????? ????? 010 ????? 1010011", Instruction::Register(RegisterType::FSGNJX_D)), | ||
InstPattern::new("fmin.d", "0010101 ????? ????? 000 ????? 1010011", Instruction::Register(RegisterType::FMIN_D)), | ||
InstPattern::new("fmax.d", "0010101 ????? ????? 001 ????? 1010011", Instruction::Register(RegisterType::FMAX_D)), | ||
InstPattern::new("fcvt.s.d", "0100000 00001 ????? ??? ????? 1010011", Instruction::Register(RegisterType::FCVT_S_D)), | ||
InstPattern::new("fcvt.d.s", "0100001 00000 ????? ??? ????? 1010011", Instruction::Register(RegisterType::FCVT_D_S)), | ||
InstPattern::new("feq.d", "1010001 ????? ????? 010 ????? 1010011", Instruction::Register(RegisterType::FEQ_D)), | ||
InstPattern::new("flt.d", "1010001 ????? ????? 001 ????? 1010011", Instruction::Register(RegisterType::FLT_D)), | ||
InstPattern::new("fle.d", "1010001 ????? ????? 000 ????? 1010011", Instruction::Register(RegisterType::FLE_D)), | ||
InstPattern::new("fclass.d", "1110001 00000 ????? 001 ????? 1010011", Instruction::Register(RegisterType::FCLASS_D)), | ||
InstPattern::new("fcvt.w.d", "1100001 00000 ????? ??? ????? 1010011", Instruction::Register(RegisterType::FCVT_W_D)), | ||
InstPattern::new("fmv.d.w", "1101001 00000 ????? ??? ????? 1010011", Instruction::Register(RegisterType::FMV_D_W)), | ||
] | ||
} | ||
|
||
#[rustfmt::skip] | ||
pub fn rv64f() -> Vec<InstPattern> { | ||
let mut f = vec![ | ||
// rv64f | ||
InstPattern::new("fcvt.l.d", "1100000 00010 ????? ??? ????? 1010011", Instruction::Register(RegisterType::FCVT_L_D)), | ||
InstPattern::new("fcvt.lu.d", "1100000 00011 ????? ??? ????? 1010011", Instruction::Register(RegisterType::FCVT_LU_D)), | ||
InstPattern::new("fcvt.d.l", "1101000 00010 ????? ??? ????? 1010011", Instruction::Register(RegisterType::FCVT_D_L)), | ||
InstPattern::new("fcvt.d.lu", "1101000 00011 ????? ??? ????? 1010011", Instruction::Register(RegisterType::FCVT_D_LU)), | ||
pub fn rv64d() -> Vec<InstPattern> { | ||
let mut d = vec![ | ||
// rv64d | ||
InstPattern::new("fcvt.l.d", "1100001 00010 ????? ??? ????? 1010011", Instruction::Register(RegisterType::FCVT_L_D)), | ||
InstPattern::new("fcvt.lu.d", "1100001 00011 ????? ??? ????? 1010011", Instruction::Register(RegisterType::FCVT_LU_D)), | ||
InstPattern::new("fmv.x.d", "1110001 00000 ????? 000 ????? 1010011", Instruction::Register(RegisterType::FMV_X_D)), | ||
InstPattern::new("fcvt.d.l", "1101001 00010 ????? ??? ????? 1010011", Instruction::Register(RegisterType::FCVT_D_L)), | ||
InstPattern::new("fcvt.d.lu", "1101001 00011 ????? ??? ????? 1010011", Instruction::Register(RegisterType::FCVT_D_LU)), | ||
InstPattern::new("fcvt.d.x", "1111001 00000 ????? 000 ????? 1010011", Instruction::Register(RegisterType::FMV_D_X)), | ||
]; | ||
f.extend(rv32f()); | ||
f | ||
d.extend(rv32d()); | ||
d | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters