(module (func $add (param $x f32) (param $y f32) (result f32) (f32.add (get_local $x) (get_local $y))) (export "add" (func $add)))
module = Wasm.instantiateModule(new Uint8Array(buffer), {});
module.exports.add(1,2) // => 3
double add(double a, double b) { return a + b; }
; ModuleID = 'sample.c'source_filename = "sample.c"target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"target triple = "wasm32"
; Function Attrs: nounwinddefine hidden double @add(double %a, double %b) #0 {entry: %a.addr = alloca double, align 8 %b.addr = alloca double, align 8 store double %a, double* %a.addr, align 8 store double %b, double* %b.addr, align 8 %0 = load double, double* %a.addr, align 8 %1 = load double, double* %b.addr, align 8 %add = fadd double %0, %1 ret double %add}
attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
!llvm.ident = !{!0}
!0 = !{!"clang version 4.0.0 (http://llvm.org/git/clang.git b1b3141a30d56f4feb3cc68f57d1ebaf6fbad246) (http://llvm.org/git/llvm.git cf04e5f0f84bd44c375bf866d777708df39935df)"}
.text .file "sample.ll" .hidden add .globl add .type add,@functionadd: # @add .param f64, f64 .result f64 .local i32# BB#0: # %entry i32.const $push2=, 0 i32.load $push3=, __stack_pointer($pop2) i32.const $push4=, 16 i32.sub $push6=, $pop3, $pop4 tee_local $push5=, $2=, $pop6 f64.store $drop=, 8($pop5), $0 f64.store $drop=, 0($2), $1 f64.load $push0=, 8($2) f64.add $push1=, $pop0, $1 # fallthrough-return: $pop1 .endfunc.Lfunc_end0: .size add, .Lfunc_end0-add
.ident "clang version 4.0.0 (http://llvm.org/git/clang.git b1b3141a30d56f4feb3cc68f57d1ebaf6fbad246) (http://llvm.org/git/llvm.git cf04e5f0f84bd44c375bf866d777708df39935df)"
(module (memory $0 1) (export "memory" (memory $0)) (export "add" (func $add)) (table 0 anyfunc) (func $add (param $0 f64) (param $1 f64) (result f64) (local $2 i32) (f64.store offset=8 (tee_local $2 (i32.sub (i32.load offset=4 (i32.const 0) ) (i32.const 16) ) ) (get_local $0) ) (f64.store (get_local $2) (get_local $1) ) (f64.add (f64.load offset=8 (get_local $2) ) (get_local $1) ) ))
--
--
v8-users mailing list
v8-u...@googlegroups.com
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to a topic in the Google Groups "v8-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/v8-users/u03PhW4wPeg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to v8-users+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.