Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/js/src/jit-test/tests/wasm/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 1 kB image not shown  

Quelle  unroll3.js

  Sprache: JAVA
 

// |jit-test| test-also=--setpref=wasm_unroll_loops=true

// Loop unrolling test: 1 exiting value, 1 exit target => can be unrolled.
// The value defined in the loop, which is used after,
// is also phi'd with a value defined before the loop.

let t = `
(module
  (func (export "f1") (param $enterloopP i32) (param $limit i32) (result i32)
    (local $merge i32)
    (local $x i32)
    (local.set $merge (i32.const 5000))
    (local.set $x (i32.const 1))
    (if (i32.ne (local.get $enterloopP) (i32.const 0))
      (then
        (loop $cont
          ;; x = x + 1
          (local.set $x (i32.add (local.get $x) (i32.const 1)))
          ;; merge = x
          (local.set $merge (i32.add (local.get $x) (i32.const 1111)))
          ;; continue if x < limit
          (br_if $cont (i32.lt_u (local.get $x) (local.get $limit)))
        )
      )
    )
    (i32.mul (local.get $merge) (i32.const 17))
  )
)`;

let i = new WebAssembly.Instance(new WebAssembly.Module(wasmTextToBinary(t)));

assertEq(i.exports.f1(0100), 85000); // loop not entered
assertEq(i.exports.f1(1100), 20587// loop entered

Messung V0.5 in Prozent
C=92 H=97 G=94

¤ Dauer der Verarbeitung: 0.2 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.