fn shared_equality_opcode(_vm: &VM, ctx: &mut Context,
                          curr_p: &mut Process,
                          exact: bool,
                          desired_result: Ordering,
                          invert: bool) -> DispatchResult {
  let hp = &curr_p.heap;
  let fail_label = ctx.fetch_term();
  let a = ctx.fetch_and_load(hp);
  let b = ctx.fetch_and_load(hp);

  assert_eq!(false, fail_label.is_nil());

  if invert {
    // Invert defines opposite meaning, desired result becomes undesired
    if compare::cmp_terms(a, b, exact) == desired_result {
      ctx.ip = CodePtr::from_cp(fail_label)
    }
  } else if compare::cmp_terms(a, b, exact) != desired_result {
    // Other than desired_recult will cause jump to 'fail'
    ctx.ip = CodePtr::from_cp(fail_label)
  }

  DispatchResult::Normal
}
/// Shared code for equality checks. Assumes arg0 - fail label, arg1,2 - values
Shared code for equality checks. Assumes arg0 - fail label, arg1,2 - values
Shared code for equality checks . Assumes arg0 - fail label arg1 2 - values
fn shared_equality_opcode(_vm: &VM, ctx: &mut Context,
                          curr_p: &mut Process,
                          exact: bool,
                          desired_result: Ordering,
                          invert: bool) -> DispatchResult {
  let hp = &curr_p.heap;
  let fail_label = ctx.fetch_term();
  let a = ctx.fetch_and_load(hp);
  let b = ctx.fetch_and_load(hp);
  assert_eq!(false, fail_label.is_nil());
  if invert {
    // Invert defines opposite meaning, desired result becomes undesired
    if compare::cmp_terms(a, b, exact) == desired_result {
      ctx.ip = CodePtr::from_cp(fail_label)
    }
  } else if compare::cmp_terms(a, b, exact) != desired_result {
    // Other than desired_recult will cause jump to 'fail'
    ctx.ip = CodePtr::from_cp(fail_label)
  }
  DispatchResult::Normal
}
fn shared_equality_opcode ( _vm : & VM , ctx : & mut Context , curr_p : & mut Process , exact : bool , desired_result : Ordering , invert : bool ) -> DispatchResult { let hp = & curr_p . heap ; let fail_label = ctx . fetch_term ( ) ; let a = ctx . fetch_and_load ( hp ) ; let b = ctx . fetch_and_load ( hp ) ; assert_eq ! ( false fail_label is_nil ( ) ) ; if invert { // Invert defines opposite meaning, desired result becomes undesired if compare :: cmp_terms ( a , b , exact ) == desired_result { ctx . ip = CodePtr :: from_cp ( fail_label ) } } else if compare :: cmp_terms ( a , b , exact ) != desired_result { // Other than desired_recult will cause jump to 'fail' ctx . ip = CodePtr :: from_cp ( fail_label ) } DispatchResult :: Normal }
Shared code for equality checks.
Shared code for equality checks .
_vm
&VM
ctx
&mut Context
curr_p
&mut Process
exact
bool
desired_result
Ordering
invert
bool