(
&self,
inst: Inst,
flags: MemFlags,
arg: Value,
errors: &mut VerifierErrors,
)
| 1126 | } |
| 1127 | |
| 1128 | fn verify_bitcast( |
| 1129 | &self, |
| 1130 | inst: Inst, |
| 1131 | flags: MemFlags, |
| 1132 | arg: Value, |
| 1133 | errors: &mut VerifierErrors, |
| 1134 | ) -> VerifierStepResult { |
| 1135 | let typ = self.func.dfg.ctrl_typevar(inst); |
| 1136 | let value_type = self.func.dfg.value_type(arg); |
| 1137 | let flags_data = self.func.dfg.mem_flags[flags]; |
| 1138 | |
| 1139 | if typ.bits() != value_type.bits() { |
| 1140 | errors.fatal(( |
| 1141 | inst, |
| 1142 | format!( |
| 1143 | "The bitcast argument {} has a type of {} bits, which doesn't match an expected type of {} bits", |
| 1144 | arg, |
| 1145 | value_type.bits(), |
| 1146 | typ.bits() |
| 1147 | ), |
| 1148 | )) |
| 1149 | } else if flags_data != MemFlagsData::new() |
| 1150 | && flags_data != MemFlagsData::new().with_endianness(ir::Endianness::Little) |
| 1151 | && flags_data != MemFlagsData::new().with_endianness(ir::Endianness::Big) |
| 1152 | { |
| 1153 | errors.fatal(( |
| 1154 | inst, |
| 1155 | "The bitcast instruction only accepts the `big` or `little` memory flags", |
| 1156 | )) |
| 1157 | } else if flags_data == MemFlagsData::new() && typ.lane_count() != value_type.lane_count() { |
| 1158 | errors.fatal(( |
| 1159 | inst, |
| 1160 | "Byte order specifier required for bitcast instruction changing lane count", |
| 1161 | )) |
| 1162 | } else { |
| 1163 | Ok(()) |
| 1164 | } |
| 1165 | } |
| 1166 | |
| 1167 | fn verify_constant_size( |
| 1168 | &self, |
no test coverage detected