From c819adf2dda929366e02434f0c662057df29473a Mon Sep 17 00:00:00 2001 From: Torbjorn Granlund Date: Mon, 10 Aug 1992 10:21:57 +0000 Subject: [PATCH] (output_zdepi): New function (contents from pa.md). From-SVN: r1789 --- gcc/config/pa/pa.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 1bb7104eed9..b1eca1df424 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. */ -- 2.30.2