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

Method or

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

Source from the content-addressed store, hash-verified

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;
961 match self.lookup_type(ty) {
962 SpirvType::Integer(_, _) => {
963 self.emit()
964 .bitwise_or(ty, None, lhs.def(self), rhs.def(self))
965 }
966 SpirvType::Bool => self
967 .emit()
968 .logical_or(ty, None, lhs.def(self), rhs.def(self)),
969 o => self.fatal(&format!(
970 "or() not implemented for type {}",
971 o.debug(ty, self)
972 )),
973 }
974 .unwrap()
975 .with_type(ty)
976 }
977 fn xor(&mut self, lhs: Self::Value, rhs: Self::Value) -> Self::Value {
978 assert_ty_eq!(self, lhs.ty, rhs.ty);
979 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