public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/30038] Call to sin(x), cos(x) should be transformed to sincos(x) Date: Wed, 06 Dec 2006 09:53:00 -0000 [thread overview] Message-ID: <20061206095250.18504.qmail@sourceware.org> (raw) In-Reply-To: <bug-30038-13404@http.gcc.gnu.org/bugzilla/> ------- Comment #7 from rguenth at gcc dot gnu dot org 2006-12-06 09:52 ------- Ok, so my plan is to go in small steps: - at gimplification time change calls to sincos (x, &s, &c) to calls to cexp like _Complex __typeof__(s) tmp = cexp ( { 0., x } ); s = __imag tmp; c = __real tmp; - at expansion time, transform the above back to a call to sincos. This relies on TER to make the argument of form { 0., x } visible to the expander. Alternatively do this back-transformation before going out-of-ssa. 2nd alternatively create a new (internal) builtin cexpi that takes the imaginary part of the argument only, i.e. cexpi (x) would be sincos. This at least would simplify the code. The above two should fix PR17687 on the tree level and on the rtl level where the target provides either a sane ABI to the sincos function (or an alternative) or a machine instruction (like fsincos). - inside PRE recognize sin and cos and do insertion of cexp if necessary. If we do it in the "hackish" way, simply transform sin and cos to cexp before PRE and transform back cexp to sin or cos if only the real or imaginary parts of the result is used after PRE. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30038
next prev parent reply other threads:[~2006-12-06 9:53 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top 2006-12-01 10:06 [Bug tree-optimization/30038] New: " burnus at gcc dot gnu dot org 2006-12-01 10:15 ` [Bug tree-optimization/30038] " ubizjak at gmail dot com 2006-12-01 10:57 ` bonzini at gnu dot org 2006-12-01 11:04 ` bonzini at gnu dot org 2006-12-01 16:01 ` rguenth at gcc dot gnu dot org 2006-12-01 16:03 ` rguenth at gcc dot gnu dot org 2006-12-01 18:05 ` burnus at gcc dot gnu dot org 2006-12-06 9:53 ` rguenth at gcc dot gnu dot org [this message] 2006-12-07 16:07 ` rguenth at gcc dot gnu dot org 2006-12-07 16:07 ` rguenth at gcc dot gnu dot org 2006-12-07 20:01 ` burnus at gcc dot gnu dot org 2006-12-07 20:19 ` dorit at il dot ibm dot com 2006-12-07 20:32 ` burnus at gcc dot gnu dot org 2006-12-07 20:36 ` burnus at gcc dot gnu dot org 2006-12-07 20:48 ` rguenth at gcc dot gnu dot org 2006-12-07 20:50 ` rguenth at gcc dot gnu dot org 2006-12-12 20:59 ` dorit at il dot ibm dot com 2006-12-17 23:19 ` burnus at gcc dot gnu dot org 2007-01-22 11:11 ` rguenth at gcc dot gnu dot org 2007-01-22 11:12 ` rguenth at gcc dot gnu dot org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20061206095250.18504.qmail@sourceware.org \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).