Remove a workaround for icmp.i8/i16 not having an encoding
This commit is contained in:
parent
e3bbef764c
commit
16334be18e
2 changed files with 6 additions and 11 deletions
|
@ -1,4 +1,4 @@
|
||||||
#![feature(no_core, lang_items, intrinsics, unboxed_closures)]
|
#![feature(no_core, lang_items, intrinsics, unboxed_closures, type_ascription)]
|
||||||
#![no_core]
|
#![no_core]
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
|
@ -246,7 +246,7 @@ pub struct Box<T: ?Sized>(*mut T);
|
||||||
|
|
||||||
impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Box<U>> for Box<T> {}
|
impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Box<U>> for Box<T> {}
|
||||||
|
|
||||||
static mut MY_TINY_HEAP: [u8; 16] = [0; 16];
|
static mut MY_TINY_HEAP: [u8; 16] = [0xff; 16];
|
||||||
|
|
||||||
#[lang = "exchange_malloc"]
|
#[lang = "exchange_malloc"]
|
||||||
unsafe fn allocate(size: usize, _align: usize) -> *mut u8 {
|
unsafe fn allocate(size: usize, _align: usize) -> *mut u8 {
|
||||||
|
|
13
src/base.rs
13
src/base.rs
|
@ -18,7 +18,9 @@ pub fn trans_mono_item<'a, 'tcx: 'a>(
|
||||||
) {
|
) {
|
||||||
match mono_item {
|
match mono_item {
|
||||||
MonoItem::Fn(inst) => {
|
MonoItem::Fn(inst) => {
|
||||||
let _inst_guard = PrintOnPanic(|| format!("{:?}", inst));
|
let _inst_guard = PrintOnPanic(|| {
|
||||||
|
format!("{:?} {}", inst, tcx.symbol_name(inst).as_str())
|
||||||
|
});
|
||||||
let _mir_guard = PrintOnPanic(|| {
|
let _mir_guard = PrintOnPanic(|| {
|
||||||
match inst.def {
|
match inst.def {
|
||||||
InstanceDef::Item(_)
|
InstanceDef::Item(_)
|
||||||
|
@ -761,14 +763,7 @@ macro_rules! binop_match {
|
||||||
assert_eq!($fx.tcx.types.bool, $ret_ty);
|
assert_eq!($fx.tcx.types.bool, $ret_ty);
|
||||||
let ret_layout = $fx.layout_of($ret_ty);
|
let ret_layout = $fx.layout_of($ret_ty);
|
||||||
|
|
||||||
// TODO HACK no encoding for icmp.i8
|
let b = $fx.bcx.ins().icmp(IntCC::$cc, $lhs, $rhs);
|
||||||
use crate::common::clif_intcast;
|
|
||||||
let (lhs, rhs) = (
|
|
||||||
clif_intcast($fx, $lhs, types::I64, $signed),
|
|
||||||
clif_intcast($fx, $rhs, types::I64, $signed),
|
|
||||||
);
|
|
||||||
let b = $fx.bcx.ins().icmp(IntCC::$cc, lhs, rhs);
|
|
||||||
|
|
||||||
CValue::ByVal($fx.bcx.ins().bint(types::I8, b), ret_layout)
|
CValue::ByVal($fx.bcx.ins().bint(types::I8, b), ret_layout)
|
||||||
}};
|
}};
|
||||||
(@single $fx:expr, $bug_fmt:expr, $var:expr, $signed:expr, $lhs:expr, $rhs:expr, $ret_ty:expr, fcmp($cc:ident)) => {{
|
(@single $fx:expr, $bug_fmt:expr, $var:expr, $signed:expr, $lhs:expr, $rhs:expr, $ret_ty:expr, fcmp($cc:ident)) => {{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue