-
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 RV64F floating-point instructions
- Loading branch information
Showing
3 changed files
with
72 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
use super::*; | ||
|
||
#[rustfmt::skip] | ||
fn rv32f() -> Vec<InstPattern> { | ||
vec![ | ||
InstPattern::new("fadd.s", "0000000 ????? ????? ??? ????? 1010011", Instruction::Register(RegisterType::FADD_S)), | ||
InstPattern::new("fsub.s", "0000100 ????? ????? ??? ????? 1010011", Instruction::Register(RegisterType::FSUB_S)), | ||
InstPattern::new("fmul.s", "0001000 ????? ????? ??? ????? 1010011", Instruction::Register(RegisterType::FMUL_S)), | ||
InstPattern::new("fdiv.s", "0001100 ????? ????? ??? ????? 1010011", Instruction::Register(RegisterType::FDIV_S)), | ||
InstPattern::new("fsqrt.s", "0001100 00000 ????? ??? ????? 1010011", Instruction::Register(RegisterType::FSQRT_S)), | ||
InstPattern::new("fsgnj.s", "0010000 ????? ????? 000 ????? 1010011", Instruction::Register(RegisterType::FSGNJ_S)), | ||
InstPattern::new("fsgnjn.s", "0010000 ????? ????? 001 ????? 1010011", Instruction::Register(RegisterType::FSGNJN_S)), | ||
InstPattern::new("fsgnjx.s", "0010000 ????? ????? 010 ????? 1010011", Instruction::Register(RegisterType::FSGNJX_S)), | ||
InstPattern::new("fmin.s", "0010100 ????? ????? 000 ????? 1010011", Instruction::Register(RegisterType::FMIN_S)), | ||
InstPattern::new("fmax.s", "0010100 ????? ????? 001 ????? 1010011", Instruction::Register(RegisterType::FMAX_S)), | ||
InstPattern::new("fcvt.w.s", "1100000 ????? ????? ??? ????? 1010011", Instruction::Register(RegisterType::FCVT_W_S)), | ||
InstPattern::new("fmv.x.w", "1110000 00000 ????? 000 ????? 1010011", Instruction::Register(RegisterType::FMV_X_W)), | ||
InstPattern::new("feq.s", "1010000 ????? ????? 010 ????? 1010011", Instruction::Register(RegisterType::FEQ_S)), | ||
InstPattern::new("flt.s", "1010000 ????? ????? 001 ????? 1010011", Instruction::Register(RegisterType::FLT_S)), | ||
InstPattern::new("fle.s", "1010000 ????? ????? 000 ????? 1010011", Instruction::Register(RegisterType::FLE_S)), | ||
InstPattern::new("fclass.s", "1110000 00000 ????? 001 ????? 1010011", Instruction::Register(RegisterType::FCLASS_S)), | ||
InstPattern::new("fcvt.s.w", "1101000 00000 ????? ??? ????? 1010011", Instruction::Register(RegisterType::FCVT_S_W)), | ||
InstPattern::new("fmv.w.x", "1111000 00000 ????? 000 ????? 1010011", Instruction::Register(RegisterType::FMV_X_W)), | ||
] | ||
} | ||
|
||
#[rustfmt::skip] | ||
pub fn rv64f() -> Vec<InstPattern> { | ||
let mut f = vec![ | ||
// rv64f | ||
InstPattern::new("fcvt.l.s", "1100000 00010 ????? ??? ????? 1010011", Instruction::Register(RegisterType::FCVT_L_S)), | ||
InstPattern::new("fcvt.lu.s", "1100000 00011 ????? ??? ????? 1010011", Instruction::Register(RegisterType::FCVT_LU_S)), | ||
InstPattern::new("fcvt.s.l", "1101000 00010 ????? ??? ????? 1010011", Instruction::Register(RegisterType::FCVT_S_L)), | ||
InstPattern::new("fcvt.s.lu", "1101000 00011 ????? ??? ????? 1010011", Instruction::Register(RegisterType::FCVT_S_LU)), | ||
]; | ||
f.extend(rv32f()); | ||
f | ||
} |