re PR target/69810 (PowerPC64: unrecognizable insn)
authorDavid Edelsohn <dje.gcc@gmail.com>
Fri, 29 Apr 2016 17:20:36 +0000 (17:20 +0000)
committerDavid Edelsohn <dje@gcc.gnu.org>
Fri, 29 Apr 2016 17:20:36 +0000 (13:20 -0400)
        PR target/69810
        * config/rs6000/rs6000.md (EXTQI): Don't allow extension to HImode.
        (zero_extendqi<mode>2_dot): Revert earlier conversion from
        define_insn_and_split to define_insn.
        (zero_extendqi<mode>2_dot2): Same.
        (extendqi<mode>2_dot): Same.
        (extendqi<mode>2_dot2): Same.

From-SVN: r235646

gcc/ChangeLog
gcc/config/rs6000/rs6000.md

index 01f2580cc77c5b35e1505fc4af91b8fe70d2a814..1b06c04e430a72108760332ee5b8fa65effbd912 100644 (file)
@@ -1,3 +1,13 @@
+2016-04-29  David Edelsohn  <dje.gcc@gmail.com>
+
+       PR target/69810
+       * config/rs6000/rs6000.md (EXTQI): Don't allow extension to HImode.
+       (zero_extendqi<mode>2_dot): Revert earlier conversion from
+       define_insn_and_split to define_insn.
+       (zero_extendqi<mode>2_dot2): Same.
+       (extendqi<mode>2_dot): Same.
+       (extendqi<mode>2_dot2): Same.
+
 2016-04-29  Uros Bizjak  <ubizjak@gmail.com>
 
        * config/i386/i386.md (unspec): Add UNSPEC_PROBE_STACK.
index 849b19a7b0b0c834d9cc571fa7d101b654ca8c77..5566185076a16cdc748f4cbd798a6b5fda01b4a4 100644 (file)
 (define_mode_iterator INT1 [QI HI SI (DI "TARGET_POWERPC64")])
 
 ; Everything we can extend QImode to.
-(define_mode_iterator EXTQI [HI SI (DI "TARGET_POWERPC64")])
+(define_mode_iterator EXTQI [SI (DI "TARGET_POWERPC64")])
 
 ; Everything we can extend HImode to.
 (define_mode_iterator EXTHI [SI (DI "TARGET_POWERPC64")])
    rlwinm %0,%1,0,0xff"
   [(set_attr "type" "load,shift")])
 
-(define_insn "*zero_extendqi<mode>2_dot"
+(define_insn_and_split "*zero_extendqi<mode>2_dot"
   [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
        (compare:CC (zero_extend:EXTQI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
                    (const_int 0)))
   "rs6000_gen_cell_microcode"
   "@
    andi. %0,%1,0xff
-   rlwinm %0,%1,0,0xff\;cmpwi %2,%0,0"
+   #"
+  "&& reload_completed && cc_reg_not_cr0_operand (operands[2], CCmode)"
+  [(set (match_dup 0)
+       (zero_extend:EXTQI (match_dup 1)))
+   (set (match_dup 2)
+       (compare:CC (match_dup 0)
+                   (const_int 0)))]
+  ""
   [(set_attr "type" "logical")
    (set_attr "dot" "yes")
    (set_attr "length" "4,8")])
 
-(define_insn "*zero_extendqi<mode>2_dot2"
+(define_insn_and_split "*zero_extendqi<mode>2_dot2"
   [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
        (compare:CC (zero_extend:EXTQI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
                    (const_int 0)))
   "rs6000_gen_cell_microcode"
   "@
    andi. %0,%1,0xff
-   rlwinm %0,%1,0,0xff\;cmpwi %2,%0,0"
+   #"
+  "&& reload_completed && cc_reg_not_cr0_operand (operands[2], CCmode)"
+  [(set (match_dup 0)
+       (zero_extend:EXTQI (match_dup 1)))
+   (set (match_dup 2)
+       (compare:CC (match_dup 0)
+                   (const_int 0)))]
+  ""
   [(set_attr "type" "logical")
    (set_attr "dot" "yes")
    (set_attr "length" "4,8")])
   "extsb %0,%1"
   [(set_attr "type" "exts")])
 
-(define_insn "*extendqi<mode>2_dot"
+(define_insn_and_split "*extendqi<mode>2_dot"
   [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
        (compare:CC (sign_extend:EXTQI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
                    (const_int 0)))
   "rs6000_gen_cell_microcode"
   "@
    extsb. %0,%1
-   extsb %0,%1\;cmpwi %2,%0,0"
+   #"
+  "&& reload_completed && cc_reg_not_cr0_operand (operands[2], CCmode)"
+  [(set (match_dup 0)
+       (sign_extend:EXTQI (match_dup 1)))
+   (set (match_dup 2)
+       (compare:CC (match_dup 0)
+                   (const_int 0)))]
+  ""
   [(set_attr "type" "exts")
    (set_attr "dot" "yes")
    (set_attr "length" "4,8")])
 
-(define_insn "*extendqi<mode>2_dot2"
+(define_insn_and_split "*extendqi<mode>2_dot2"
   [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
        (compare:CC (sign_extend:EXTQI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
                    (const_int 0)))
   "rs6000_gen_cell_microcode"
   "@
    extsb. %0,%1
-   extsb %0,%1\;cmpwi %2,%0,0"
+   #"
+  "&& reload_completed && cc_reg_not_cr0_operand (operands[2], CCmode)"
+  [(set (match_dup 0)
+       (sign_extend:EXTQI (match_dup 1)))
+   (set (match_dup 2)
+       (compare:CC (match_dup 0)
+                   (const_int 0)))]
+  ""
   [(set_attr "type" "exts")
    (set_attr "dot" "yes")
    (set_attr "length" "4,8")])