1 //! Lowering rules for Riscv64.
2 use crate::ir::Inst as IRInst;
3 use crate::isa::riscv64::Riscv64Backend;
4 use crate::isa::riscv64::inst::*;
5 use crate::machinst::lower::*;
6 use crate::machinst::*;
7 pub mod isle;
8 
9 //=============================================================================
10 // Lowering-backend trait implementation.
11 
12 impl LowerBackend for Riscv64Backend {
13     type MInst = Inst;
14 
lower(&self, ctx: &mut Lower<Inst>, ir_inst: IRInst) -> Option<InstOutput>15     fn lower(&self, ctx: &mut Lower<Inst>, ir_inst: IRInst) -> Option<InstOutput> {
16         isle::lower(ctx, self, ir_inst)
17     }
18 
lower_branch( &self, ctx: &mut Lower<Inst>, ir_inst: IRInst, targets: &[MachLabel], ) -> Option<()>19     fn lower_branch(
20         &self,
21         ctx: &mut Lower<Inst>,
22         ir_inst: IRInst,
23         targets: &[MachLabel],
24     ) -> Option<()> {
25         isle::lower_branch(ctx, self, ir_inst, targets)
26     }
27 
maybe_pinned_reg(&self) -> Option<Reg>28     fn maybe_pinned_reg(&self) -> Option<Reg> {
29         // pinned register is a register that you want put anything in it.
30         // right now riscv64 not support this feature.
31         None
32     }
33 }
34