pub fn br_if_true(
        &mut self,
        target: impl Into<BrTarget<Label>>,
        pass_args: impl FnOnce(&mut Self),
    ) {
        let mut val = self.pop();
        let label = target
            .into()
            .label()
            .map(|c| *c)
            .unwrap_or_else(|| self.ret_label());

        let cond = match val {
            ValueLocation::Cond(cc) => cc,
            _ => {
                let predicate = self.into_reg(I32, &mut val).unwrap();
                dynasm!(self.asm
                    ; test Rd(predicate.rq().unwrap()), Rd(predicate.rq().unwrap())
                );

                CondCode::ZF1
            }
        };

        self.free_value(val);

        pass_args(self);

        self.br_on_cond_code(label, cond);
    }
/// Pops i32 predicate and branches to the specified label
/// if the predicate is not equal to zero.
Pops i32 predicate and branches to the specified label
if the predicate is not equal to zero.
Pops i32 predicate and branches to the specified label if the predicate is not equal to zero .
pub fn br_if_true(
        &mut self,
        target: impl Into<BrTarget<Label>>,
        pass_args: impl FnOnce(&mut Self),
    ) {
        let mut val = self.pop();
        let label = target
            .into()
            .label()
            .map(|c| *c)
            .unwrap_or_else(|| self.ret_label());
        let cond = match val {
            ValueLocation::Cond(cc) => cc,
            _ => {
                let predicate = self.into_reg(I32, &mut val).unwrap();
                dynasm!(self.asm
                    ; test Rd(predicate.rq().unwrap()), Rd(predicate.rq().unwrap())
                );
                CondCode::ZF1
            }
        };
        self.free_value(val);
        pass_args(self);
        self.br_on_cond_code(label, cond);
    }
pub fn br_if_true ( & mut self , target : impl Into < BrTarget < Label > > , pass_args : impl FnOnce ( & mut Self ) , ) { let mut val = self . pop ( ) ; let label = target . into ( ) . label ( ) . map ( | c | * c ) . unwrap_or_else ( | | self . ret_label ( ) ) ; let cond = match val { ValueLocation :: Cond ( cc ) => cc , _ => { let predicate = self . into_reg ( I32 , & mut val ) . unwrap ( ) ; dynasm ! ( self asm test Rd ( predicate rq ( ) unwrap ( ) ) Rd ( predicate rq ( ) unwrap ( ) ) ) ; CondCode :: ZF1 } } ; self . free_value ( val ) ; pass_args ( self ) ; self . br_on_cond_code ( label , cond ) ; }
Pops i32 predicate and branches to the specified label
if the predicate is not equal to zero.
Pops i32 predicate and branches to the specified label if the predicate is not equal to zero .
&mut self
target
impl Into<BrTarget<Label>>
pass_args
impl FnOnce(&mut Self)