removing needless truncation of zeroth register

This commit is contained in:
Jakub Doka 2024-11-16 10:03:08 +01:00
parent 867a750d8f
commit 085c593add
No known key found for this signature in database
GPG key ID: C6E9A89936B8C143

View file

@ -458,6 +458,10 @@ struct InstrCtx<'a> {
impl HbvmBackend {
fn extend(&mut self, base: ty::Id, dest: ty::Id, reg: Reg, tys: &Types, files: &[parser::Ast]) {
if reg == 0 {
return;
}
let (bsize, dsize) = (tys.size_of(base), tys.size_of(dest));
debug_assert!(bsize <= 8, "{}", ty::Display::new(tys, files, base));
debug_assert!(dsize <= 8, "{}", ty::Display::new(tys, files, dest));