loads.wast 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 "v128_load4") (param $x i32) (result i32)
  8. (i32x4.extract_lane 0 (v128.load offset=0 (get_local $x)))
  9. )
  10. (func (export "v128_load4_offset") (param $x i32) (result i32)
  11. (i32x4.extract_lane 0 (v128.load offset=16 (get_local $x)))
  12. )
  13. (func (export "v128_load_test") (param $x i32) (local v128)
  14. (set_local 1 (v128.load offset=0 (get_local $x)))
  15. (i32.store offset=0 (get_local $x) (i32.popcnt (i32x4.extract_lane 0 (get_local 1))))
  16. (set_local 1 (v128.load offset=0 (get_local $x)))
  17. (i32.store offset=4 (get_local $x) (i32.popcnt (i32x4.extract_lane 1 (get_local 1))))
  18. (set_local 1 (v128.load offset=0 (get_local $x)))
  19. (i32.store offset=8 (get_local $x) (i32.popcnt (i32x4.extract_lane 2 (get_local 1))))
  20. (set_local 1 (v128.load offset=0 (get_local $x)))
  21. (i32.store offset=12 (get_local $x) (i32.popcnt (i32x4.extract_lane 3 (get_local 1))))
  22. ;;
  23. (set_local 1 (v128.load offset=20 (get_local $x)))
  24. (i32.store offset=20 (get_local $x) (i32.popcnt (i32x4.extract_lane 0 (get_local 1))))
  25. (set_local 1 (v128.load offset=20 (get_local $x)))
  26. (i32.store offset=24 (get_local $x) (i32.popcnt (i32x4.extract_lane 1 (get_local 1))))
  27. (set_local 1 (v128.load offset=20 (get_local $x)))
  28. (i32.store offset=28 (get_local $x) (i32.popcnt (i32x4.extract_lane 2 (get_local 1))))
  29. (set_local 1 (v128.load offset=20 (get_local $x)))
  30. (i32.store offset=32 (get_local $x) (i32.popcnt (i32x4.extract_lane 3 (get_local 1))))
  31. ;;
  32. (set_local 1 (v128.load offset=44 (get_local $x)))
  33. (i32.store offset=44 (get_local $x) (i32.popcnt (i32x4.extract_lane 0 (get_local 1))))
  34. (set_local 1 (v128.load offset=44 (get_local $x)))
  35. (i32.store offset=48 (get_local $x) (i32.popcnt (i32x4.extract_lane 1 (get_local 1))))
  36. (set_local 1 (v128.load offset=44 (get_local $x)))
  37. (i32.store offset=52 (get_local $x) (i32.popcnt (i32x4.extract_lane 2 (get_local 1))))
  38. (set_local 1 (v128.load offset=44 (get_local $x)))
  39. (i32.store offset=56 (get_local $x) (i32.popcnt (i32x4.extract_lane 3 (get_local 1))))
  40. ;;
  41. (set_local 1 (v128.load offset=68 (get_local $x)))
  42. (i32.store offset=68 (get_local $x) (i32.popcnt (i32x4.extract_lane 0 (get_local 1))))
  43. (set_local 1 (v128.load offset=68 (get_local $x)))
  44. (i32.store offset=72 (get_local $x) (i32.popcnt (i32x4.extract_lane 1 (get_local 1))))
  45. (set_local 1 (v128.load offset=68 (get_local $x)))
  46. (i32.store offset=76 (get_local $x) (i32.popcnt (i32x4.extract_lane 2 (get_local 1))))
  47. (set_local 1 (v128.load offset=68 (get_local $x)))
  48. (i32.store offset=80 (get_local $x) (i32.popcnt (i32x4.extract_lane 3 (get_local 1))))
  49. )
  50. )