libgccjit: Add _Float16, _Float32, _Float64 and __float128 support for jit #82

Closed
antoyo wants to merge 1 commit from antoyo/gcc:feature/sized_float into trunk
Member
gcc/jit/ChangeLog:

	* docs/topics/types.rst: Document new types.
	* dummy-frontend.cc: Support new types in tree_type_to_jit_type.
	* jit-common.h: Update NUM_GCC_JIT_TYPES.
	* jit-playback.cc: Support new types in get_tree_node_for_type.
	* jit-recording.cc: Support new types.
	* libgccjit.h (gcc_jit_types): Add new types.

gcc/testsuite/ChangeLog:

	* jit.dg/test-types.c: Test new types.
  • Add the types like GCC_JIT_TYPE_FLOAT16 as supported. (DONE in #108).

CC: David Malcolm dmalcolm@redhat.com, jit@gcc.gnu.org

``` gcc/jit/ChangeLog: * docs/topics/types.rst: Document new types. * dummy-frontend.cc: Support new types in tree_type_to_jit_type. * jit-common.h: Update NUM_GCC_JIT_TYPES. * jit-playback.cc: Support new types in get_tree_node_for_type. * jit-recording.cc: Support new types. * libgccjit.h (gcc_jit_types): Add new types. gcc/testsuite/ChangeLog: * jit.dg/test-types.c: Test new types. ``` * [x] Add the types like GCC_JIT_TYPE_FLOAT16 as supported. (DONE in #108). CC: David Malcolm <dmalcolm@redhat.com>, <jit@gcc.gnu.org>
gcc/jit/ChangeLog:

	* docs/topics/types.rst: Document new types.
	* dummy-frontend.cc: Support new types in tree_type_to_jit_type.
	* jit-common.h: Update NUM_GCC_JIT_TYPES.
	* jit-playback.cc: Support new types in get_tree_node_for_type.
	* jit-recording.cc: Support new types.
	* libgccjit.h (gcc_jit_types): Add new types.

gcc/testsuite/ChangeLog:

	* jit.dg/test-types.c: Test new types.
Member

Welcome to Sourceware Forge

Hi @antoyo, and thanks for your PR. This bot helps you send your patch series to the mailing list.

Please follow these guidelines to ensure a smooth submission.

Writing a Good PR Description

  • If your PR has multiple commits, write a meaningful description. It becomes the cover letter.
  • For a single commit, you can leave the description empty if the commit message is clear.

To CC reviewers, add at the end of your PR description one or more lines like this:

CC: Revi Ewer <revi.ewer@example.com>, Ill Takalook <ill.takalook@example.net>

Avoid copy-pasting a CC list from a previous PR. Doing so may cause failure to send the emails properly.

We recommend reviewing your commit messages carefully before submitting.

This project expects a specific format.
See Submitting Patches for details

Submitting Your Patch

To submit, you must be authorized. Ask any permitted contributor to authorize you by commenting: /allow. This is anyone who has been /allowed before.

Once allowed, comment: /submit

Use /preview to see the emails before sending. (Requires a public forge email.)

Responding to Reviews

Watch for replies on the mailing list. If not subscribed, you can reply by:

  1. Visiting inbox.sourceware.org
  2. Clicking (raw) on the email
  3. Importing it into your mail client

For Gmail:

curl -g --user "<Email>:<Password>" \
  --url "imaps://imap.gmail.com/INBOX" -T /path/to/raw.txt

Updating Your PR

  1. Push new commits, rebase and force push changes to the same branch as needed
  2. Update the PR description with a “Changes since vX” section
  3. Comment again with: /submit

Need help?

Consider joining the gcc and gcc-patches mailing lists..
For real time communication, check the gcc irc channels.

Or join #overseers on Libera Chat, particularly if this automation is not working (stay online to get replies, IRC does not save messages if people are not online).

<!-- pr-welcome --> # Welcome to Sourceware Forge Hi @antoyo, and thanks for your PR. This bot helps you send your patch series to the mailing list. Please follow these guidelines to ensure a smooth submission. ## Writing a Good PR Description - If your PR has **multiple commits**, write a meaningful description. It becomes the cover letter. - For **a single commit**, you can leave the description empty if the commit message is clear. To CC reviewers, add at the end of your PR description one or more lines like this: ```text CC: Revi Ewer <revi.ewer@example.com>, Ill Takalook <ill.takalook@example.net> ``` Avoid copy-pasting a CC list from a previous PR. Doing so may cause failure to send the emails properly. We recommend reviewing your commit messages carefully before submitting. This project expects a specific format. See [Submitting Patches](https://gcc.gnu.org/contribute.html#patches) for details ## Submitting Your Patch To submit, you must be authorized. Ask any permitted contributor to authorize you by commenting: `/allow`. This is anyone who has been `/allow`ed before. Once allowed, comment: `/submit` Use `/preview` to see the emails before sending. (Requires a public forge email.) ## Responding to Reviews Watch for replies on the mailing list. If not subscribed, you can reply by: 1. Visiting [inbox.sourceware.org](https://inbox.sourceware.org) 2. Clicking `(raw)` on the email 3. Importing it into your mail client For Gmail: ```sh curl -g --user "<Email>:<Password>" \ --url "imaps://imap.gmail.com/INBOX" -T /path/to/raw.txt ``` ## Updating Your PR 1. Push new commits, rebase and force push changes to the same branch as needed 2. Update the PR description with a “Changes since vX” section 3. Comment again with: `/submit` ## Need help? Consider joining the [gcc and gcc-patches mailing lists.](https://gcc.gnu.org/lists.html). For real time communication, check the [gcc irc channels](https://gcc.gnu.org/wiki/GCConIRC). Or join [`#overseers`](https://web.libera.chat/#overseers) on Libera Chat, particularly if this automation is not working (stay online to get replies, IRC does not save messages if people are not online).
@ -157,6 +161,29 @@ create_code (gcc_jit_context *ctxt, void *user_data)
gcc_jit_field *field_m_long_double =
CREATE_FIELD (GCC_JIT_TYPE_LONG_DOUBLE, "m_long_double");
gcc_jit_target_info *target_info = gcc_jit_context_get_target_info(ctxt);
Author
Member

This PR also depends on this one for the target_info stuff.

This PR also depends on [this one](https://github.com/antoyo/libgccjit/pull/6) for the `target_info` stuff.
antoyo marked this conversation as resolved
Author
Member

/submit

/submit
Member

Version 1 of this pull request has been stored. It includes the following commits:

  • libgccjit: Add _Float16, _Float32, _Float64 and __float128 support for jit - 7ecd0158db
<!-- pr-new-version --> Version 1 of this pull request has been stored. It includes the following commits: - libgccjit: Add _Float16, _Float32, _Float64 and __float128 support for jit - 7ecd0158db98bfdf4b6971bd875fe84bd6a1a95e
Member

Pull Request versions:

# Base Head
1 95fc85aff1 7ecd0158db (diff)

In order to compare , clone this repository and run

PR=82
git fetch origin "refs/versioned_pull/${PR}/*:refs/versioned_pull/${PR}/*"
PRV1=1
PRV2=2
git range-diff "refs/versioned_pull/${PR}/${PRV1}/base..refs/versioned_pull/${PR}/${PRV1}/head"  "refs/versioned_pull/${PR}/${PRV2}/base..refs/versioned_pull/${PR}/${PRV2}/head"
<!-- pr-versions --> Pull Request versions: | # | Base | Head | | | - | ---- | ---- | - | | 1 | 95fc85aff1c26184d0fe52ea4e9f47064279126a | 7ecd0158db98bfdf4b6971bd875fe84bd6a1a95e | [(diff)](https://forge.sourceware.org/gcc/gcc-TEST.git/compare/95fc85aff1c26184d0fe52ea4e9f47064279126a...7ecd0158db98bfdf4b6971bd875fe84bd6a1a95e) | In order to compare , clone this repository and run ``` PR=82 git fetch origin "refs/versioned_pull/${PR}/*:refs/versioned_pull/${PR}/*" PRV1=1 PRV2=2 git range-diff "refs/versioned_pull/${PR}/${PRV1}/base..refs/versioned_pull/${PR}/${PRV1}/head" "refs/versioned_pull/${PR}/${PRV2}/base..refs/versioned_pull/${PR}/${PRV2}/head" ```
Member

Hi @antoyo ,
it looks like the bot posted the patch correctly but had issues posting the comment pointing at the patch in inbox.
Thank you for trying this out and please let me know if something is not working as expected.

Hi @antoyo , it looks like the bot posted the patch correctly but had issues posting the comment pointing [at the patch in inbox](https://inbox.sourceware.org/test-list/175743424336.5.12081261745369171928.batrachomyomachia.gcc.gcc-TEST.74.1.0@forge-test.rdfm.org/T/#t). Thank you for trying this out and please let me know if something is not working as expected.
Author
Member

@rdfm: Yeah, I just remembered about telling you this.
Also, it seems the CC didn't work either: did I use the wrong formatting?

@rdfm: Yeah, I just remembered about telling you this. Also, it seems the CC didn't work either: did I use the wrong formatting?
First-time contributor
<!-- linaro-ci-status CI bot https://ci.linaro.org/job/tcwg_gnu_cross_build--master-aarch64-precommit/49/ --> CI state: success :white_check_mark: CI bot https://ci.linaro.org/job/tcwg_gnu_cross_build--master-aarch64-precommit/49/ : CI bot tcwg_gnu_cross_build--master-aarch64: Build results See: https://ci.linaro.org/job/tcwg_gnu_cross_build--master-aarch64-precommit/49/artifact/artifacts/artifacts.precommit/notify/mail-body.txt
First-time contributor
<!-- linaro-ci-status CI bot https://ci.linaro.org/job/tcwg_gnu_cross_build--master-arm-precommit/75/ --> CI state: success :white_check_mark: CI bot https://ci.linaro.org/job/tcwg_gnu_cross_build--master-arm-precommit/75/ : CI bot tcwg_gnu_cross_build--master-arm: Build results See: https://ci.linaro.org/job/tcwg_gnu_cross_build--master-arm-precommit/75/artifact/artifacts/artifacts.precommit/notify/mail-body.txt
Member

Thanks for the patch.

I was a bit worried at first when I saw the cases added in the middle of the switch statements, but I checked and the patch adds the new values at the end of enum gcc_jit_types, so it's not an ABI break.

Given that, the patch is good to push to trunk. Thanks!

Thanks for the patch. I was a bit worried at first when I saw the cases added in the middle of the switch statements, but I checked and the patch adds the new values at the end of `enum gcc_jit_types`, so it's not an ABI break. Given that, the patch is good to push to trunk. Thanks!
Author
Member

Merged.

Thanks for the review!

Merged. Thanks for the review!
antoyo closed this pull request 2025-10-22 00:46:03 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
gcc/gcc-TEST!82
No description provided.