Port flag-based ops to ISLE (AArch64) (#4942)

Ported the existing implementations of the following opcodes for AArch64
to ISLE:
- `Trueif`
- `Trueff`
- `Trapif`
- `Trapff`
- `Select`
- `Selectif`
- `SelectifSpectreGuard`

Copyright (c) 2022 Arm Limited
This commit is contained in:
Damian Heaton
2022-09-22 23:44:32 +01:00
committed by GitHub
parent 89abd80c3c
commit 3f8cccfb59
12 changed files with 1641 additions and 190 deletions

View File

@@ -942,15 +942,17 @@ where
Opcode::Nearest => assign(Value::nearest(arg(0)?)?),
Opcode::IsNull => unimplemented!("IsNull"),
Opcode::IsInvalid => unimplemented!("IsInvalid"),
// `ctrl_ty` is `INVALID` for `Trueif` and `Trueff`, but both should
// return a 1-bit boolean value.
Opcode::Trueif => choose(
state.has_iflag(inst.cond_code().unwrap()),
Value::bool(true, ctrl_ty)?,
Value::bool(false, ctrl_ty)?,
Value::bool(true, types::B1)?,
Value::bool(false, types::B1)?,
),
Opcode::Trueff => choose(
state.has_fflag(inst.fp_cond_code().unwrap()),
Value::bool(true, ctrl_ty)?,
Value::bool(false, ctrl_ty)?,
Value::bool(true, types::B1)?,
Value::bool(false, types::B1)?,
),
Opcode::Bitcast
| Opcode::RawBitcast