Skip to content

Commit

Permalink
Removed more unsupported code.
Browse files Browse the repository at this point in the history
  • Loading branch information
rharding8 committed Apr 20, 2024
1 parent 7f7d4a8 commit edbc685
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 112 deletions.
64 changes: 0 additions & 64 deletions src/parser/parser_assembler_main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2542,70 +2542,6 @@ pub fn read_instructions_riscv(
monaco_line_info[instruction.line_number].mouse_hover_string = info.to_string();
}
}
"uret" => {
// uret instruction encoding does not change
instruction.binary = 0b00000000001000000000000001110011;

//Pseudo-instructions already have text in mouse_hover_string so we check if there's text there already before adding in the blurb
if monaco_line_info[instruction.line_number]
.mouse_hover_string
.is_empty()
{
let info = InstructionDescription{
syntax: "uret".to_string(),
description: "Return from traps in U-mode, and URET copies UPIE into UIE, then sets UPIE.".to_string(),
};
monaco_line_info[instruction.line_number].mouse_hover_string = info.to_string();
}
}
"sret" => {
// uret instruction encoding does not change
instruction.binary = 0b00010000001000000000000001110011;

//Pseudo-instructions already have text in mouse_hover_string so we check if there's text there already before adding in the blurb
if monaco_line_info[instruction.line_number]
.mouse_hover_string
.is_empty()
{
let info = InstructionDescription{
syntax: "uret".to_string(),
description: "Return from traps in U-mode, and URET copies UPIE into UIE, then sets UPIE.".to_string(),
};
monaco_line_info[instruction.line_number].mouse_hover_string = info.to_string();
}
}
"mret" => {
// uret instruction encoding does not change
instruction.binary = 0b00110000001000000000000001110011;

//Pseudo-instructions already have text in mouse_hover_string so we check if there's text there already before adding in the blurb
if monaco_line_info[instruction.line_number]
.mouse_hover_string
.is_empty()
{
let info = InstructionDescription{
syntax: "mret".to_string(),
description: "Return from traps in M-mode, and MRET copies MPIE into MIE, then sets MPIE.".to_string(),
};
monaco_line_info[instruction.line_number].mouse_hover_string = info.to_string();
}
}
"wfi" => {
// uret instruction encoding does not change
instruction.binary = 0b00010000010100000000000001110011;

//Pseudo-instructions already have text in mouse_hover_string so we check if there's text there already before adding in the blurb
if monaco_line_info[instruction.line_number]
.mouse_hover_string
.is_empty()
{
let info = InstructionDescription{
syntax: "wfi".to_string(),
description: "Provides a hint to the implementation that the current hart can be stalled until an interrupt might need servicing.\n\nExecution of the WFI instruction can also be used to inform the hardware platform that suitable interrupts should preferentially be routed to this hart.\n\nWFI is available in all privileged modes, and optionally available to U-mode.\n\nThis instruction may raise an illegal instruction exception when TW=1 in mstatus.".to_string(),
};
monaco_line_info[instruction.line_number].mouse_hover_string = info.to_string();
}
}
"lui" => {
read_operands_riscv(
instruction,
Expand Down
48 changes: 0 additions & 48 deletions src/tests/parser/parser_assembler_main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,54 +475,6 @@ mod read_riscv_instructions_tests {
);
}

#[test]
fn read_instructions_uret() {
let file_string = "uret".to_string();

let instruction_list = instruction_parser_riscv(file_string);

assert_eq!(
instruction_list[0].binary,
0b00000000001000000000000001110011
);
}

#[test]
fn read_instructions_sret() {
let file_string = "sret".to_string();

let instruction_list = instruction_parser_riscv(file_string);

assert_eq!(
instruction_list[0].binary,
0b00010000001000000000000001110011
);
}

#[test]
fn read_instructions_mret() {
let file_string = "mret".to_string();

let instruction_list = instruction_parser_riscv(file_string);

assert_eq!(
instruction_list[0].binary,
0b00110000001000000000000001110011
);
}

#[test]
fn read_instructions_wfi() {
let file_string = "wfi".to_string();

let instruction_list = instruction_parser_riscv(file_string);

assert_eq!(
instruction_list[0].binary,
0b00010000010100000000000001110011
);
}

#[test]
fn read_instructions_lui() {
let file_string = "lui x16, 4096".to_string();
Expand Down

0 comments on commit edbc685

Please sign in to comment.