|
|
@ -43,6 +43,8 @@ pub(crate) fn define(shared: &mut SharedDefinitions, x86_instructions: &Instruct |
|
|
|
let iadd = insts.by_name("iadd"); |
|
|
|
let icmp = insts.by_name("icmp"); |
|
|
|
let iconst = insts.by_name("iconst"); |
|
|
|
let imax = insts.by_name("imax"); |
|
|
|
let imin = insts.by_name("imin"); |
|
|
|
let imul = insts.by_name("imul"); |
|
|
|
let ineg = insts.by_name("ineg"); |
|
|
|
let insertlane = insts.by_name("insertlane"); |
|
|
@ -61,6 +63,8 @@ pub(crate) fn define(shared: &mut SharedDefinitions, x86_instructions: &Instruct |
|
|
|
let sshr = insts.by_name("sshr"); |
|
|
|
let trueif = insts.by_name("trueif"); |
|
|
|
let udiv = insts.by_name("udiv"); |
|
|
|
let umax = insts.by_name("umax"); |
|
|
|
let umin = insts.by_name("umin"); |
|
|
|
let umulhi = insts.by_name("umulhi"); |
|
|
|
let ushr_imm = insts.by_name("ushr_imm"); |
|
|
|
let urem = insts.by_name("urem"); |
|
|
@ -71,6 +75,7 @@ pub(crate) fn define(shared: &mut SharedDefinitions, x86_instructions: &Instruct |
|
|
|
|
|
|
|
let x86_bsf = x86_instructions.by_name("x86_bsf"); |
|
|
|
let x86_bsr = x86_instructions.by_name("x86_bsr"); |
|
|
|
let x86_pmaxs = x86_instructions.by_name("x86_pmaxs"); |
|
|
|
let x86_pmaxu = x86_instructions.by_name("x86_pmaxu"); |
|
|
|
let x86_pmins = x86_instructions.by_name("x86_pmins"); |
|
|
|
let x86_pminu = x86_instructions.by_name("x86_pminu"); |
|
|
@ -554,6 +559,18 @@ pub(crate) fn define(shared: &mut SharedDefinitions, x86_instructions: &Instruct |
|
|
|
narrow.legalize(def!(c = icmp_(ule, a, b)), vec![def!(c = icmp(uge, b, a))]); |
|
|
|
} |
|
|
|
|
|
|
|
// SIMD integer min/max
|
|
|
|
for ty in &[I8, I16, I32] { |
|
|
|
let imin = imin.bind(vector(*ty, sse_vector_size)); |
|
|
|
narrow.legalize(def!(c = imin(a, b)), vec![def!(c = x86_pmins(a, b))]); |
|
|
|
let umin = umin.bind(vector(*ty, sse_vector_size)); |
|
|
|
narrow.legalize(def!(c = umin(a, b)), vec![def!(c = x86_pminu(a, b))]); |
|
|
|
let imax = imax.bind(vector(*ty, sse_vector_size)); |
|
|
|
narrow.legalize(def!(c = imax(a, b)), vec![def!(c = x86_pmaxs(a, b))]); |
|
|
|
let umax = umax.bind(vector(*ty, sse_vector_size)); |
|
|
|
narrow.legalize(def!(c = umax(a, b)), vec![def!(c = x86_pmaxu(a, b))]); |
|
|
|
} |
|
|
|
|
|
|
|
// SIMD fcmp greater-/less-than
|
|
|
|
let gt = Literal::enumerator_for(&imm.floatcc, "gt"); |
|
|
|
let lt = Literal::enumerator_for(&imm.floatcc, "lt"); |
|
|
|