2000-09-26 Dave Brolley <brolley@redhat.com>

* cgen-utils.c (RORQI): New function.
	(ROLQI): New function.
	(RORHI): New function.
	(ROLHI): New function.
This commit is contained in:
Dave Brolley 2000-09-26 17:23:58 +00:00
parent c78b412857
commit 6d4c43bfc6
2 changed files with 75 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2000-09-26 Dave Brolley <brolley@redhat.com>
* cgen-utils.c (RORQI): New function.
(ROLQI): New function.
(RORHI): New function.
(ROLHI): New function.
2000-08-28 Dave Brolley <brolley@redhat.com> 2000-08-28 Dave Brolley <brolley@redhat.com>
* cgen-trace.c (sim_cgen_disassemble_insn): Make sure entire insn is * cgen-trace.c (sim_cgen_disassemble_insn): Make sure entire insn is

View File

@ -321,6 +321,74 @@ CONVDISI (val)
#endif /* DI_FN_SUPPORT */ #endif /* DI_FN_SUPPORT */
QI
RORQI (val, shift)
QI val;
int shift;
{
if (shift != 0)
{
int remain = 8 - shift;
int mask = (1 << shift) - 1;
QI result = (val & mask) << remain;
mask = (1 << remain) - 1;
result |= (val >> shift) & mask;
return result;
}
return val;
}
QI
ROLQI (val, shift)
QI val;
int shift;
{
if (shift != 0)
{
int remain = 8 - shift;
int mask = (1 << remain) - 1;
QI result = (val & mask) << shift;
mask = (1 << shift) - 1;
result |= (val >> remain) & mask;
return result;
}
return val;
}
HI
RORHI (val, shift)
HI val;
int shift;
{
if (shift != 0)
{
int remain = 16 - shift;
int mask = (1 << shift) - 1;
HI result = (val & mask) << remain;
mask = (1 << remain) - 1;
result |= (val >> shift) & mask;
return result;
}
return val;
}
HI
ROLHI (val, shift)
HI val;
int shift;
{
if (shift != 0)
{
int remain = 16 - shift;
int mask = (1 << remain) - 1;
HI result = (val & mask) << shift;
mask = (1 << shift) - 1;
result |= (val >> remain) & mask;
return result;
}
return val;
}
SI SI
RORSI (val, shift) RORSI (val, shift)
SI val; SI val;