ppc-opcode.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Copyright 2009 Freescale Semiconductor, Inc.
  4. *
  5. * provides masks and opcode images for use by code generation, emulation
  6. * and for instructions that older assemblers might not know about
  7. */
  8. #ifndef _ASM_POWERPC_PPC_OPCODE_H
  9. #define _ASM_POWERPC_PPC_OPCODE_H
  10. # define stringify_in_c(...) __VA_ARGS__
  11. # define ASM_CONST(x) x
  12. #define PPC_INST_VCMPEQUD_RC 0x100000c7
  13. #define PPC_INST_VCMPEQUB_RC 0x10000006
  14. #define __PPC_RC21 (0x1 << 10)
  15. /* macros to insert fields into opcodes */
  16. #define ___PPC_RA(a) (((a) & 0x1f) << 16)
  17. #define ___PPC_RB(b) (((b) & 0x1f) << 11)
  18. #define ___PPC_RS(s) (((s) & 0x1f) << 21)
  19. #define ___PPC_RT(t) ___PPC_RS(t)
  20. #define VCMPEQUD_RC(vrt, vra, vrb) stringify_in_c(.long PPC_INST_VCMPEQUD_RC | \
  21. ___PPC_RT(vrt) | ___PPC_RA(vra) | \
  22. ___PPC_RB(vrb) | __PPC_RC21)
  23. #define VCMPEQUB_RC(vrt, vra, vrb) stringify_in_c(.long PPC_INST_VCMPEQUB_RC | \
  24. ___PPC_RT(vrt) | ___PPC_RA(vra) | \
  25. ___PPC_RB(vrb) | __PPC_RC21)
  26. #endif /* _ASM_POWERPC_PPC_OPCODE_H */