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

Method fcmp

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

Source from the content-addressed store, hash-verified

1870 }
1871
1872 fn fcmp(&mut self, op: RealPredicate, lhs: Self::Value, rhs: Self::Value) -> Self::Value {
1873 use RealPredicate::*;
1874 assert_ty_eq!(self, lhs.ty, rhs.ty);
1875 let b = SpirvType::Bool.def(self.span(), self);
1876 match op {
1877 RealPredicateFalse => return self.cx.constant_bool(self.span(), false),
1878 RealPredicateTrue => return self.cx.constant_bool(self.span(), true),
1879 RealOEQ => self
1880 .emit()
1881 .f_ord_equal(b, None, lhs.def(self), rhs.def(self)),
1882 RealOGT => self
1883 .emit()
1884 .f_ord_greater_than(b, None, lhs.def(self), rhs.def(self)),
1885 RealOGE => self
1886 .emit()
1887 .f_ord_greater_than_equal(b, None, lhs.def(self), rhs.def(self)),
1888 RealOLT => self
1889 .emit()
1890 .f_ord_less_than(b, None, lhs.def(self), rhs.def(self)),
1891 RealOLE => self
1892 .emit()
1893 .f_ord_less_than_equal(b, None, lhs.def(self), rhs.def(self)),
1894 RealONE => self
1895 .emit()
1896 .f_ord_not_equal(b, None, lhs.def(self), rhs.def(self)),
1897 RealORD => self.emit().ordered(b, None, lhs.def(self), rhs.def(self)),
1898 RealUNO => self.emit().unordered(b, None, lhs.def(self), rhs.def(self)),
1899 RealUEQ => self
1900 .emit()
1901 .f_unord_equal(b, None, lhs.def(self), rhs.def(self)),
1902 RealUGT => self
1903 .emit()
1904 .f_unord_greater_than(b, None, lhs.def(self), rhs.def(self)),
1905 RealUGE => {
1906 self.emit()
1907 .f_unord_greater_than_equal(b, None, lhs.def(self), rhs.def(self))
1908 }
1909 RealULT => self
1910 .emit()
1911 .f_unord_less_than(b, None, lhs.def(self), rhs.def(self)),
1912 RealULE => self
1913 .emit()
1914 .f_unord_less_than_equal(b, None, lhs.def(self), rhs.def(self)),
1915 RealUNE => self
1916 .emit()
1917 .f_unord_not_equal(b, None, lhs.def(self), rhs.def(self)),
1918 }
1919 .unwrap()
1920 .with_type(b)
1921 }
1922
1923 fn memcpy(
1924 &mut self,

Callers 1

fptoint_satMethod · 0.80

Calls 5

spanMethod · 0.80
with_typeMethod · 0.80
constant_boolMethod · 0.80
defMethod · 0.45
emitMethod · 0.45

Tested by

no test coverage detected