Commit 2129b081 by Jim Wilson Committed by Jim Wilson

Patch from Gary McGary to fix i960 problem with out-of-range shifts.

	* i960.h (hard_regno_mode_ok): Changed to function from array of
 	unsigned.
	(HARD_REGNO_MODE_OK): Call function instead of testing bit.
	* i960.c (hard_regno_mode_ok): Changed to function from array of
 	unsigned.

From-SVN: r19745
parent f2ee215b
Thu May 14 12:58:21 1998 Jim Wilson <wilson@cygnus.com>
* i960.h (hard_regno_mode_ok): Changed to function from array of
unsigned.
(HARD_REGNO_MODE_OK): Call function instead of testing bit.
* i960.c (hard_regno_mode_ok): Changed to function from array of
unsigned.
Thu May 14 08:41:46 1998 J"orn Rennecke <amylaar@cygnus.co.uk> Thu May 14 08:41:46 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
* reload.c (remove_replacements): New function. * reload.c (remove_replacements): New function.
......
...@@ -2067,40 +2067,57 @@ i960_alignment (size, align) ...@@ -2067,40 +2067,57 @@ i960_alignment (size, align)
} }
#endif #endif
/* Modes for condition codes. */
#define C_MODES \
((1 << (int) CCmode) | (1 << (int) CC_UNSmode) | (1<< (int) CC_CHKmode))
/* Modes for single-word (and smaller) quantities. */ int
#define S_MODES \ hard_regno_mode_ok (regno, mode)
(~C_MODES \ int regno;
& ~ ((1 << (int) DImode) | (1 << (int) TImode) \ enum machine_mode mode;
| (1 << (int) DFmode) | (1 << (int) XFmode))) {
if (regno < 32)
/* Modes for double-word (and smaller) quantities. */ {
#define D_MODES \ switch (mode)
(~C_MODES \ {
& ~ ((1 << (int) TImode) | (1 << (int) XFmode))) case CCmode: case CC_UNSmode: case CC_CHKmode:
return 0;
/* Modes for quad-word quantities. */ case DImode: case DFmode:
#define T_MODES (~C_MODES) return (regno & 1) == 0;
/* Modes for single-float quantities. */ case TImode: case XFmode:
#define SF_MODES ((1 << (int) SFmode)) return (regno & 3) == 0;
/* Modes for double-float quantities. */ default:
#define DF_MODES (SF_MODES | (1 << (int) DFmode) | (1 << (int) SCmode)) return 1;
}
}
else if (regno >= 32 && regno < 36)
{
switch (mode)
{
case SFmode: case DFmode: case XFmode:
case SCmode: case DCmode:
return 1;
/* Modes for quad-float quantities. */ default:
#define XF_MODES (DF_MODES | (1 << (int) XFmode) | (1 << (int) DCmode)) return 0;
}
}
else if (regno == 36)
{
switch (mode)
{
case CCmode: case CC_UNSmode: case CC_CHKmode:
return 1;
unsigned int hard_regno_mode_ok[FIRST_PSEUDO_REGISTER] = { default:
T_MODES, S_MODES, D_MODES, S_MODES, T_MODES, S_MODES, D_MODES, S_MODES, return 0;
T_MODES, S_MODES, D_MODES, S_MODES, T_MODES, S_MODES, D_MODES, S_MODES, }
T_MODES, S_MODES, D_MODES, S_MODES, T_MODES, S_MODES, D_MODES, S_MODES, }
T_MODES, S_MODES, D_MODES, S_MODES, T_MODES, S_MODES, D_MODES, S_MODES, else if (regno == 37)
return 0;
XF_MODES, XF_MODES, XF_MODES, XF_MODES, C_MODES}; abort ();
}
/* Return the minimum alignment of an expression rtx X in bytes. This takes /* Return the minimum alignment of an expression rtx X in bytes. This takes
......
...@@ -506,9 +506,8 @@ extern int target_flags; ...@@ -506,9 +506,8 @@ extern int target_flags;
/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
On 80960, the cpu registers can hold any mode but the float registers On 80960, the cpu registers can hold any mode but the float registers
can only hold SFmode, DFmode, or XFmode. */ can only hold SFmode, DFmode, or XFmode. */
extern unsigned int hard_regno_mode_ok[FIRST_PSEUDO_REGISTER]; extern int hard_regno_mode_ok ();
#define HARD_REGNO_MODE_OK(REGNO, MODE) \ #define HARD_REGNO_MODE_OK(REGNO, MODE) hard_regno_mode_ok ((REGNO), (MODE))
((hard_regno_mode_ok[REGNO] & (1 << (int) (MODE))) != 0)
/* Value is 1 if it is a good idea to tie two pseudo registers /* Value is 1 if it is a good idea to tie two pseudo registers
when one has mode MODE1 and one has mode MODE2. when one has mode MODE1 and one has mode MODE2.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment