summaryrefslogtreecommitdiff
path: root/gcc/optabs.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r--gcc/optabs.c43
1 files changed, 42 insertions, 1 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 7f3cc9d9f55..d3bd54abd99 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -71,6 +71,7 @@ optab neg_optab;
optab abs_optab;
optab one_cmpl_optab;
optab ffs_optab;
+optab sqrt_optab;
optab cmp_optab;
optab ucmp_optab; /* Used only for libcalls for unsigned comparisons. */
@@ -1183,7 +1184,7 @@ emit_unop_insn (icode, target, op0, code)
/* Emit code to perform a series of operations on a multi-word quantity, one
word at a time.
- Such a block is preceeded by a CLOBBER of the output, consists of multiple
+ Such a block is preceded by a CLOBBER of the output, consists of multiple
insns, each setting one word of the output, and followed by a SET copying
the output to itself.
@@ -2829,6 +2830,7 @@ init_optabs ()
abs_optab = init_optab (ABS);
one_cmpl_optab = init_optab (NOT);
ffs_optab = init_optab (FFS);
+ sqrt_optab = init_optab (SQRT);
#ifdef HAVE_addqi3
if (HAVE_addqi3)
@@ -3675,6 +3677,45 @@ init_optabs ()
/* No library calls here! If there is no abs instruction,
expand_expr will generate a conditional negation. */
+#ifdef HAVE_sqrtqi2
+ if (HAVE_sqrtqi2)
+ sqrt_optab->handlers[(int) QImode].insn_code = CODE_FOR_sqrtqi2;
+#endif
+#ifdef HAVE_sqrthi2
+ if (HAVE_sqrthi2)
+ sqrt_optab->handlers[(int) HImode].insn_code = CODE_FOR_sqrthi2;
+#endif
+#ifdef HAVE_sqrtpsi2
+ if (HAVE_sqrtpsi2)
+ sqrt_optab->handlers[(int) PSImode].insn_code = CODE_FOR_sqrtpsi2;
+#endif
+#ifdef HAVE_sqrtsi2
+ if (HAVE_sqrtsi2)
+ sqrt_optab->handlers[(int) SImode].insn_code = CODE_FOR_sqrtsi2;
+#endif
+#ifdef HAVE_sqrtdi2
+ if (HAVE_sqrtdi2)
+ sqrt_optab->handlers[(int) DImode].insn_code = CODE_FOR_sqrtdi2;
+#endif
+#ifdef HAVE_sqrtti2
+ if (HAVE_sqrtti2)
+ sqrt_optab->handlers[(int) TImode].insn_code = CODE_FOR_sqrtti2;
+#endif
+#ifdef HAVE_sqrtsf2
+ if (HAVE_sqrtsf2)
+ sqrt_optab->handlers[(int) SFmode].insn_code = CODE_FOR_sqrtsf2;
+#endif
+#ifdef HAVE_sqrtdf2
+ if (HAVE_sqrtdf2)
+ sqrt_optab->handlers[(int) DFmode].insn_code = CODE_FOR_sqrtdf2;
+#endif
+#ifdef HAVE_sqrttf2
+ if (HAVE_sqrttf2)
+ sqrt_optab->handlers[(int) TFmode].insn_code = CODE_FOR_sqrttf2;
+#endif
+ /* No library calls here! If there is no sqrt instruction expand_builtin
+ should force the library call. */
+
#ifdef HAVE_one_cmplqi2
if (HAVE_one_cmplqi2)
one_cmpl_optab->handlers[(int) QImode].insn_code = CODE_FOR_one_cmplqi2;