fuzzgen: Add a few more ops (#5201)

Adds `bitselect`,`select` and `select_spectre_guard`
This commit is contained in:
Afonso Bordado
2022-11-07 17:08:26 +00:00
committed by GitHub
parent 508dd81928
commit 9814e8bfeb
2 changed files with 107 additions and 2 deletions

View File

@@ -544,8 +544,9 @@ where
Opcode::Vconst => assign(imm()),
Opcode::Null => unimplemented!("Null"),
Opcode::Nop => ControlFlow::Continue,
Opcode::Select => choose(arg(0)?.into_bool()?, arg(1)?, arg(2)?),
Opcode::SelectSpectreGuard => unimplemented!("SelectSpectreGuard"),
Opcode::Select | Opcode::SelectSpectreGuard => {
choose(arg(0)?.into_bool()?, arg(1)?, arg(2)?)
}
Opcode::Bitselect => {
let mask_a = Value::and(arg(0)?, arg(1)?)?;
let mask_b = Value::and(Value::not(arg(0)?)?, arg(2)?)?;