aot_emit_memory.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. * Copyright (C) 2019 Intel Corporation. All rights reserved.
  3. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. */
  5. #ifndef _AOT_EMIT_MEMORY_H_
  6. #define _AOT_EMIT_MEMORY_H_
  7. #include "aot_compiler.h"
  8. #if WASM_ENABLE_SHARED_MEMORY != 0
  9. #include "wasm_shared_memory.h"
  10. #endif
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. bool
  15. aot_compile_op_i32_load(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  16. uint32 align, uint32 offset, uint32 bytes,
  17. bool sign, bool atomic);
  18. bool
  19. aot_compile_op_i64_load(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  20. uint32 align, uint32 offset, uint32 bytes,
  21. bool sign, bool atomic);
  22. bool
  23. aot_compile_op_f32_load(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  24. uint32 align, uint32 offset);
  25. bool
  26. aot_compile_op_f64_load(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  27. uint32 align, uint32 offset);
  28. bool
  29. aot_compile_op_i32_store(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  30. uint32 align, uint32 offset, uint32 bytes, bool atomic);
  31. bool
  32. aot_compile_op_i64_store(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  33. uint32 align, uint32 offset, uint32 bytes, bool atomic);
  34. bool
  35. aot_compile_op_f32_store(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  36. uint32 align, uint32 offset);
  37. bool
  38. aot_compile_op_f64_store(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  39. uint32 align, uint32 offset);
  40. LLVMValueRef
  41. aot_check_memory_overflow(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  42. uint32 offset, uint32 bytes);
  43. bool
  44. aot_compile_op_memory_size(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx);
  45. bool
  46. aot_compile_op_memory_grow(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx);
  47. #if WASM_ENABLE_BULK_MEMORY != 0
  48. bool
  49. aot_compile_op_memory_init(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  50. uint32 seg_index);
  51. bool
  52. aot_compile_op_data_drop(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  53. uint32 seg_index);
  54. bool
  55. aot_compile_op_memory_copy(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx);
  56. bool
  57. aot_compile_op_memory_fill(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx);
  58. #endif
  59. #if WASM_ENABLE_SHARED_MEMORY != 0
  60. bool
  61. aot_compile_op_atomic_rmw(AOTCompContext *comp_ctx,
  62. AOTFuncContext *func_ctx,
  63. uint8 atomic_op, uint8 op_type,
  64. uint32 align, uint32 offset,
  65. uint32 bytes);
  66. bool
  67. aot_compile_op_atomic_cmpxchg(AOTCompContext *comp_ctx,
  68. AOTFuncContext *func_ctx,
  69. uint8 op_type, uint32 align,
  70. uint32 offset, uint32 bytes);
  71. bool
  72. aot_compile_op_atomic_wait(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  73. uint8 op_type, uint32 align,
  74. uint32 offset, uint32 bytes);
  75. bool
  76. aot_compiler_op_atomic_notify(AOTCompContext *comp_ctx,
  77. AOTFuncContext *func_ctx,
  78. uint32 align, uint32 offset, uint32 bytes);
  79. #endif
  80. #ifdef __cplusplus
  81. } /* end of extern "C" */
  82. #endif
  83. #endif /* end of _AOT_EMIT_MEMORY_H_ */