aboutsummaryrefslogtreecommitdiff
path: root/bfd/libhppa.h
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2000-04-24 08:14:43 +0000
committerJeff Law <law@redhat.com>2000-04-24 08:14:43 +0000
commit9fd9378ca0dcc59270194784dc76b124b249fb91 (patch)
tree7316fe2a910109546db60c71a27d969bddc582a4 /bfd/libhppa.h
parentb9f6667271e3dcb238c04160c38a46d2bd37753c (diff)
downloadfsf-binutils-gdb-9fd9378ca0dcc59270194784dc76b124b249fb91.zip
fsf-binutils-gdb-9fd9378ca0dcc59270194784dc76b124b249fb91.tar.gz
fsf-binutils-gdb-9fd9378ca0dcc59270194784dc76b124b249fb91.tar.bz2
* libhppa.h (dis_assemble_16): New function.
(pa_arch): Added pa20w element.
Diffstat (limited to 'bfd/libhppa.h')
-rw-r--r--bfd/libhppa.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/bfd/libhppa.h b/bfd/libhppa.h
index c32eabe..649bcab 100644
--- a/bfd/libhppa.h
+++ b/bfd/libhppa.h
@@ -46,6 +46,8 @@ static INLINE unsigned int assemble_12 (unsigned int, unsigned int)
static INLINE void dis_assemble_12 (unsigned int, unsigned int *,
unsigned int *)
__attribute__ ((__unused__));
+static INLINE void dis_assemble_16 (unsigned int, unsigned int *, int)
+ __attribute__ ((__unused__));
static INLINE unsigned long assemble_17 (unsigned int, unsigned int,
unsigned int)
__attribute__ ((__unused__));
@@ -81,7 +83,7 @@ static INLINE unsigned long hppa_rebuild_insn (bfd *, unsigned long,
/* The PA instruction set variants. */
-enum pa_arch {pa10 = 10, pa11 = 11, pa20 = 20};
+enum pa_arch {pa10 = 10, pa11 = 11, pa20 = 20, pa20w = 25};
/* HP PA-RISC relocation types */
@@ -277,6 +279,30 @@ dis_assemble_12 (as12, x, y)
*x = ((as12 & 0x3ff) << 1) | ((as12 & 0x400) >> 10);
}
+static INLINE void
+dis_assemble_16 (as16, x, wide)
+ unsigned int as16;
+ unsigned int *x;
+ int wide;
+{
+ unsigned int t1, t2;
+
+ if (wide)
+ {
+ /* Unusual 16-bit encoding. */
+ t1 = (as16 << 1) & 0xffff;
+ t2 = (as16 & 0x8000);
+ *x = t1 ^ t2 ^ (t2 >> 1) | (t2 >> 15);
+ }
+ else
+ {
+ /* Standard 14-bit encoding. */
+ t1 = (as16 << 1) & 0x3fff;
+ t2 = (as16 & 0x2000);
+ *x = t1 | (t2 >> 13);
+ }
+}
+
static INLINE unsigned long
assemble_16 (x, y)
unsigned int x, y;