Commit 0fc48de6 by Richard Stallman

(divhisi3, udivhisi3, modhisi3, umodhi3): Comment out.

(divhisi3, udivhisi3, modhisi3, umodhi3 recognizers): Comment out.

From-SVN: r5963
parent 3564e40e
...@@ -2715,35 +2715,39 @@ ...@@ -2715,35 +2715,39 @@
#endif #endif
}") }")
(define_insn "divhisi3" ;; These patterns don't work because the divs instruction is undefined if
[(set (match_operand:HI 0 "general_operand" "=d") ;; the quotient is more than 16 bits. This valid C would be miscompiled:
(truncate:HI ;; int n; short d; unsigned short q; ... q = (unsigned int) (n / d);
(div:SI ;; Imagine what happens when n = 100000 and d = 1.
(match_operand:SI 1 "general_operand" "0") ;;(define_insn "divhisi3"
(sign_extend:SI (match_operand:HI 2 "nonimmediate_operand" "dm")))))] ;; [(set (match_operand:HI 0 "general_operand" "=d")
"" ;; (truncate:HI
"* ;; (div:SI
{ ;; (match_operand:SI 1 "general_operand" "0")
#ifdef MOTOROLA ;; (sign_extend:SI (match_operand:HI 2 "nonimmediate_operand" "dm")))))]
return \"divs%.w %2,%0\"; ;; ""
#else ;; "*
return \"divs %2,%0\"; ;;{
#endif ;;#ifdef MOTOROLA
}") ;; return \"divs%.w %2,%0\";
;;#else
(define_insn "" ;; return \"divs %2,%0\";
[(set (match_operand:HI 0 "general_operand" "=d") ;;#endif
(truncate:HI (div:SI (match_operand:SI 1 "general_operand" "0") ;;}")
(match_operand:SI 2 "const_int_operand" "n"))))]
"" ;;(define_insn ""
"* ;; [(set (match_operand:HI 0 "general_operand" "=d")
{ ;; (truncate:HI (div:SI (match_operand:SI 1 "general_operand" "0")
#ifdef MOTOROLA ;; (match_operand:SI 2 "const_int_operand" "n"))))]
return \"divs%.w %2,%0\"; ;; ""
#else ;; "*
return \"divs %2,%0\"; ;;{
#endif ;;#ifdef MOTOROLA
}") ;; return \"divs%.w %2,%0\";
;;#else
;; return \"divs %2,%0\";
;;#endif
;;}")
(define_insn "udivhi3" (define_insn "udivhi3"
[(set (match_operand:HI 0 "general_operand" "=d") [(set (match_operand:HI 0 "general_operand" "=d")
...@@ -2759,35 +2763,36 @@ ...@@ -2759,35 +2763,36 @@
#endif #endif
}") }")
(define_insn "udivhisi3" ;; See comment before divhisi3 why these are commented out.
[(set (match_operand:HI 0 "general_operand" "=d") ;;(define_insn "udivhisi3"
(truncate:HI ;; [(set (match_operand:HI 0 "general_operand" "=d")
(udiv:SI ;; (truncate:HI
(match_operand:SI 1 "general_operand" "0") ;; (udiv:SI
(zero_extend:SI (match_operand:HI 2 "nonimmediate_operand" "dm")))))] ;; (match_operand:SI 1 "general_operand" "0")
"" ;; (zero_extend:SI (match_operand:HI 2 "nonimmediate_operand" "dm")))))]
"* ;; ""
{ ;; "*
#ifdef MOTOROLA ;;{
return \"divu%.w %2,%0\"; ;;#ifdef MOTOROLA
#else ;; return \"divu%.w %2,%0\";
return \"divu %2,%0\"; ;;#else
#endif ;; return \"divu %2,%0\";
}") ;;#endif
;;}")
(define_insn ""
[(set (match_operand:HI 0 "general_operand" "=d") ;;(define_insn ""
(truncate:HI (udiv:SI (match_operand:SI 1 "general_operand" "0") ;; [(set (match_operand:HI 0 "general_operand" "=d")
(match_operand:SI 2 "const_int_operand" "n"))))] ;; (truncate:HI (udiv:SI (match_operand:SI 1 "general_operand" "0")
"" ;; (match_operand:SI 2 "const_int_operand" "n"))))]
"* ;; ""
{ ;; "*
#ifdef MOTOROLA ;;{
return \"divu%.w %2,%0\"; ;;#ifdef MOTOROLA
#else ;; return \"divu%.w %2,%0\";
return \"divu %2,%0\"; ;;#else
#endif ;; return \"divu %2,%0\";
}") ;;#endif
;;}")
(define_expand "divdf3" (define_expand "divdf3"
[(set (match_operand:DF 0 "general_operand" "") [(set (match_operand:DF 0 "general_operand" "")
...@@ -2888,39 +2893,40 @@ ...@@ -2888,39 +2893,40 @@
#endif #endif
}") }")
(define_insn "modhisi3" ;; See comment before divhisi3 why these are commented out.
[(set (match_operand:HI 0 "general_operand" "=d") ;;(define_insn "modhisi3"
(truncate:HI ;; [(set (match_operand:HI 0 "general_operand" "=d")
(mod:SI ;; (truncate:HI
(match_operand:SI 1 "general_operand" "0") ;; (mod:SI
(sign_extend:SI (match_operand:HI 2 "nonimmediate_operand" "dm")))))] ;; (match_operand:SI 1 "general_operand" "0")
"" ;; (sign_extend:SI (match_operand:HI 2 "nonimmediate_operand" "dm")))))]
"* ;; ""
{ ;; "*
/* The swap insn produces cc's that don't correspond to the result. */ ;;{
CC_STATUS_INIT; ;; /* The swap insn produces cc's that don't correspond to the result. */
#ifdef MOTOROLA ;; CC_STATUS_INIT;
return \"divs%.w %2,%0\;swap %0\"; ;;#ifdef MOTOROLA
#else ;; return \"divs%.w %2,%0\;swap %0\";
return \"divs %2,%0\;swap %0\"; ;;#else
#endif ;; return \"divs %2,%0\;swap %0\";
}") ;;#endif
;;}")
(define_insn ""
[(set (match_operand:HI 0 "general_operand" "=d") ;;(define_insn ""
(truncate:HI (mod:SI (match_operand:SI 1 "general_operand" "0") ;; [(set (match_operand:HI 0 "general_operand" "=d")
(match_operand:SI 2 "const_int_operand" "n"))))] ;; (truncate:HI (mod:SI (match_operand:SI 1 "general_operand" "0")
"" ;; (match_operand:SI 2 "const_int_operand" "n"))))]
"* ;; ""
{ ;; "*
/* The swap insn produces cc's that don't correspond to the result. */ ;;{
CC_STATUS_INIT; ;; /* The swap insn produces cc's that don't correspond to the result. */
#ifdef MOTOROLA ;; CC_STATUS_INIT;
return \"divs%.w %2,%0\;swap %0\"; ;;#ifdef MOTOROLA
#else ;; return \"divs%.w %2,%0\;swap %0\";
return \"divs %2,%0\;swap %0\"; ;;#else
#endif ;; return \"divs %2,%0\;swap %0\";
}") ;;#endif
;;}")
(define_insn "umodhi3" (define_insn "umodhi3"
[(set (match_operand:HI 0 "general_operand" "=d") [(set (match_operand:HI 0 "general_operand" "=d")
...@@ -2938,39 +2944,40 @@ ...@@ -2938,39 +2944,40 @@
#endif #endif
}") }")
(define_insn "umodhisi3" ;; See comment before divhisi3 why these are commented out.
[(set (match_operand:HI 0 "general_operand" "=d") ;;(define_insn "umodhisi3"
(truncate:HI ;; [(set (match_operand:HI 0 "general_operand" "=d")
(umod:SI ;; (truncate:HI
(match_operand:SI 1 "general_operand" "0") ;; (umod:SI
(zero_extend:SI (match_operand:HI 2 "nonimmediate_operand" "dm")))))] ;; (match_operand:SI 1 "general_operand" "0")
"" ;; (zero_extend:SI (match_operand:HI 2 "nonimmediate_operand" "dm")))))]
"* ;; ""
{ ;; "*
/* The swap insn produces cc's that don't correspond to the result. */ ;;{
CC_STATUS_INIT; ;; /* The swap insn produces cc's that don't correspond to the result. */
#ifdef MOTOROLA ;; CC_STATUS_INIT;
return \"divu%.w %2,%0\;swap %0\"; ;;#ifdef MOTOROLA
#else ;; return \"divu%.w %2,%0\;swap %0\";
return \"divu %2,%0\;swap %0\"; ;;#else
#endif ;; return \"divu %2,%0\;swap %0\";
}") ;;#endif
;;}")
(define_insn ""
[(set (match_operand:HI 0 "general_operand" "=d") ;;(define_insn ""
(truncate:HI (umod:SI (match_operand:SI 1 "general_operand" "0") ;; [(set (match_operand:HI 0 "general_operand" "=d")
(match_operand:SI 2 "const_int_operand" "n"))))] ;; (truncate:HI (umod:SI (match_operand:SI 1 "general_operand" "0")
"" ;; (match_operand:SI 2 "const_int_operand" "n"))))]
"* ;; ""
{ ;; "*
/* The swap insn produces cc's that don't correspond to the result. */ ;;{
CC_STATUS_INIT; ;; /* The swap insn produces cc's that don't correspond to the result. */
#ifdef MOTOROLA ;; CC_STATUS_INIT;
return \"divu%.w %2,%0\;swap %0\"; ;;#ifdef MOTOROLA
#else ;; return \"divu%.w %2,%0\;swap %0\";
return \"divu %2,%0\;swap %0\"; ;;#else
#endif ;; return \"divu %2,%0\;swap %0\";
}") ;;#endif
;;}")
(define_insn "divmodsi4" (define_insn "divmodsi4"
[(set (match_operand:SI 0 "general_operand" "=d") [(set (match_operand:SI 0 "general_operand" "=d")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment