1
0

001-revert_register_mode_search.patch 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. Revert of:
  2. commit 275035b56823b26d5fb7e90fad945b998648edf2
  3. Author: bergner <bergner@138bc75d-0d04-0410-961f-82ee72b054a4>
  4. Date: Thu Sep 5 14:09:07 2013 +0000
  5. PR target/58139
  6. * reginfo.c (choose_hard_reg_mode): Scan through all mode classes
  7. looking for widest mode.
  8. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202286 138bc75d-0d04-0410-961f-82ee72b054a4
  9. --- a/gcc/reginfo.c
  10. +++ b/gcc/reginfo.c
  11. @@ -665,35 +665,40 @@ choose_hard_reg_mode (unsigned int regno
  12. mode = GET_MODE_WIDER_MODE (mode))
  13. if ((unsigned) hard_regno_nregs[regno][mode] == nregs
  14. && HARD_REGNO_MODE_OK (regno, mode)
  15. - && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
  16. - && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
  17. + && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
  18. found_mode = mode;
  19. + if (found_mode != VOIDmode)
  20. + return found_mode;
  21. +
  22. for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT);
  23. mode != VOIDmode;
  24. mode = GET_MODE_WIDER_MODE (mode))
  25. if ((unsigned) hard_regno_nregs[regno][mode] == nregs
  26. && HARD_REGNO_MODE_OK (regno, mode)
  27. - && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
  28. - && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
  29. + && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
  30. found_mode = mode;
  31. + if (found_mode != VOIDmode)
  32. + return found_mode;
  33. +
  34. for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT);
  35. mode != VOIDmode;
  36. mode = GET_MODE_WIDER_MODE (mode))
  37. if ((unsigned) hard_regno_nregs[regno][mode] == nregs
  38. && HARD_REGNO_MODE_OK (regno, mode)
  39. - && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
  40. - && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
  41. + && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
  42. found_mode = mode;
  43. + if (found_mode != VOIDmode)
  44. + return found_mode;
  45. +
  46. for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_INT);
  47. mode != VOIDmode;
  48. mode = GET_MODE_WIDER_MODE (mode))
  49. if ((unsigned) hard_regno_nregs[regno][mode] == nregs
  50. && HARD_REGNO_MODE_OK (regno, mode)
  51. - && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
  52. - && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
  53. + && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
  54. found_mode = mode;
  55. if (found_mode != VOIDmode)