logical.wast 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. ;;-------------------------------------------------------------------------------------------------------
  2. ;; Copyright (C) Microsoft Corporation and contributors. All rights reserved.
  3. ;; Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. ;;-------------------------------------------------------------------------------------------------------
  5. (module
  6. (import "dummy" "memory" (memory 1))
  7. (func (export "m128_and") (local $v1 v128) (local $v2 v128)
  8. (set_local $v1 (v128.load offset=0 align=4 (i32.const 0)))
  9. (set_local $v2 (v128.load offset=0 align=4 (i32.const 16)))
  10. (v128.store offset=0 align=4 (i32.const 0) (v128.and (get_local $v1) (get_local $v2)))
  11. )
  12. (func (export "m128_or") (local $v1 v128) (local $v2 v128)
  13. (set_local $v1 (v128.load offset=0 align=4 (i32.const 0)))
  14. (set_local $v2 (v128.load offset=0 align=4 (i32.const 16)))
  15. (v128.store offset=0 align=4 (i32.const 0) (v128.or (get_local $v1) (get_local $v2)))
  16. )
  17. (func (export "m128_xor") (local $v1 v128) (local $v2 v128)
  18. (set_local $v1 (v128.load offset=0 align=4 (i32.const 0)))
  19. (set_local $v2 (v128.load offset=0 align=4 (i32.const 16)))
  20. (v128.store offset=0 align=4 (i32.const 0) (v128.xor (get_local $v1) (get_local $v2)))
  21. )
  22. (func (export "m128_not") (local $v1 v128)
  23. (set_local $v1 (v128.load offset=0 align=4 (i32.const 0)))
  24. (v128.store offset=0 align=4 (i32.const 0) (v128.not (get_local $v1)))
  25. )
  26. (func (export "i32x4_anytrue") (result i32)
  27. (i32x4.any_true (v128.load offset=0 align=4 (i32.const 0)))
  28. )
  29. (func (export "i32x4_alltrue") (result i32)
  30. (i32x4.all_true (v128.load offset=0 align=4 (i32.const 0)))
  31. )
  32. (func (export "i16x8_anytrue") (result i32)
  33. (i16x8.any_true (v128.load offset=0 align=4 (i32.const 0)))
  34. )
  35. (func (export "i16x8_alltrue") (result i32)
  36. (i16x8.all_true (v128.load offset=0 align=4 (i32.const 0)))
  37. )
  38. (func (export "i8x16_anytrue") (result i32)
  39. (i8x16.any_true (v128.load offset=0 align=4 (i32.const 0)))
  40. )
  41. (func (export "i8x16_alltrue") (result i32)
  42. (i8x16.all_true (v128.load offset=0 align=4 (i32.const 0)))
  43. )
  44. )