A lightweight WebAssembly runtime that is fast, secure, and standards-compliant
;;! target = "x86_64"
;;! test = "winch"
(module
(func (result i32)
(local f64)
(local.get 0)
(i32.trunc_f64_s)
)
)
;; wasm[0]::function[0]:
;; pushq %rbp
;; movq %rsp, %rbp
;; movq 8(%rdi), %r11
;; movq 0x18(%r11), %r11
;; addq $0x20, %r11
;; cmpq %rsp, %r11
;; ja 0x89
;; 1c: movq %rdi, %r14
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; movq $0, 8(%rsp)
;; movsd 8(%rsp), %xmm0
;; cvttsd2si %xmm0, %eax
;; cmpl $1, %eax
;; jno 0x80
;; 4c: ucomisd %xmm0, %xmm0
;; jp 0x8b
;; 56: movabsq $13970166044105375744, %r11
;; movq %r11, %xmm15
;; ucomisd %xmm15, %xmm0
;; jbe 0x8d
;; 70: xorpd %xmm15, %xmm15
;; ucomisd %xmm0, %xmm15
;; jb 0x8f
;; 80: addq $0x20, %rsp
;; popq %rbp
;; retq
;; 89: ud2
;; 8b: ud2
;; 8d: ud2
;; 8f: ud2