frac32buffer i1
frac32buffer i2
frac32buffer o
int32.hradio operation
int32 shift1
int32 shift2
int32 shift3
int32_t s1;
int32_t s2;
int32_t val;
s1 = 0;
s2 = 0;
val = 0;
if (param_shift1 > 0)
s1 = inlet_i1 << param_shift1;
else if (param_shift1 < 0)
s1 = inlet_i1 >> -param_shift1;
else
s1 = inlet_i1;
if (param_shift2 > 0)
s2 = inlet_i2 << param_shift2;
else if (param_shift2 < 0)
s2 = inlet_i2 >> -param_shift2;
else
s2 = inlet_i2;
switch (param_operation) {
case 0:
val = s1 & s2;
break;
case 1:
val = s1 | s2;
break;
case 2:
val = s1 ^ s2;
break;
}
if (param_shift3 > 0)
val = val << param_shift3;
else if (param_shift3 < 0)
val = val >> -param_shift3;
else
val = val;
outlet_o = val;