ppc-opcode.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright 2009 Freescale Semiconductor, Inc.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version
  7. * 2 of the License, or (at your option) any later version.
  8. *
  9. * provides masks and opcode images for use by code generation, emulation
  10. * and for instructions that older assemblers might not know about
  11. */
  12. #ifndef _ASM_POWERPC_PPC_OPCODE_H
  13. #define _ASM_POWERPC_PPC_OPCODE_H
  14. # define stringify_in_c(...) __VA_ARGS__
  15. # define ASM_CONST(x) x
  16. #define PPC_INST_VCMPEQUD_RC 0x100000c7
  17. #define PPC_INST_VCMPEQUB_RC 0x10000006
  18. #define __PPC_RC21 (0x1 << 10)
  19. /* macros to insert fields into opcodes */
  20. #define ___PPC_RA(a) (((a) & 0x1f) << 16)
  21. #define ___PPC_RB(b) (((b) & 0x1f) << 11)
  22. #define ___PPC_RS(s) (((s) & 0x1f) << 21)
  23. #define ___PPC_RT(t) ___PPC_RS(t)
  24. #define VCMPEQUD_RC(vrt, vra, vrb) stringify_in_c(.long PPC_INST_VCMPEQUD_RC | \
  25. ___PPC_RT(vrt) | ___PPC_RA(vra) | \
  26. ___PPC_RB(vrb) | __PPC_RC21)
  27. #define VCMPEQUB_RC(vrt, vra, vrb) stringify_in_c(.long PPC_INST_VCMPEQUB_RC | \
  28. ___PPC_RT(vrt) | ___PPC_RA(vra) | \
  29. ___PPC_RB(vrb) | __PPC_RC21)
  30. #endif /* _ASM_POWERPC_PPC_OPCODE_H */