Perform NaN canonicalizing rewrites on the function.
(&mut self, isa: &dyn TargetIsa)
| 281 | |
| 282 | /// Perform NaN canonicalizing rewrites on the function. |
| 283 | pub fn canonicalize_nans(&mut self, isa: &dyn TargetIsa) -> CodegenResult<()> { |
| 284 | // Currently only RiscV64 is the only arch that may not have vector support. |
| 285 | let has_vector_support = match isa.triple().architecture { |
| 286 | Architecture::Riscv64(_) => match isa.isa_flags().iter().find(|f| f.name == "has_v") { |
| 287 | Some(value) => value.as_bool().unwrap_or(false), |
| 288 | None => false, |
| 289 | }, |
| 290 | _ => true, |
| 291 | }; |
| 292 | do_nan_canonicalization(&mut self.func, has_vector_support); |
| 293 | self.verify_if(isa) |
| 294 | } |
| 295 | |
| 296 | /// Run the legalizer for `isa` on the function. |
| 297 | pub fn legalize(&mut self, isa: &dyn TargetIsa) -> CodegenResult<()> { |