bfin.c (print_operand): New modifier 'N' for constants.
authorBernd Schmidt <bernd.schmidt@analog.com>
Thu, 7 Dec 2006 11:06:08 +0000 (11:06 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Thu, 7 Dec 2006 11:06:08 +0000 (11:06 +0000)
* config/bfin/bfin.c (print_operand): New modifier 'N' for constants.
* config/bfin/bfin.md (ssashiftv2hi3, ssashifthi3, lshiftv2hi3,
lshifthi3): Use it, and fix the order of alternatives.

From-SVN: r119616

gcc/ChangeLog
gcc/config/bfin/bfin.c
gcc/config/bfin/bfin.md

index 33bd102..ad6b37e 100644 (file)
@@ -1,3 +1,9 @@
+2006-12-07  Bernd Schmidt  <bernd.schmidt@analog.com>
+
+       * config/bfin/bfin.c (print_operand): New modifier 'N' for constants.
+       * config/bfin/bfin.md (ssashiftv2hi3, ssashifthi3, lshiftv2hi3,
+       lshifthi3): Use it, and fix the order of alternatives.
+
 2006-12-07  Nick Clifton  <nickc@redhat.com>
 
        * common.opt (record-gcc-switches): New command line switch.
index 48fcbd1..abfeaee 100644 (file)
@@ -1381,6 +1381,8 @@ print_operand (FILE *file, rtx x, char code)
            x = GEN_INT ((INTVAL (x) >> 16) & 0xffff);
          else if (code == 'h')
            x = GEN_INT (INTVAL (x) & 0xffff);
+         else if (code == 'N')
+           x = GEN_INT (-INTVAL (x));
          else if (code == 'X')
            x = GEN_INT (exact_log2 (0xffffffff & INTVAL (x)));
          else if (code == 'Y')
index d6c5d7f..4542327 100644 (file)
   ""
   "@
    %0 = ASHIFT %1 BY %2 (V, S)%!
-   %0 = %1 >>> %2 (V,S)%!
-   %0 = %1 << %2 (V,S)%!"
+   %0 = %1 << %2 (V,S)%!
+   %0 = %1 >>> %N2 (V,S)%!"
   [(set_attr "type" "dsp32")])
 
 (define_insn "ssashifthi3"
   ""
   "@
    %0 = ASHIFT %1 BY %2 (V, S)%!
-   %0 = %1 >>> %2 (V,S)%!
-   %0 = %1 << %2 (V,S)%!"
+   %0 = %1 << %2 (V,S)%!
+   %0 = %1 >>> %N2 (V,S)%!"
   [(set_attr "type" "dsp32")])
 
 (define_insn "lshiftv2hi3"
   ""
   "@
    %0 = LSHIFT %1 BY %2 (V)%!
-   %0 = %1 >> %2 (V)%!
-   %0 = %1 << %2 (V)%!"
+   %0 = %1 << %2 (V)%!
+   %0 = %1 >> %N2 (V)%!"
   [(set_attr "type" "dsp32")])
 
 (define_insn "lshifthi3"
   ""
   "@
    %0 = LSHIFT %1 BY %2 (V)%!
-   %0 = %1 >> %2 (V)%!
-   %0 = %1 << %2 (V)%!"
+   %0 = %1 << %2 (V)%!
+   %0 = %1 >> %N2 (V)%!"
   [(set_attr "type" "dsp32")])