2000-11-20 Ben Elliston <bje@redhat.com>
* cgen-ops.h (SUBBI): New macro. (SUBWORDSIQI, SUBWORDSIHI, SUBWORDSIUQI): New functions. (SUBWORDDIHI, SUBWORDDIUQI, SUBWORDDIDF): Likewise.
This commit is contained in:
parent
b612ab9c43
commit
4f49fa1bf0
@ -1,3 +1,9 @@
|
|||||||
|
2000-11-20 Ben Elliston <bje@redhat.com>
|
||||||
|
|
||||||
|
* cgen-ops.h (SUBBI): New macro.
|
||||||
|
(SUBWORDSIQI, SUBWORDSIHI, SUBWORDSIUQI): New functions.
|
||||||
|
(SUBWORDDIHI, SUBWORDDIUQI, SUBWORDDIDF): Likewise.
|
||||||
|
|
||||||
2000-11-16 Ben Elliston <bje@redhat.com>
|
2000-11-16 Ben Elliston <bje@redhat.com>
|
||||||
|
|
||||||
* cgen-types.h (VOID): New type.
|
* cgen-types.h (VOID): New type.
|
||||||
|
@ -23,6 +23,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||||||
#ifndef CGEN_SEM_OPS_H
|
#ifndef CGEN_SEM_OPS_H
|
||||||
#define CGEN_SEM_OPS_H
|
#define CGEN_SEM_OPS_H
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#if defined (__GNUC__) && ! defined (SEMOPS_DEFINE_INLINE)
|
#if defined (__GNUC__) && ! defined (SEMOPS_DEFINE_INLINE)
|
||||||
#define SEMOPS_DEFINE_INLINE
|
#define SEMOPS_DEFINE_INLINE
|
||||||
#define SEMOPS_INLINE extern inline
|
#define SEMOPS_INLINE extern inline
|
||||||
@ -39,6 +41,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||||||
#define ANDIF(x, y) ((x) && (y))
|
#define ANDIF(x, y) ((x) && (y))
|
||||||
#define ORIF(x, y) ((x) || (y))
|
#define ORIF(x, y) ((x) || (y))
|
||||||
|
|
||||||
|
#define SUBBI(x, y) ((x) - (y))
|
||||||
#define ANDBI(x, y) ((x) & (y))
|
#define ANDBI(x, y) ((x) & (y))
|
||||||
#define ORBI(x, y) ((x) | (y))
|
#define ORBI(x, y) ((x) | (y))
|
||||||
#define XORBI(x, y) ((x) ^ (y))
|
#define XORBI(x, y) ((x) ^ (y))
|
||||||
@ -308,6 +311,44 @@ SUBWORDSISF (SI in)
|
|||||||
return x.out;
|
return x.out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SEMOPS_INLINE DF
|
||||||
|
SUBWORDDIDF (DI in)
|
||||||
|
{
|
||||||
|
union { DI in; DF out; } x;
|
||||||
|
x.in = in;
|
||||||
|
return x.out;
|
||||||
|
}
|
||||||
|
|
||||||
|
SEMOPS_INLINE QI
|
||||||
|
SUBWORDSIQI (SI in, int byte)
|
||||||
|
{
|
||||||
|
assert (byte >= 0 && byte <= 3);
|
||||||
|
return (UQI) (in >> (8 * (3 - byte)));
|
||||||
|
}
|
||||||
|
|
||||||
|
SEMOPS_INLINE UQI
|
||||||
|
SUBWORDSIUQI (SI in, int byte)
|
||||||
|
{
|
||||||
|
assert (byte >= 0 && byte <= 3);
|
||||||
|
return (UQI) (in >> (8 * (3 - byte)));
|
||||||
|
}
|
||||||
|
|
||||||
|
SEMOPS_INLINE HI
|
||||||
|
SUBWORDDIHI (DI in, int word)
|
||||||
|
{
|
||||||
|
assert (word >= 0 && word <= 3);
|
||||||
|
return (UHI) (in >> (16 * (3 - word)));
|
||||||
|
}
|
||||||
|
|
||||||
|
SEMOPS_INLINE HI
|
||||||
|
SUBWORDSIHI (SI in, int word)
|
||||||
|
{
|
||||||
|
if (word == 0)
|
||||||
|
return (USI) in >> 16;
|
||||||
|
else
|
||||||
|
return in;
|
||||||
|
}
|
||||||
|
|
||||||
SEMOPS_INLINE SI
|
SEMOPS_INLINE SI
|
||||||
SUBWORDSFSI (SF in)
|
SUBWORDSFSI (SF in)
|
||||||
{
|
{
|
||||||
@ -316,6 +357,13 @@ SUBWORDSFSI (SF in)
|
|||||||
return x.out;
|
return x.out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SEMOPS_INLINE UQI
|
||||||
|
SUBWORDDIUQI (DI in, int byte)
|
||||||
|
{
|
||||||
|
assert (byte >= 0 && byte <= 7);
|
||||||
|
return (UQI) (in >> (8 * (7 - byte)));
|
||||||
|
}
|
||||||
|
|
||||||
SEMOPS_INLINE SI
|
SEMOPS_INLINE SI
|
||||||
SUBWORDDISI (DI in, int word)
|
SUBWORDDISI (DI in, int word)
|
||||||
{
|
{
|
||||||
@ -397,13 +445,20 @@ JOINSITF (SI x0, SI x1, SI x2, SI x3)
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
SF SUBWORDSISF (SI);
|
QI SUBWORDSIQI (SI);
|
||||||
|
HI SUBWORDSIHI (HI);
|
||||||
SI SUBWORDSFSI (SF);
|
SI SUBWORDSFSI (SF);
|
||||||
|
SF SUBWORDSISF (SI);
|
||||||
|
DF SUBWORDDIDF (DI);
|
||||||
|
HI SUBWORDDIHI (DI, int);
|
||||||
SI SUBWORDDISI (DI, int);
|
SI SUBWORDDISI (DI, int);
|
||||||
SI SUBWORDDFSI (DF, int);
|
SI SUBWORDDFSI (DF, int);
|
||||||
SI SUBWORDXFSI (XF, int);
|
SI SUBWORDXFSI (XF, int);
|
||||||
SI SUBWORDTFSI (TF, int);
|
SI SUBWORDTFSI (TF, int);
|
||||||
|
|
||||||
|
UQI SUBWORDSIUQI (SI);
|
||||||
|
UQI SUBWORDDIUQI (DI);
|
||||||
|
|
||||||
DI JOINSIDI (SI, SI);
|
DI JOINSIDI (SI, SI);
|
||||||
DF JOINSIDF (SI, SI);
|
DF JOINSIDF (SI, SI);
|
||||||
XF JOINSIXF (SI, SI, SI);
|
XF JOINSIXF (SI, SI, SI);
|
||||||
|
Loading…
Reference in New Issue
Block a user