MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / is_constant_64bit

Function is_constant_64bit

cranelift/codegen/src/inst_predicates.rs:105–113  ·  view source on GitHub ↗

Is the given instruction a constant value (`iconst`, `fconst`) that can be represented in 64 bits?

(func: &Function, inst: Inst)

Source from the content-addressed store, hash-verified

103/// Is the given instruction a constant value (`iconst`, `fconst`) that can be
104/// represented in 64 bits?
105pub fn is_constant_64bit(func: &Function, inst: Inst) -> Option<u64> {
106 match &func.dfg.insts[inst] {
107 &InstructionData::UnaryImm { imm, .. } => Some(imm.bits() as u64),
108 &InstructionData::UnaryIeee16 { imm, .. } => Some(imm.bits() as u64),
109 &InstructionData::UnaryIeee32 { imm, .. } => Some(imm.bits() as u64),
110 &InstructionData::UnaryIeee64 { imm, .. } => Some(imm.bits()),
111 _ => None,
112 }
113}
114
115/// Get the address, offset, and access type from the given instruction, if any.
116pub fn inst_addr_offset_type(func: &Function, inst: Inst) -> Option<(Value, Offset32, Type)> {

Callers 1

newMethod · 0.85

Calls 1

bitsMethod · 0.45

Tested by

no test coverage detected