Helper to cast a host pointer integer type to the destination type.
(&mut self, val: ir::Value, is64: bool)
| 1977 | |
| 1978 | // Helper to cast a host pointer integer type to the destination type. |
| 1979 | fn cast_from_pointer(&mut self, val: ir::Value, is64: bool) -> ir::Value { |
| 1980 | let host64 = self.isa.pointer_type() == ir::types::I64; |
| 1981 | if is64 == host64 { |
| 1982 | val |
| 1983 | } else if !is64 { |
| 1984 | assert!(host64); |
| 1985 | self.builder.ins().ireduce(ir::types::I32, val) |
| 1986 | } else { |
| 1987 | assert!(!host64); |
| 1988 | self.builder.ins().uextend(ir::types::I64, val) |
| 1989 | } |
| 1990 | } |
| 1991 | |
| 1992 | fn load_runtime_memory_base(&mut self, vmctx: ir::Value, mem: RuntimeMemoryIndex) -> ir::Value { |
| 1993 | let pointer_type = self.isa.pointer_type(); |
no test coverage detected