armcpu.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* Copyright (c) 2010 Xiph.Org Foundation
  2. * Copyright (c) 2013 Parrot */
  3. /*
  4. Redistribution and use in source and binary forms, with or without
  5. modification, are permitted provided that the following conditions
  6. are met:
  7. - Redistributions of source code must retain the above copyright
  8. notice, this list of conditions and the following disclaimer.
  9. - Redistributions in binary form must reproduce the above copyright
  10. notice, this list of conditions and the following disclaimer in the
  11. documentation and/or other materials provided with the distribution.
  12. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  13. ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  14. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  15. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
  16. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  17. EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  18. PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  19. PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  20. LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  21. NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  22. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  23. */
  24. #if !defined(ARMCPU_H)
  25. # define ARMCPU_H
  26. # if defined(OPUS_ARM_MAY_HAVE_EDSP)
  27. # define MAY_HAVE_EDSP(name) name ## _edsp
  28. # else
  29. # define MAY_HAVE_EDSP(name) name ## _c
  30. # endif
  31. # if defined(OPUS_ARM_MAY_HAVE_MEDIA)
  32. # define MAY_HAVE_MEDIA(name) name ## _media
  33. # else
  34. # define MAY_HAVE_MEDIA(name) MAY_HAVE_EDSP(name)
  35. # endif
  36. # if defined(OPUS_ARM_MAY_HAVE_NEON)
  37. # define MAY_HAVE_NEON(name) name ## _neon
  38. # else
  39. # define MAY_HAVE_NEON(name) MAY_HAVE_MEDIA(name)
  40. # endif
  41. # if defined(OPUS_ARM_PRESUME_EDSP)
  42. # define PRESUME_EDSP(name) name ## _edsp
  43. # else
  44. # define PRESUME_EDSP(name) name ## _c
  45. # endif
  46. # if defined(OPUS_ARM_PRESUME_MEDIA)
  47. # define PRESUME_MEDIA(name) name ## _media
  48. # else
  49. # define PRESUME_MEDIA(name) PRESUME_EDSP(name)
  50. # endif
  51. # if defined(OPUS_ARM_PRESUME_NEON)
  52. # define PRESUME_NEON(name) name ## _neon
  53. # else
  54. # define PRESUME_NEON(name) PRESUME_MEDIA(name)
  55. # endif
  56. # if defined(OPUS_HAVE_RTCD)
  57. int opus_select_arch(void);
  58. #define OPUS_ARCH_ARM_V4 (0)
  59. #define OPUS_ARCH_ARM_EDSP (1)
  60. #define OPUS_ARCH_ARM_MEDIA (2)
  61. #define OPUS_ARCH_ARM_NEON (3)
  62. # endif
  63. #endif