MCPcopy Create free account
hub / github.com/Rust-GPU/rust-gpu / and

Method and

crates/rustc_codegen_spirv/src/builder/builder_methods.rs:939–957  ·  view source on GitHub ↗
(&mut self, lhs: Self::Value, rhs: Self::Value)

Source from the content-addressed store, hash-verified

937 simple_uni_op! {fneg, f_negate}
938
939 fn and(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value {
940 assert_ty_eq!(self, lhs.ty, rhs.ty);
941 let ty = lhs.ty;
942 match self.lookup_type(ty) {
943 SpirvType::Integer(_, _) => {
944 self.emit()
945 .bitwise_and(ty, None, lhs.def(self), rhs.def(self))
946 }
947 SpirvType::Bool => self
948 .emit()
949 .logical_and(ty, None, lhs.def(self), rhs.def(self)),
950 o => self.fatal(&format!(
951 "and() not implemented for type {}",
952 o.debug(ty, self)
953 )),
954 }
955 .unwrap()
956 .with_type(ty)
957 }
958 fn or(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value {
959 assert_ty_eq!(self, lhs.ty, rhs.ty);
960 let ty = lhs.ty;

Callers 3

rotateMethod · 0.45
copysignMethod · 0.45

Calls 5

with_typeMethod · 0.80
lookup_typeMethod · 0.80
fatalMethod · 0.80
emitMethod · 0.45
defMethod · 0.45

Tested by

no test coverage detected