This commit is contained in:
bjorn3
2019-06-29 17:06:17 +02:00
committed by Dan Gohman
parent 599b48d95f
commit 0d5b87038a
5 changed files with 32 additions and 17 deletions

View File

@@ -4,7 +4,7 @@ use crate::cdsl::xform::{TransformGroupBuilder, TransformGroups};
use crate::shared::immediates::Immediates;
use crate::shared::types::Float::{F32, F64};
use crate::shared::types::Int::{I16, I128, I32, I64, I8};
use crate::shared::types::Int::{I128, I16, I32, I64, I8};
pub(crate) fn define(insts: &InstructionGroup, imm: &Immediates) -> TransformGroups {
let mut narrow = TransformGroupBuilder::new(
@@ -245,8 +245,20 @@ pub(crate) fn define(insts: &InstructionGroup, imm: &Immediates) -> TransformGro
def!(brz.I128(x, ebb, vararg)),
vec![
def!((xl, xh) = isplit(x)),
def!(a = icmp_imm(Literal::enumerator_for(intcc, "eq"), xl, Literal::constant(imm64, 0))),
def!(b = icmp_imm(Literal::enumerator_for(intcc, "eq"), xh, Literal::constant(imm64, 0))),
def!(
a = icmp_imm(
Literal::enumerator_for(intcc, "eq"),
xl,
Literal::constant(imm64, 0)
)
),
def!(
b = icmp_imm(
Literal::enumerator_for(intcc, "eq"),
xh,
Literal::constant(imm64, 0)
)
),
def!(c = band(a, b)),
def!(brz(c, ebb, vararg)),
],