altivec_expression.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* Altivec expression macros, for PSIM, the PowerPC simulator.
  2. Copyright 2003-2022 Free Software Foundation, Inc.
  3. Contributed by Red Hat Inc; developed under contract from Motorola.
  4. Written by matthew green <mrg@redhat.com>.
  5. This file is part of GDB.
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 3 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  16. /* AltiVec macro helpers. */
  17. #define ALTIVEC_SET_CR6(vS, checkone) \
  18. do { \
  19. if (checkone && ((*vS).w[0] == 0xffffffff && \
  20. (*vS).w[1] == 0xffffffff && \
  21. (*vS).w[2] == 0xffffffff && \
  22. (*vS).w[3] == 0xffffffff)) \
  23. CR_SET(6, 1 << 3); \
  24. else if ((*vS).w[0] == 0 && \
  25. (*vS).w[1] == 0 && \
  26. (*vS).w[2] == 0 && \
  27. (*vS).w[3] == 0) \
  28. CR_SET(6, 1 << 1); \
  29. else \
  30. CR_SET(6, 0); \
  31. } while (0)
  32. #define VSCR_SAT 0x00000001
  33. #define VSCR_NJ 0x00010000
  34. #define ALTIVEC_SET_SAT(sat) \
  35. do { \
  36. if (sat) \
  37. VSCR |= VSCR_SAT; \
  38. } while (0)