Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
operation: function(data) {
const ex = this.get('extend');
return { out: data.in.concat(Vector3vl.make(ex.output - ex.input, this.extbit(data.in))) };
},
gateParams: Gate.prototype.gateParams.concat(['extend'])
operation: function(data) {
const bits = this.get('bits');
const sgn = this.get('signed');
const fillx = this.get('fillx');
if (!data.in2.isFullyDefined)
return { out: Vector3vl.xes(bits.out) };
const am = help.sig2bigint(data.in2, sgn.in2) * this.shiftdir;
const signbit = data.in1.get(data.in1.bits-1);
const ext = Vector3vl.make(Math.max(0, bits.out - bits.in1),
fillx ? 0 : sgn.in1 ? signbit : -1);
const my_in = data.in1.concat(ext);
const out = am < 0
? Vector3vl.make(-am, fillx ? 0 : -1).concat(my_in)
: my_in.slice(am).concat(Vector3vl.make(am, fillx ? 0 : sgn.out ? my_in.get(my_in.bits-1) : -1));
return { out: out.slice(0, bits.out) };
},
gateParams: Gate.prototype.gateParams.concat(['bits', 'signed', 'fillx'])
operation: function(data) {
const bits = this.get('bits');
const sgn = this.get('signed');
const fillx = this.get('fillx');
if (!data.in2.isFullyDefined)
return { out: Vector3vl.xes(bits.out) };
const am = help.sig2bigint(data.in2, sgn.in2) * this.shiftdir;
const signbit = data.in1.get(data.in1.bits-1);
const ext = Vector3vl.make(Math.max(0, bits.out - bits.in1),
fillx ? 0 : sgn.in1 ? signbit : -1);
const my_in = data.in1.concat(ext);
const out = am < 0
? Vector3vl.make(-am, fillx ? 0 : -1).concat(my_in)
: my_in.slice(am).concat(Vector3vl.make(am, fillx ? 0 : sgn.out ? my_in.get(my_in.bits-1) : -1));
return { out: out.slice(0, bits.out) };
},
gateParams: Gate.prototype.gateParams.concat(['bits', 'signed', 'fillx'])
operation: function(data) {
const bits = this.get('bits');
const sgn = this.get('signed');
const fillx = this.get('fillx');
if (!data.in2.isFullyDefined)
return { out: Vector3vl.xes(bits.out) };
const am = help.sig2bigint(data.in2, sgn.in2) * this.shiftdir;
const signbit = data.in1.get(data.in1.bits-1);
const ext = Vector3vl.make(Math.max(0, bits.out - bits.in1),
fillx ? 0 : sgn.in1 ? signbit : -1);
const my_in = data.in1.concat(ext);
const out = am < 0
? Vector3vl.make(-am, fillx ? 0 : -1).concat(my_in)
: my_in.slice(am).concat(Vector3vl.make(am, fillx ? 0 : sgn.out ? my_in.get(my_in.bits-1) : -1));
return { out: out.slice(0, bits.out) };
},
gateParams: Gate.prototype.gateParams.concat(['bits', 'signed', 'fillx'])