diff options
author | Ben Elliston <bje@au.ibm.com> | 2000-12-04 04:05:45 +0000 |
---|---|---|
committer | Ben Elliston <bje@au.ibm.com> | 2000-12-04 04:05:45 +0000 |
commit | 6227bc851d73cda21a6f0e7a39780c1ad7eb1116 (patch) | |
tree | d68458df6113a52213fcf6f82261f46e3047f456 /sim | |
parent | 88c72b7d7171d9f162ed9ecca26cf1d45abc38ee (diff) | |
download | gdb-6227bc851d73cda21a6f0e7a39780c1ad7eb1116.zip gdb-6227bc851d73cda21a6f0e7a39780c1ad7eb1116.tar.gz gdb-6227bc851d73cda21a6f0e7a39780c1ad7eb1116.tar.bz2 |
2000-12-04 Ben Elliston <bje@redhat.com>
* cgen-ops.h (SUBWORDSIQI): Mask off top bits.
(SUBWORDSIUQI): Likewise.
(SUBWORDDIHI): Likewise.
(SUBWORDDIQI): New function.
Diffstat (limited to 'sim')
-rw-r--r-- | sim/common/ChangeLog | 5 | ||||
-rw-r--r-- | sim/common/cgen-ops.h | 14 |
2 files changed, 16 insertions, 3 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index ec82ccb..074fcd7 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,5 +1,10 @@ 2000-12-04 Ben Elliston <bje@redhat.com> + * cgen-ops.h (SUBWORDSIQI): Mask off top bits. + (SUBWORDSIUQI): Likewise. + (SUBWORDDIHI): Likewise. + (SUBWORDDIQI): New function. + * cgen-trace.c (disassemble_insn): Remove unused declaration. * cgen-scache.c (scache_option_handler): Remove unused local var. diff --git a/sim/common/cgen-ops.h b/sim/common/cgen-ops.h index 83f4459..d829e93 100644 --- a/sim/common/cgen-ops.h +++ b/sim/common/cgen-ops.h @@ -323,21 +323,28 @@ SEMOPS_INLINE QI SUBWORDSIQI (SI in, int byte) { assert (byte >= 0 && byte <= 3); - return (UQI) (in >> (8 * (3 - byte))); + return (UQI) (in >> (8 * (3 - byte))) & 0xFF; } SEMOPS_INLINE UQI SUBWORDSIUQI (SI in, int byte) { assert (byte >= 0 && byte <= 3); - return (UQI) (in >> (8 * (3 - byte))); + return (UQI) (in >> (8 * (3 - byte))) & 0xFF; +} + +SEMOPS_INLINE QI +SUBWORDDIQI (DI in, int byte) +{ + assert (byte >= 0 && byte <= 7); + return (UQI) (in >> (8 * (7 - byte))) & 0xFF; } SEMOPS_INLINE HI SUBWORDDIHI (DI in, int word) { assert (word >= 0 && word <= 3); - return (UHI) (in >> (16 * (3 - word))); + return (UHI) (in >> (16 * (3 - word))) & 0xFFFF; } SEMOPS_INLINE HI @@ -450,6 +457,7 @@ HI SUBWORDSIHI (HI); SI SUBWORDSFSI (SF); SF SUBWORDSISF (SI); DF SUBWORDDIDF (DI); +QI SUBWORDDIQI (DI, int); HI SUBWORDDIHI (DI, int); SI SUBWORDDISI (DI, int); SI SUBWORDDFSI (DF, int); |