aot_emit_memory.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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, bool sign,
  17. bool atomic);
  18. bool
  19. aot_compile_op_i64_load(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  20. uint32 align, uint32 offset, uint32 bytes, bool sign,
  21. 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,
  31. bool atomic);
  32. bool
  33. aot_compile_op_i64_store(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  34. uint32 align, uint32 offset, uint32 bytes,
  35. bool atomic);
  36. bool
  37. aot_compile_op_f32_store(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  38. uint32 align, uint32 offset);
  39. bool
  40. aot_compile_op_f64_store(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  41. uint32 align, uint32 offset);
  42. LLVMValueRef
  43. aot_check_memory_overflow(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  44. uint32 offset, uint32 bytes);
  45. bool
  46. aot_compile_op_memory_size(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx);
  47. bool
  48. aot_compile_op_memory_grow(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx);
  49. #if WASM_ENABLE_BULK_MEMORY != 0
  50. bool
  51. aot_compile_op_memory_init(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  52. uint32 seg_index);
  53. bool
  54. aot_compile_op_data_drop(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  55. uint32 seg_index);
  56. bool
  57. aot_compile_op_memory_copy(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx);
  58. bool
  59. aot_compile_op_memory_fill(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx);
  60. #endif
  61. #if WASM_ENABLE_SHARED_MEMORY != 0
  62. bool
  63. aot_compile_op_atomic_rmw(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  64. uint8 atomic_op, uint8 op_type, uint32 align,
  65. uint32 offset, uint32 bytes);
  66. bool
  67. aot_compile_op_atomic_cmpxchg(AOTCompContext *comp_ctx,
  68. AOTFuncContext *func_ctx, uint8 op_type,
  69. uint32 align, uint32 offset, uint32 bytes);
  70. bool
  71. aot_compile_op_atomic_wait(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  72. uint8 op_type, uint32 align, uint32 offset,
  73. uint32 bytes);
  74. bool
  75. aot_compiler_op_atomic_notify(AOTCompContext *comp_ctx,
  76. AOTFuncContext *func_ctx, uint32 align,
  77. uint32 offset, uint32 bytes);
  78. #endif
  79. #ifdef __cplusplus
  80. } /* end of extern "C" */
  81. #endif
  82. #endif /* end of _AOT_EMIT_MEMORY_H_ */