i86: merge changes from hpa's tree
authorDaniel Verkamp <daniel.verkamp@gmail.com>
Thu, 16 Aug 2007 17:55:10 +0000 (13:55 -0400)
committerDaniel Verkamp <daniel.verkamp@gmail.com>
Thu, 16 Aug 2007 17:55:10 +0000 (13:55 -0400)
gcc/config/i86/i86.md

index 6680612..02810e4 100644 (file)
   )
 
 
+(define_insn "bswaphi2"
+  [(set (match_operand:HI 0 "register_operand" "=q")
+       (bswap:HI (match_operand:HI 1 "register_operand" "0")))]
+  ""
+  "xchg        %H0,%L0"
+  )
+
+(define_insn "bswapsi2"
+  [(set (match_operand:SI 0 "register_operand" "=q")
+       (bswap:SI (match_operand:SI 1 "register_operand" "0")))]
+  ""
+  "bswap       %0"
+  )
+
 ;;
 ;; shifts and rotations
 ;;
 
 (define_insn "ashlqi3"
-  [(set (match_operand:QI 0 "nonimmediate_operand" "=rm,rm")
-       (ashift:QI (match_operand:QI 1 "general_operand" "0,0")
-                  (match_operand:QI 2 "general_operand" "I,c")))]
+  [(set (match_operand:QI 0 "nonimmediate_operand" "=rm")
+       (ashift:QI (match_operand:QI 1 "general_operand" "0")
+                  (match_operand:QI 2 "general_operand" "Ic")))]
   ""
   "sal %0,%2"
   )
   "shl %0,%2"
   )
 
-(define_insn "ashrhi3"
-  [(set (match_operand:HI 0 "nonimmediate_operand" "=rm")
-       (ashiftrt:HI (match_operand:HI 1 "nonimmediate_operand" "0")
-                    (match_operand:QI 2 "nonmemory_operand" "Ic")))]
-  ""
-  "sar %0,%2"
-  )
-
-(define_insn "lshrhi3"
-  [(set (match_operand:HI 0 "nonimmediate_operand" "=rm")
-       (lshiftrt:HI (match_operand:HI 1 "nonimmediate_operand" "0")
-                    (match_operand:QI 2 "nonmemory_operand" "Ic")))]
-  ""
-  "shr %0,%2"
-  )
-
-(define_insn "rotlhi3"
-  [(set (match_operand:HI 0 "nonimmediate_operand" "=rm")
-       (rotate:HI (match_operand:HI 1 "nonimmediate_operand" "0")
-                  (match_operand:QI 2 "nonmemory_operand" "Ic")))]
-  ""
-  "rol %0,%2"
-  )
-
-(define_insn "rotrhi3"
-  [(set (match_operand:HI 0 "nonimmediate_operand" "=rm")
-       (rotatert:HI (match_operand:HI 1 "nonimmediate_operand" "0")
-                    (match_operand:QI 2 "nonmemory_operand" "Ic")))]
-  ""
-  "ror %0,%2"
-  )
-
-(define_insn "bswaphi2"
-  [(set (match_operand:HI 0 "register_operand" "=q")
-       (bswap:HI (match_operand:HI 1 "register_operand" "0")))]
-  ""
-  "xchg        %H0,%L0"
-  )
-
 (define_insn "ashlsi3"
-  [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,rm")
-       (ashift:SI (match_operand:SI 1 "general_operand" "0,0")
-                  (match_operand:QI 2 "general_operand" "I,c")))]
+  [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
+       (ashift:SI (match_operand:SI 1 "general_operand" "0")
+                  (match_operand:QI 2 "general_operand" "Ic")))]
   ""
   "sal %0,%2"
   )
 
 
 (define_insn "ashrqi3"
-  [(set (match_operand:QI 0 "nonimmediate_operand" "=rm,rm")
-       (ashiftrt:QI (match_operand:QI 1 "general_operand" "0,0")
-                  (match_operand:QI 2 "general_operand" "I,c")))]
+  [(set (match_operand:QI 0 "nonimmediate_operand" "=rm")
+       (ashiftrt:QI (match_operand:QI 1 "general_operand" "0")
+                  (match_operand:QI 2 "general_operand" "Ic")))]
   ""
   "sar %0,%2"
   )
 
 (define_insn "ashrhi3"
-  [(set (match_operand:HI 0 "nonimmediate_operand" "=rm,rm")
-       (ashiftrt:HI (match_operand:HI 1 "general_operand" "0,0")
-                  (match_operand:QI 2 "general_operand" "I,c")))]
+  [(set (match_operand:HI 0 "nonimmediate_operand" "=rm")
+       (ashiftrt:HI (match_operand:HI 1 "general_operand" "0")
+                  (match_operand:QI 2 "general_operand" "Ic")))]
   ""
   "sar %0,%2"
   )
 
 (define_insn "ashrsi3"
-  [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,rm")
-       (ashiftrt:SI (match_operand:SI 1 "general_operand" "0,0")
-                  (match_operand:QI 2 "general_operand" "I,c")))]
+  [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
+       (ashiftrt:SI (match_operand:SI 1 "general_operand" "0")
+                  (match_operand:QI 2 "general_operand" "Ic")))]
   ""
   "sar %0,%2"
   )
 
 
 (define_insn "lshrqi3"
-  [(set (match_operand:QI 0 "nonimmediate_operand" "=rm,rm")
-       (lshiftrt:QI (match_operand:QI 1 "general_operand" "0,0")
-                  (match_operand:QI 2 "general_operand" "I,c")))]
+  [(set (match_operand:QI 0 "nonimmediate_operand" "=rm")
+       (lshiftrt:QI (match_operand:QI 1 "general_operand" "0")
+                  (match_operand:QI 2 "general_operand" "Ic")))]
   ""
   "shr %0,%2"
   )
 
 (define_insn "lshrhi3"
-  [(set (match_operand:HI 0 "nonimmediate_operand" "=rm,rm")
-       (lshiftrt:HI (match_operand:HI 1 "general_operand" "0,0")
-                  (match_operand:QI 2 "general_operand" "I,c")))]
+  [(set (match_operand:HI 0 "nonimmediate_operand" "=rm")
+       (lshiftrt:HI (match_operand:HI 1 "general_operand" "0")
+                  (match_operand:QI 2 "general_operand" "Ic")))]
   ""
   "shr %0,%2"
   )
 
 (define_insn "lshrsi3"
-  [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,rm")
-       (lshiftrt:SI (match_operand:SI 1 "general_operand" "0,0")
-                  (match_operand:QI 2 "general_operand" "I,c")))]
+  [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
+       (lshiftrt:SI (match_operand:SI 1 "general_operand" "0")
+                  (match_operand:QI 2 "general_operand" "Ic")))]
   ""
   "shr %0,%2"
   )
 
 
 (define_insn "rotlqi3"
-  [(set (match_operand:QI 0 "nonimmediate_operand" "=rm,rm")
-       (rotate:QI (match_operand:QI 1 "general_operand" "0,0")
-                  (match_operand:QI 2 "general_operand" "I,c")))]
+  [(set (match_operand:QI 0 "nonimmediate_operand" "=rm")
+       (rotate:QI (match_operand:QI 1 "general_operand" "0")
+                  (match_operand:QI 2 "general_operand" "Ic")))]
   ""
   "rol %0,%2"
   )
 
 (define_insn "rotlhi3"
-  [(set (match_operand:HI 0 "nonimmediate_operand" "=rm,rm")
-       (rotate:HI (match_operand:HI 1 "general_operand" "0,0")
-                  (match_operand:QI 2 "general_operand" "I,c")))]
+  [(set (match_operand:HI 0 "nonimmediate_operand" "=rm")
+       (rotate:HI (match_operand:HI 1 "general_operand" "0")
+                  (match_operand:QI 2 "general_operand" "Ic")))]
   ""
   "rol %0,%2"
   )
 
 (define_insn "rotlsi3"
-  [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,rm")
-       (rotate:SI (match_operand:SI 1 "general_operand" "0,0")
-                  (match_operand:QI 2 "general_operand" "I,c")))]
+  [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
+       (rotate:SI (match_operand:SI 1 "general_operand" "0")
+                  (match_operand:QI 2 "general_operand" "Ic")))]
   ""
   "rol %0,%2"
   )
 
 
 (define_insn "rotrqi3"
-  [(set (match_operand:QI 0 "nonimmediate_operand" "=rm,rm")
-       (rotatert:QI (match_operand:QI 1 "general_operand" "0,0")
-                  (match_operand:QI 2 "general_operand" "I,c")))]
+  [(set (match_operand:QI 0 "nonimmediate_operand" "=rm")
+       (rotatert:QI (match_operand:QI 1 "general_operand" "0")
+                  (match_operand:QI 2 "general_operand" "Ic")))]
   ""
   "ror %0,%2"
   )
 
 (define_insn "rotrhi3"
-  [(set (match_operand:HI 0 "nonimmediate_operand" "=rm,rm")
-       (rotatert:HI (match_operand:HI 1 "general_operand" "0,0")
-                  (match_operand:QI 2 "general_operand" "I,c")))]
+  [(set (match_operand:HI 0 "nonimmediate_operand" "=rm")
+       (rotatert:HI (match_operand:HI 1 "general_operand" "0")
+                  (match_operand:QI 2 "general_operand" "Ic")))]
   ""
   "ror %0,%2"
   )
 
 (define_insn "rotrsi3"
-  [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,rm")
-       (rotatert:SI (match_operand:SI 1 "general_operand" "0,0")
-                  (match_operand:QI 2 "general_operand" "I,c")))]
+  [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
+       (rotatert:SI (match_operand:SI 1 "general_operand" "0")
+                  (match_operand:QI 2 "general_operand" "Ic")))]
   ""
   "ror %0,%2"
   )