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  unroll8.js

  Sprache: JAVA
 

// |jit-test| skip-if: wasmCompileMode() != "ion"

// Check that the unroller properly takes account of dependencies
// through memory.  See bug 1972116.

let t = `
(module
  (type $structTy (struct (field (mut f32))))
  (func (export "badness") (param $struct (ref null $structTy)) (result f32)
    (local $f f32)
    (local $i i32)
    (block $break
      (loop $cont
        ;; f = struct->field0
        (local.set $f (struct.get $structTy 0 (local.get $struct)))
        ;; f = f + 360.0
        (local.set $f (f32.add (local.get $f) (f32.const 360.0)))
        ;; struct->field0 = f
        (struct.set $structTy 0 (local.get $struct) (local.get $f))
        ;; loop control
        (local.set $i (i32.add (local.get $i) (i32.const 1)))
        (br_if $cont (i32.lt_u (local.get $i) (i32.const 12345)))
      )
    )
    (struct.get $structTy 0 (local.get $struct))
  )

  (func (export "go") (result f32)
    (struct.new_default $structTy)
    (call 0)
  )
)`;

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

// The correct result is 4444200.  If the loop is unrolled and peeled without
// regard to dependencies through memory, and then GVNd, an observed incorrect
// result is 360, because the struct.gets in the unrolled iterations end up
// being GVNd out and replaced by the value of 0.0 returned by the struct.get
// in the peeled iteration.
assertEq(i.exports.go(), 4444200);

Messung V0.5 in Prozent
C=93 H=96 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.