src/lj_carith.h - luajit-2.0-src

Macros defined

Source code

  1. /*
  2. ** C data arithmetic.
  3. ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
  4. */

  5. #ifndef _LJ_CARITH_H
  6. #define _LJ_CARITH_H

  7. #include "lj_obj.h"

  8. #if LJ_HASFFI

  9. LJ_FUNC int lj_carith_op(lua_State *L, MMS mm);

  10. #if LJ_32
  11. LJ_FUNC uint64_t lj_carith_shl64(uint64_t x, int32_t sh);
  12. LJ_FUNC uint64_t lj_carith_shr64(uint64_t x, int32_t sh);
  13. LJ_FUNC uint64_t lj_carith_sar64(uint64_t x, int32_t sh);
  14. LJ_FUNC uint64_t lj_carith_rol64(uint64_t x, int32_t sh);
  15. LJ_FUNC uint64_t lj_carith_ror64(uint64_t x, int32_t sh);
  16. #endif
  17. LJ_FUNC uint64_t lj_carith_shift64(uint64_t x, int32_t sh, int op);
  18. LJ_FUNC uint64_t lj_carith_check64(lua_State *L, int narg, CTypeID *id);

  19. #if LJ_32 && LJ_HASJIT
  20. LJ_FUNC int64_t lj_carith_mul64(int64_t x, int64_t k);
  21. #endif
  22. LJ_FUNC uint64_t lj_carith_divu64(uint64_t a, uint64_t b);
  23. LJ_FUNC int64_t lj_carith_divi64(int64_t a, int64_t b);
  24. LJ_FUNC uint64_t lj_carith_modu64(uint64_t a, uint64_t b);
  25. LJ_FUNC int64_t lj_carith_modi64(int64_t a, int64_t b);
  26. LJ_FUNC uint64_t lj_carith_powu64(uint64_t x, uint64_t k);
  27. LJ_FUNC int64_t lj_carith_powi64(int64_t x, int64_t k);

  28. #endif

  29. #endif