ISLE standard prelude: Additional types and helpers

In preparing to move the s390x back-end to ISLE, I noticed a few
missing pieces in the common prelude code.  This patch:

- Defines the reference types $R32 / $R64.
- Provides a trap_code_bad_conversion_to_integer helper.
- Provides an avoid_div_traps helper.  This requires passing the
  generic flags in addition to the ISA-specifc flags into the
  ISLE lowering context.
This commit is contained in:
Ulrich Weigand
2022-01-20 17:23:31 +01:00
parent 9321a9db88
commit be60a19623
10 changed files with 66 additions and 29 deletions

View File

@@ -10,8 +10,9 @@ use super::{
Inst as MInst, JTSequenceInfo, MachLabel, MoveWideConst, NarrowValueMode, Opcode, OperandSize,
PairAMode, Reg, ScalarSize, ShiftOpAndAmt, UImm5, VectorSize, NZCV,
};
use crate::isa::aarch64::settings::Flags;
use crate::isa::aarch64::settings::Flags as IsaFlags;
use crate::machinst::isle::*;
use crate::settings::Flags;
use crate::{
binemit::CodeOffset,
ir::{
@@ -36,7 +37,8 @@ type BoxExternalName = Box<ExternalName>;
/// The main entry point for lowering with ISLE.
pub(crate) fn lower<C>(
lower_ctx: &mut C,
isa_flags: &Flags,
flags: &Flags,
isa_flags: &IsaFlags,
outputs: &[InsnOutput],
inst: Inst,
) -> Result<(), ()>
@@ -45,6 +47,7 @@ where
{
lower_common(
lower_ctx,
flags,
isa_flags,
outputs,
inst,
@@ -63,7 +66,7 @@ pub struct SinkableAtomicLoad {
atomic_addr: Value,
}
impl<C> generated_code::Context for IsleContext<'_, C, Flags, 6>
impl<C> generated_code::Context for IsleContext<'_, C, Flags, IsaFlags, 6>
where
C: LowerCtx<I = MInst>,
{