utils-mdmx.inc 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # MIPS simulator testsuite MDMX utility functions.
  2. # Copyright (C) 2004-2022 Free Software Foundation, Inc.
  3. # Contributed by Chris Demetriou of Broadcom Corporation.
  4. #
  5. # This file is part of the GNU simulators.
  6. #
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 3 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program. If not, see <http://www.gnu.org/licenses/>. */
  19. .include "utils-fpu.inc"
  20. ###
  21. ### Shared macros
  22. ###
  23. # Enable MDMX: enable the FPU w/ FR=1, then set Status.MX
  24. .macro enable_mdmx
  25. enable_fpu 1
  26. mfc0 $20, $12
  27. or $20, $20, (1 << 24)
  28. mtc0 $20, $12
  29. .endm
  30. ###
  31. ### .OB-format macros
  32. ###
  33. .macro ld_ob r, v
  34. .data
  35. 1: .dword \v
  36. .previous
  37. ldc1 \r, 1b
  38. .endm
  39. .macro ck_ob r, v
  40. .data
  41. 1: .dword \v
  42. .previous
  43. dmfc1 $20, \r
  44. ld $21, 1b
  45. bne $20, $21, _fail
  46. nop
  47. .endm
  48. .macro ld_acc_ob h, m, l
  49. ld_ob $f20, \m
  50. ld_ob $f21, \l
  51. wacl.ob $f20, $f21
  52. ld_ob $f20, \h
  53. wach.ob $f20
  54. .endm
  55. .macro ck_acc_ob h, m, l
  56. rach.ob $f20
  57. ck_ob $f20, \h
  58. racm.ob $f20
  59. ck_ob $f20, \m
  60. racl.ob $f20
  61. ck_ob $f20, \l
  62. .endm