ty: add I32 constants

This commit is contained in:
Igor kehrazy 2026-04-07 13:53:30 +03:00
parent ebf798e22e
commit 2a414d38e1
2 changed files with 5 additions and 3 deletions

View file

@ -3,7 +3,7 @@
use crate::{ use crate::{
arch::{Arch, LiftArch, LiftEnv, RegisterDesc}, arch::{Arch, LiftArch, LiftEnv, RegisterDesc},
flow::{FlowInfo, FlowKind, FlowTarget}, flow::{FlowInfo, FlowKind, FlowTarget},
ir::{Block, FrontendBuilder, IntCC, MemSize, Type, Value, Variable}, ir::{Block, FrontendBuilder, I32, IntCC, MemSize, Type, Value, Variable},
}; };
use cranelift_entity::EntityRef; use cranelift_entity::EntityRef;
@ -519,9 +519,9 @@ impl Arm {
Operand::RegDerefPreindexOffset(base, off, add, wback) => { Operand::RegDerefPreindexOffset(base, off, add, wback) => {
let base_reg = Self::map_reg(base); let base_reg = Self::map_reg(base);
let base_v = cx.read_reg(base_reg); let base_v = cx.read_reg(base_reg);
let off_v = cx.fb.iconst(Type::i32(), off as i64); let off_v = cx.fb.iconst(I32, off as i64);
let addr = if add { let addr = if add {
cx.fb.iadd(base_v, off_v, Type::i32()) cx.fb.iadd(base_v, off_v, I32)
} else { } else {
cx.fb.isub(base_v, off_v, Type::i32()) cx.fb.isub(base_v, off_v, Type::i32())
}; };

View file

@ -449,3 +449,5 @@ impl fmt::Display for LaneType {
} }
} }
} }
pub const I32: Type = Type::i32();