properly selecting li instructions for integer sizes
This commit is contained in:
parent
2bab16d3ce
commit
62a7c61cdc
|
@ -1430,9 +1430,12 @@ impl ItemCtx {
|
||||||
self.emit(instrs::jmp(0));
|
self.emit(instrs::jmp(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Kind::CInt { value } => {
|
Kind::CInt { value } => self.emit(match tys.size_of(node.ty) {
|
||||||
self.emit(instrs::li64(atr(allocs[0]), value as _));
|
1 => instrs::li8(atr(allocs[0]), value as _),
|
||||||
}
|
2 => instrs::li16(atr(allocs[0]), value as _),
|
||||||
|
4 => instrs::li32(atr(allocs[0]), value as _),
|
||||||
|
_ => instrs::li64(atr(allocs[0]), value as _),
|
||||||
|
}),
|
||||||
Kind::Extend => {
|
Kind::Extend => {
|
||||||
let base = fuc.nodes[node.inputs[1]].ty;
|
let base = fuc.nodes[node.inputs[1]].ty;
|
||||||
let dest = node.ty;
|
let dest = node.ty;
|
||||||
|
|
Loading…
Reference in a new issue