mips_arch.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License 2.0 (the "License"). You may not use
  5. * this file except in compliance with the License. You can obtain a copy
  6. * in the file LICENSE in the source distribution or at
  7. * https://www.openssl.org/source/license.html
  8. */
  9. #ifndef __MIPS_ARCH_H__
  10. # define __MIPS_ARCH_H__
  11. # if (defined(__mips_smartmips) || defined(_MIPS_ARCH_MIPS32R3) || \
  12. defined(_MIPS_ARCH_MIPS32R5) || defined(_MIPS_ARCH_MIPS32R6)) \
  13. && !defined(_MIPS_ARCH_MIPS32R2)
  14. # define _MIPS_ARCH_MIPS32R2
  15. # endif
  16. # if (defined(_MIPS_ARCH_MIPS64R3) || defined(_MIPS_ARCH_MIPS64R5) || \
  17. defined(_MIPS_ARCH_MIPS64R6)) \
  18. && !defined(_MIPS_ARCH_MIPS64R2)
  19. # define _MIPS_ARCH_MIPS64R2
  20. # endif
  21. # if defined(_MIPS_ARCH_MIPS64R6)
  22. # define dmultu(rs,rt)
  23. # define mflo(rd,rs,rt) dmulu rd,rs,rt
  24. # define mfhi(rd,rs,rt) dmuhu rd,rs,rt
  25. # elif defined(_MIPS_ARCH_MIPS32R6)
  26. # define multu(rs,rt)
  27. # define mflo(rd,rs,rt) mulu rd,rs,rt
  28. # define mfhi(rd,rs,rt) muhu rd,rs,rt
  29. # else
  30. # define dmultu(rs,rt) dmultu rs,rt
  31. # define multu(rs,rt) multu rs,rt
  32. # define mflo(rd,rs,rt) mflo rd
  33. # define mfhi(rd,rs,rt) mfhi rd
  34. # endif
  35. #endif