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

@@ -17,9 +17,10 @@ use crate::{
},
regs, x64_map_regs,
},
settings::Flags,
settings::Flags as IsaFlags,
},
machinst::{isle::*, InsnInput, InsnOutput, LowerCtx, VCodeConstantData},
settings::Flags,
};
use std::convert::TryFrom;
@@ -32,7 +33,8 @@ pub struct SinkableLoad {
/// 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<(), ()>
@@ -41,6 +43,7 @@ where
{
lower_common(
lower_ctx,
flags,
isa_flags,
outputs,
inst,
@@ -49,7 +52,7 @@ where
)
}
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>,
{