2
0

asmdefs_mmi.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * Copyright (c) 2017 The WebM project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef VPX_VPX_PORTS_ASMDEFS_MMI_H_
  11. #define VPX_VPX_PORTS_ASMDEFS_MMI_H_
  12. #include "./vpx_config.h"
  13. #include "vpx/vpx_integer.h"
  14. #if HAVE_MMI
  15. #if HAVE_MIPS64
  16. #define mips_reg int64_t
  17. #define MMI_ADDU(reg1, reg2, reg3) \
  18. "daddu " #reg1 ", " #reg2 ", " #reg3 " \n\t"
  19. #define MMI_ADDIU(reg1, reg2, immediate) \
  20. "daddiu " #reg1 ", " #reg2 ", " #immediate " \n\t"
  21. #define MMI_ADDI(reg1, reg2, immediate) \
  22. "daddi " #reg1 ", " #reg2 ", " #immediate " \n\t"
  23. #define MMI_SUBU(reg1, reg2, reg3) \
  24. "dsubu " #reg1 ", " #reg2 ", " #reg3 " \n\t"
  25. #define MMI_L(reg, addr, bias) \
  26. "ld " #reg ", " #bias "(" #addr ") \n\t"
  27. #define MMI_SRL(reg1, reg2, shift) \
  28. "dsrl " #reg1 ", " #reg2 ", " #shift " \n\t"
  29. #define MMI_SLL(reg1, reg2, shift) \
  30. "dsll " #reg1 ", " #reg2 ", " #shift " \n\t"
  31. #define MMI_MTC1(reg, fp) \
  32. "dmtc1 " #reg ", " #fp " \n\t"
  33. #define MMI_LI(reg, immediate) \
  34. "dli " #reg ", " #immediate " \n\t"
  35. #else
  36. #define mips_reg int32_t
  37. #define MMI_ADDU(reg1, reg2, reg3) \
  38. "addu " #reg1 ", " #reg2 ", " #reg3 " \n\t"
  39. #define MMI_ADDIU(reg1, reg2, immediate) \
  40. "addiu " #reg1 ", " #reg2 ", " #immediate " \n\t"
  41. #define MMI_ADDI(reg1, reg2, immediate) \
  42. "addi " #reg1 ", " #reg2 ", " #immediate " \n\t"
  43. #define MMI_SUBU(reg1, reg2, reg3) \
  44. "subu " #reg1 ", " #reg2 ", " #reg3 " \n\t"
  45. #define MMI_L(reg, addr, bias) \
  46. "lw " #reg ", " #bias "(" #addr ") \n\t"
  47. #define MMI_SRL(reg1, reg2, shift) \
  48. "srl " #reg1 ", " #reg2 ", " #shift " \n\t"
  49. #define MMI_SLL(reg1, reg2, shift) \
  50. "sll " #reg1 ", " #reg2 ", " #shift " \n\t"
  51. #define MMI_MTC1(reg, fp) \
  52. "mtc1 " #reg ", " #fp " \n\t"
  53. #define MMI_LI(reg, immediate) \
  54. "li " #reg ", " #immediate " \n\t"
  55. #endif /* HAVE_MIPS64 */
  56. #endif /* HAVE_MMI */
  57. #endif // VPX_VPX_PORTS_ASMDEFS_MMI_H_