frac32 i1
frac32 i2
frac32 o
int32 positive - leftshift / neegative - rightshift
int32 positive - leftshift / neegative - rightshift
int32 positive - leftshift / neegative - rightshift
int32.hradio and/or/xor
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)
outlet_o = val << param_shift3;
else if (param_shift3 < 0)
outlet_o = val >> -param_shift3;
else
outlet_o = val;