(&self, ty: Word, val: f64)
| 91 | } |
| 92 | |
| 93 | pub fn constant_float(&self, ty: Word, val: f64) -> SpirvValue { |
| 94 | match self.lookup_type(ty) { |
| 95 | SpirvType::Float(32) => self.def_constant(ty, SpirvConst::F32((val as f32).to_bits())), |
| 96 | SpirvType::Float(64) => self.def_constant(ty, SpirvConst::F64(val.to_bits())), |
| 97 | other => self.tcx.sess.fatal(format!( |
| 98 | "constant_float invalid on type {}", |
| 99 | other.debug(ty, self) |
| 100 | )), |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | pub fn constant_bool(&self, span: Span, val: bool) -> SpirvValue { |
| 105 | let ty = SpirvType::Bool.def(span, self); |
no test coverage detected