MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / not

Method not

cranelift/interpreter/src/value.rs:775–798  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

773 }
774
775 fn not(self) -> ValueResult<Self> {
776 Ok(match self {
777 DataValue::I8(a) => DataValue::I8(!a),
778 DataValue::I16(a) => DataValue::I16(!a),
779 DataValue::I32(a) => DataValue::I32(!a),
780 DataValue::I64(a) => DataValue::I64(!a),
781 DataValue::I128(a) => DataValue::I128(!a),
782 DataValue::F32(a) => DataValue::F32(!a),
783 DataValue::F64(a) => DataValue::F64(!a),
784 DataValue::V64(mut a) => {
785 for byte in a.iter_mut() {
786 *byte = !*byte;
787 }
788 DataValue::V64(a)
789 }
790 DataValue::V128(mut a) => {
791 for byte in a.iter_mut() {
792 *byte = !*byte;
793 }
794 DataValue::V128(a)
795 }
796 _ => unimplemented!(),
797 })
798 }
799
800 fn count_ones(self) -> ValueResult<Self> {
801 unary_match!(count_ones(&self); [I8, I16, I32, I64, I128]; [i8, i16, i32, i64, i128])

Calls 3

OkFunction · 0.85
V128Class · 0.50
iter_mutMethod · 0.45

Tested by 1