diff --git a/Cargo.lock b/Cargo.lock index c9389c0d111..31030e61488 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -33,7 +33,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cranelift-bforest" version = "0.58.0" -source = "git+https://github.com/bytecodealliance/cranelift/#280fd1e13b5cdad9d9d308b78bb94b0476f2d9f0" +source = "git+https://github.com/bytecodealliance/cranelift/#f1aa07265b3b25c1859f7184e92fd600316b4b25" dependencies = [ "cranelift-entity 0.58.0 (git+https://github.com/bytecodealliance/cranelift/)", ] @@ -41,7 +41,7 @@ dependencies = [ [[package]] name = "cranelift-codegen" version = "0.58.0" -source = "git+https://github.com/bytecodealliance/cranelift/#280fd1e13b5cdad9d9d308b78bb94b0476f2d9f0" +source = "git+https://github.com/bytecodealliance/cranelift/#f1aa07265b3b25c1859f7184e92fd600316b4b25" dependencies = [ "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "cranelift-bforest 0.58.0 (git+https://github.com/bytecodealliance/cranelift/)", @@ -58,7 +58,7 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" version = "0.58.0" -source = "git+https://github.com/bytecodealliance/cranelift/#280fd1e13b5cdad9d9d308b78bb94b0476f2d9f0" +source = "git+https://github.com/bytecodealliance/cranelift/#f1aa07265b3b25c1859f7184e92fd600316b4b25" dependencies = [ "cranelift-codegen-shared 0.58.0 (git+https://github.com/bytecodealliance/cranelift/)", "cranelift-entity 0.58.0 (git+https://github.com/bytecodealliance/cranelift/)", @@ -67,17 +67,17 @@ dependencies = [ [[package]] name = "cranelift-codegen-shared" version = "0.58.0" -source = "git+https://github.com/bytecodealliance/cranelift/#280fd1e13b5cdad9d9d308b78bb94b0476f2d9f0" +source = "git+https://github.com/bytecodealliance/cranelift/#f1aa07265b3b25c1859f7184e92fd600316b4b25" [[package]] name = "cranelift-entity" version = "0.58.0" -source = "git+https://github.com/bytecodealliance/cranelift/#280fd1e13b5cdad9d9d308b78bb94b0476f2d9f0" +source = "git+https://github.com/bytecodealliance/cranelift/#f1aa07265b3b25c1859f7184e92fd600316b4b25" [[package]] name = "cranelift-frontend" version = "0.58.0" -source = "git+https://github.com/bytecodealliance/cranelift/#280fd1e13b5cdad9d9d308b78bb94b0476f2d9f0" +source = "git+https://github.com/bytecodealliance/cranelift/#f1aa07265b3b25c1859f7184e92fd600316b4b25" dependencies = [ "cranelift-codegen 0.58.0 (git+https://github.com/bytecodealliance/cranelift/)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -88,7 +88,7 @@ dependencies = [ [[package]] name = "cranelift-module" version = "0.58.0" -source = "git+https://github.com/bytecodealliance/cranelift/#280fd1e13b5cdad9d9d308b78bb94b0476f2d9f0" +source = "git+https://github.com/bytecodealliance/cranelift/#f1aa07265b3b25c1859f7184e92fd600316b4b25" dependencies = [ "cranelift-codegen 0.58.0 (git+https://github.com/bytecodealliance/cranelift/)", "cranelift-entity 0.58.0 (git+https://github.com/bytecodealliance/cranelift/)", @@ -99,7 +99,7 @@ dependencies = [ [[package]] name = "cranelift-native" version = "0.58.0" -source = "git+https://github.com/bytecodealliance/cranelift/#280fd1e13b5cdad9d9d308b78bb94b0476f2d9f0" +source = "git+https://github.com/bytecodealliance/cranelift/#f1aa07265b3b25c1859f7184e92fd600316b4b25" dependencies = [ "cranelift-codegen 0.58.0 (git+https://github.com/bytecodealliance/cranelift/)", "raw-cpuid 7.0.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -109,7 +109,7 @@ dependencies = [ [[package]] name = "cranelift-object" version = "0.58.0" -source = "git+https://github.com/bytecodealliance/cranelift/#280fd1e13b5cdad9d9d308b78bb94b0476f2d9f0" +source = "git+https://github.com/bytecodealliance/cranelift/#f1aa07265b3b25c1859f7184e92fd600316b4b25" dependencies = [ "cranelift-codegen 0.58.0 (git+https://github.com/bytecodealliance/cranelift/)", "cranelift-module 0.58.0 (git+https://github.com/bytecodealliance/cranelift/)", @@ -120,7 +120,7 @@ dependencies = [ [[package]] name = "cranelift-simplejit" version = "0.58.0" -source = "git+https://github.com/bytecodealliance/cranelift/#280fd1e13b5cdad9d9d308b78bb94b0476f2d9f0" +source = "git+https://github.com/bytecodealliance/cranelift/#f1aa07265b3b25c1859f7184e92fd600316b4b25" dependencies = [ "cranelift-codegen 0.58.0 (git+https://github.com/bytecodealliance/cranelift/)", "cranelift-module 0.58.0 (git+https://github.com/bytecodealliance/cranelift/)", diff --git a/src/base.rs b/src/base.rs index 644a66bb31a..1eab45bf3c6 100644 --- a/src/base.rs +++ b/src/base.rs @@ -360,10 +360,14 @@ fn trans_stmt<'tcx>( } } UnOp::Neg => match layout.ty.kind { - ty::Int(_) => { + ty::Int(IntTy::I128) => { + // FIXME remove this case once ineg.i128 works let zero = CValue::const_val(fx, layout, 0); crate::num::trans_int_binop(fx, BinOp::Sub, zero, operand) } + ty::Int(_) => { + CValue::by_val(fx.bcx.ins().ineg(val), layout) + } ty::Float(_) => { CValue::by_val(fx.bcx.ins().fneg(val), layout) } diff --git a/src/unsize.rs b/src/unsize.rs index ab2b2f201a2..9d2e73714fc 100644 --- a/src/unsize.rs +++ b/src/unsize.rs @@ -225,8 +225,7 @@ pub fn size_and_align_of_dst<'tcx>( // `(size + (align-1)) & -align` let addend = fx.bcx.ins().iadd_imm(align, -1); let add = fx.bcx.ins().iadd(size, addend); - let zero = fx.bcx.ins().iconst(fx.pointer_type, 0); - let neg = fx.bcx.ins().isub(zero, align); + let neg = fx.bcx.ins().ineg(align); let size = fx.bcx.ins().band(add, neg); (size, align) diff --git a/src/value_and_place.rs b/src/value_and_place.rs index cc194e1c91e..c075fe45544 100644 --- a/src/value_and_place.rs +++ b/src/value_and_place.rs @@ -509,13 +509,14 @@ impl<'tcx> CPlace<'tcx> { let size = dst_layout.size.bytes(); let src_align = src_layout.align.abi.bytes() as u8; let dst_align = dst_layout.align.abi.bytes() as u8; - fx.bcx.emit_small_memcpy( + fx.bcx.emit_small_memory_copy( fx.module.target_config(), to_addr, from_addr, size, dst_align, src_align, + true, ); } CValueInner::ByRef(_, Some(_)) => todo!(),