pub fn i32_eqz(&mut self) {
        let mut val = self.pop();

        if let ValueLocation::Immediate(Value::I32(i)) = val {
            self.push(ValueLocation::Immediate(
                (if i == 0 { 1i32 } else { 0 }).into(),
            ));
            return;
        }

        if let ValueLocation::Cond(loc) = val {
            self.push(ValueLocation::Cond(!loc));
            return;
        }

        let reg = self.into_reg(I32, &mut val).unwrap();
        let out = self.take_reg(I32).unwrap();

        dynasm!(self.asm
            ; xor Rd(out.rq().unwrap()), Rd(out.rq().unwrap())
            ; test Rd(reg.rq().unwrap()), Rd(reg.rq().unwrap())
            ; setz Rb(out.rq().unwrap())
        );

        self.free_value(val);

        self.push(ValueLocation::Reg(out));
    }
// TODO: Should we do this logic in `eq` and just have this delegate to `eq`?
//       That would mean that `eqz` and `eq` with a const 0 argument don't
//       result in different code. It would also allow us to generate better
//       code for `neq` and `gt_u` with const 0 operand
Should we do this logic in `eq` and just have this delegate to `eq`.
That would mean that `eqz` and `eq` with a const 0 argument don't
result in different code. It would also allow us to generate better
code for `neq` and `gt_u` with const 0 operand
Should we do this logic in ` eq ` and just have this delegate to ` eq ` . That would mean that ` eqz ` and ` eq ` with a const 0 argument don ' t result in different code . It would also allow us to generate better code for ` neq ` and ` gt_u ` with const 0 operand
pub fn i32_eqz(&mut self) {
        let mut val = self.pop();
        if let ValueLocation::Immediate(Value::I32(i)) = val {
            self.push(ValueLocation::Immediate(
                (if i == 0 { 1i32 } else { 0 }).into(),
            ));
            return;
        }
        if let ValueLocation::Cond(loc) = val {
            self.push(ValueLocation::Cond(!loc));
            return;
        }
        let reg = self.into_reg(I32, &mut val).unwrap();
        let out = self.take_reg(I32).unwrap();
        dynasm!(self.asm
            ; xor Rd(out.rq().unwrap()), Rd(out.rq().unwrap())
            ; test Rd(reg.rq().unwrap()), Rd(reg.rq().unwrap())
            ; setz Rb(out.rq().unwrap())
        );
        self.free_value(val);
        self.push(ValueLocation::Reg(out));
    }
pub fn i32_eqz ( & mut self ) { let mut val = self . pop ( ) ; if let ValueLocation :: Immediate ( Value :: I32 ( i ) ) = val { self . push ( ValueLocation :: Immediate ( ( if i == 0 { 1i32 } else { 0 } ) . into ( ) , ) ) ; return ; } if let ValueLocation :: Cond ( loc ) = val { self . push ( ValueLocation :: Cond ( ! loc ) ) ; return ; } let reg = self . into_reg ( I32 , & mut val ) . unwrap ( ) ; let out = self . take_reg ( I32 ) . unwrap ( ) ; dynasm ! ( self asm xor Rd ( out rq ( ) unwrap ( ) ) Rd ( out rq ( ) unwrap ( ) ) test Rd ( reg rq ( ) unwrap ( ) ) Rd ( reg rq ( ) unwrap ( ) ) setz Rb ( out rq ( ) unwrap ( ) ) ) ; self . free_value ( val ) ; self . push ( ValueLocation :: Reg ( out ) ) ; }
TODO: Should we do this logic in `eq` and just have this delegate to `eq`?
TODO : Should we do this logic in ` eq ` and just have this delegate to ` eq ` ?
&mut self