asm.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Copyright (C) 2022, Synopsys, Inc. (www.synopsys.com)
  3. *
  4. * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
  5. */
  6. #ifndef _ARC_ASM_H
  7. #define _ARC_ASM_H
  8. /*
  9. * Some 16-bit instructions were excluded from the ARCv3 ISA
  10. * the following macros are introduced to handle these changes in one place.
  11. * This will allow not to change existing ARCv2 code and use 16-bit versions
  12. * of instructions for ARCv2 and replace them with 32-bit vesrions for ARCv3
  13. */
  14. #if defined (__ARC64_ARCH32__)
  15. .macro PUSHR reg
  16. push \reg
  17. .endm
  18. .macro PUSHR_S reg
  19. push \reg
  20. .endm
  21. .macro POPR reg
  22. pop \reg
  23. .endm
  24. .macro POPR_S reg
  25. pop \reg
  26. .endm
  27. .macro SUBR_S dst,src1,src2
  28. sub \dst, \src1, \src2
  29. .endm
  30. .macro ADDR_S dst,src1,src2
  31. add \dst, \src1, \src2
  32. .endm
  33. .macro ASRR_S dst,src1,src2
  34. asr \dst, \src1, \src2
  35. .endm
  36. .macro ASLR_S dst,src1,src2
  37. asl \dst, \src1, \src2
  38. .endm
  39. #elif defined (__ARC64_ARCH64__)
  40. # error ARCv3 64-bit is not supported by uClibc-ng
  41. #else /* ARCHS || ARC700 */
  42. .macro PUSHR reg
  43. push \reg
  44. .endm
  45. .macro PUSHR_S reg
  46. push_s \reg
  47. .endm
  48. .macro POPR reg
  49. pop \reg
  50. .endm
  51. .macro POPR_S reg
  52. pop_s \reg
  53. .endm
  54. .macro SUBR_S dst,src1,src2
  55. sub_s \dst, \src1, \src2
  56. .endm
  57. .macro ADDR_S dst,src1,src2
  58. add_s \dst, \src1, \src2
  59. .endm
  60. .macro ASRR_S dst,src1,src2
  61. asr_s \dst, \src1, \src2
  62. .endm
  63. .macro ASLR_S dst,src1,src2
  64. asl_s \dst, \src1, \src2
  65. .endm
  66. #endif
  67. #endif /* _ARC_ASM_H */