public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dmalcolm at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug jit/64020] jit misses sin/cos optimizations
Date: Mon, 01 Dec 2014 18:24:00 -0000	[thread overview]
Message-ID: <bug-64020-4-yiz6sAC7xc@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-64020-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64020

--- Comment #6 from dmalcolm at gcc dot gnu.org ---
Author: dmalcolm
Date: Mon Dec  1 18:23:37 2014
New Revision: 218240

URL: https://gcc.gnu.org/viewcvs?rev=218240&root=gcc&view=rev
Log:
PR jit/64020: Fixes to handling of builtins

    PR jit/64020
    * docs/topics/types.rst (Standard types) Add new enum values to
    the table of enum gcc_jit_types: GCC_JIT_TYPE_COMPLEX_FLOAT,
    GCC_JIT_TYPE_COMPLEX_DOUBLE, GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
    Widen the left-hand column so that
    GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE will fit.
    * docs/_build/texinfo/libgccjit.texi: Regenerate.

    * jit-builtins.c: Include stringpool.h and jit-playback.h.
    Move everything out of the gcc::jit::recording namespace into
    just gcc::jit.
    (struct builtin_data): Add fields "fnclass", "attr", and
    "implicit_p".
    (DEF_BUILTIN): Update macro so populate the new fields.
    (builtins_manager::builtins_manager): Update for move out of
    recording namespace.  Initialize the m_attributes array.
    (builtins_manager::get_builtin_function): Likewise.
    (builtins_manager::get_builtin_function_by_id): New function.
    (builtins_manager::make_builtin_function): Update for move out of
    recording namespace.  Add fix for PR jit/64020 by detecting
    specific builtin ids and having them ensure that builtins for
    other ids are created as necessary.
    (builtins_manager::get_type): Update for move out of recording
    namespace.
    (builtins_manager::make_type): Likewise.  Add some missing
    #undefs.
    (builtins_manager::make_primitive_type): Update for move out of
    recording namespace.  Implement the three BT_COMPLEX_ cases and
    BT_DOUBLE_PTR.
    (builtins_manager::make_fn_type): Update for move out of recording
    namespace.
    (builtins_manager::make_ptr_type): Likewise.
    (builtins_manager::finish_playback): New function.
    (builtins_manager::get_class): New function.
    (builtins_manager::implicit_p): New function.
    (builtins_manager::get_attrs_tree): Two new functions.
    (builtins_manager::make_attrs_tree): New function.

    * jit-builtins.h: Move everything out of the gcc::jit::recording
    namespace into just gcc::jit.
    (enum built_in_attribute): New.
    (builtins_manager::builtins_manager): Update decl for namespace
    change.
    (builtins_manager::get_builtin_function): Likewise.
    (builtins_manager::get_class): New.
    (builtins_manager::implicit_p): New.
    (builtins_manager::get_attrs_tree): Two new functions.
    (builtins_manager::make_attrs_tree): New function.
    (builtins_manager::finish_playback): New.
    (builtins_manager::get_builtin_function_by_id): New.
    (builtins_manager::make_builtin_function): Update decl for
    namespace change.
    (builtins_manager::get_type): Likewise.
    (builtins_manager::make_type): Likewise.
    (builtins_manager::make_primitive_type): Likewise.
    (builtins_manager::make_fn_type): Likewise.
    (builtins_manager::make_ptr_type): Likewise.
    (builtins_manager): Likewise for fields.  Add new field
    "m_attributes".

    * jit-common.h (NUM_GCC_JIT_TYPES): Update.
    (builtins_manager): Update forward decl to reflect namespace
    change.

    * jit-playback.c: Include attribs.h and jit-builtins.h.
    (gcc::jit::playback::context::get_tree_node_for_type): Add cases
    for the new COMPLEX_ types.
    (gcc::jit::playback::context::new_function): If creating a
    builtin, set the DECL_BUILT_IN_CLASS and attributes on the fndecl,
    and call set_builtin_decl.
    (gcc::jit::playback::context::replay): If we have a
    builtins_manager, call its finish_playback method when we're done.

    * jit-playback.h:
    (gcc::jit::playback::context::get_builtins_manager): New function.

    * jit-recording.c
    (gcc::jit::recording::context::get_builtins_manager): New function.
    (gcc::jit::recording::get_builtin_function): Use
    get_builtins_manager, in case we're a child context.
    (gcc::jit::recording::memento_of_get_type::dereference): Add the
    COMPLEX_ types.
    (gcc::jit::recording::memento_of_get_type::is_int): Likewise.
    (gcc::jit::recording::memento_of_get_type::is_float): Likewise.
    (gcc::jit::recording::memento_of_get_type::is_bool): Likewise.
    (get_type_strings): Likewise.

    * jit-recording.h
    (gcc::jit::recording::context::get_builtins_manager): New.

    * libgccjit.h (enum gcc_jit_types): Add
    GCC_JIT_TYPE_COMPLEX_FLOAT, GCC_JIT_TYPE_COMPLEX_DOUBLE,
    GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.


Modified:
    trunk/gcc/jit/ChangeLog
    trunk/gcc/jit/docs/_build/texinfo/libgccjit.texi
    trunk/gcc/jit/docs/topics/types.rst
    trunk/gcc/jit/jit-builtins.c
    trunk/gcc/jit/jit-builtins.h
    trunk/gcc/jit/jit-common.h
    trunk/gcc/jit/jit-playback.c
    trunk/gcc/jit/jit-playback.h
    trunk/gcc/jit/jit-recording.c
    trunk/gcc/jit/jit-recording.h
    trunk/gcc/jit/libgccjit.h


  parent reply	other threads:[~2014-12-01 18:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-21 19:27 [Bug jit/64020] New: " dmalcolm at gcc dot gnu.org
2014-11-21 23:02 ` [Bug jit/64020] " dmalcolm at gcc dot gnu.org
2014-11-24 11:45 ` dmalcolm at gcc dot gnu.org
2014-11-24 23:05 ` joseph at codesourcery dot com
2014-11-25 19:41 ` dmalcolm at gcc dot gnu.org
2014-11-26  2:05 ` dmalcolm at gcc dot gnu.org
2014-12-01 18:24 ` dmalcolm at gcc dot gnu.org [this message]
2014-12-01 18:28 ` dmalcolm at gcc dot gnu.org
2014-12-03 14:56 ` dmalcolm at gcc dot gnu.org
2014-12-09 15:36 ` dmalcolm at gcc dot gnu.org
2014-12-09 15:39 ` dmalcolm at gcc dot gnu.org
2014-12-09 15:40 ` dmalcolm at gcc dot gnu.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=bug-64020-4-yiz6sAC7xc@http.gcc.gnu.org/bugzilla/ \
    --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: link
Be 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).