diff options
author | Torbjorn Granlund <tege@gnu.org> | 1992-08-10 10:21:57 +0000 |
---|---|---|
committer | Torbjorn Granlund <tege@gnu.org> | 1992-08-10 10:21:57 +0000 |
commit | c819adf2dda929366e02434f0c662057df29473a (patch) | |
tree | 2c3244f90831eeeb89df9e23accda7f900fdc691 /gcc | |
parent | ba0443bbb2bd66d3f68070f8318e171d57ede851 (diff) | |
download | gcc-c819adf2dda929366e02434f0c662057df29473a.zip gcc-c819adf2dda929366e02434f0c662057df29473a.tar.gz gcc-c819adf2dda929366e02434f0c662057df29473a.tar.bz2 |
(output_zdepi): New function (contents from pa.md).
From-SVN: r1789
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/pa/pa.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 1bb7104..b1eca1d 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -699,6 +699,45 @@ singlemove_string (operands) } +char * +output_zdepi (operands) + rtx *operands; +{ + unsigned long x = INTVAL (operands[1]); + int i; + + for (i = 0; i < 32; i++) + { + if ((x & 1) != 0) + break; + x >>= 1; + } + + if ((x & 0x10) == 0) + { + operands[1] = gen_rtx (CONST_INT, VOIDmode, x); + operands[2] = gen_rtx (CONST_INT, VOIDmode, 31 - i); + operands[3] = gen_rtx (CONST_INT, VOIDmode, 32 - i < 4 ? 32 - i : 4); + } + else + { + operands[1] = gen_rtx (CONST_INT, VOIDmode, (x & 0xf) - 0x10); + operands[2] = gen_rtx (CONST_INT, VOIDmode, 31 - i); + + x >>= 5; + for (i = 0; i < 32; i++) + { + if ((x & 1) == 0) + break; + x >>= 1; + } + + operands[3] = gen_rtx (CONST_INT, VOIDmode, i + 5); + } + + return "zdepi %1,%2,%3,%0"; +} + /* Output assembler code to perform a doubleword move insn with operands OPERANDS. */ |