MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / canonicalize_nans

Method canonicalize_nans

cranelift/codegen/src/context.rs:283–294  ·  view source on GitHub ↗

Perform NaN canonicalizing rewrites on the function.

(&mut self, isa: &dyn TargetIsa)

Source from the content-addressed store, hash-verified

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<()> {

Callers 2

run_func_passesMethod · 0.45
optimizeMethod · 0.45

Calls 7

do_nan_canonicalizationFunction · 0.85
verify_ifMethod · 0.80
tripleMethod · 0.45
findMethod · 0.45
iterMethod · 0.45
isa_flagsMethod · 0.45
as_boolMethod · 0.45

Tested by

no test coverage detected