summaryrefslogtreecommitdiff
path: root/gas/config/tc-hppa.c
diff options
context:
space:
mode:
Diffstat (limited to 'gas/config/tc-hppa.c')
-rw-r--r--gas/config/tc-hppa.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c
index da84526fa95..7bb7966141f 100644
--- a/gas/config/tc-hppa.c
+++ b/gas/config/tc-hppa.c
@@ -8676,9 +8676,19 @@ hppa_regname_to_dw2regnum (char *regname)
{
p = regname + 2;
regnum = strtoul (p, &q, 10);
+#if TARGET_ARCH_SIZE == 64
if (p == q || *q || regnum <= 4 || regnum >= 32)
return -1;
regnum += 32 - 4;
+#else
+ if (p == q
+ || (*q && ((*q != 'L' && *q != 'R') || *(q + 1)))
+ || regnum <= 4 || regnum >= 32)
+ return -1;
+ regnum = (regnum - 4) * 2 + 32;
+ if (*q == 'R')
+ regnum++;
+#endif
}
return regnum;
}