Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libgccjit: Add gcc_jit_context_new_array_type_unsigned_long #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

antoyo
Copy link
Owner

@antoyo antoyo commented Oct 16, 2024

ML link: https://gcc.gnu.org/pipermail/jit/2024q1/001842.html

  • Change the type from unsigned long to uint64_t?

gcc/jit/ChangeLog:

* docs/topics/compatibility.rst (LIBGCCJIT_ABI_28): New ABI tag.
* docs/topics/types.rst: Document gcc_jit_context_new_array_type_unsigned_long.
* jit-playback.cc (new_array_type): Change num_elements type to unsigned long.
* jit-playback.h (new_array_type): Change num_elements type to unsigned long.
* jit-recording.cc (recording::context::new_array_type): Change num_elements type to unsigned long. (recording::array_type::make_debug_string): Use unsigned long format. (recording::array_type::write_reproducer): Switch to gcc_jit_context_new_array_type_unsigned_long.
* jit-recording.h (class array_type): Change num_elements type to unsigned long. (new_array_type): Change num_elements type to unsigned long. (num_elements): Change return type to unsigned long.
* libgccjit.cc (gcc_jit_context_new_array_type_unsigned_long): New function.
* libgccjit.h (gcc_jit_context_new_array_type_unsigned_long): New function.
* libgccjit.map: New function.

gcc/testsuite/ChangeLog:

* jit.dg/all-non-failing-tests.h: Add test-arrays-unsigned-long.c.
* jit.dg/test-arrays-unsigned-long.c: New test.

gcc/jit/ChangeLog:

	* docs/topics/compatibility.rst (LIBGCCJIT_ABI_28): New ABI tag.
	* docs/topics/types.rst: Document
	gcc_jit_context_new_array_type_unsigned_long.
	* jit-playback.cc (new_array_type): Change num_elements type to
	unsigned long.
	* jit-playback.h (new_array_type): Change num_elements type to
	unsigned long.
	* jit-recording.cc (recording::context::new_array_type): Change
	num_elements type to unsigned long.
	(recording::array_type::make_debug_string): Use unsigned long
	format.
	(recording::array_type::write_reproducer): Switch to
	gcc_jit_context_new_array_type_unsigned_long.
	* jit-recording.h (class array_type): Change num_elements type
	to unsigned long.
	(new_array_type): Change num_elements type to unsigned long.
	(num_elements): Change return type to unsigned long.
	* libgccjit.cc (gcc_jit_context_new_array_type_unsigned_long):
	New function.
	* libgccjit.h (gcc_jit_context_new_array_type_unsigned_long):
	New function.
	* libgccjit.map: New function.

gcc/testsuite/ChangeLog:

	* jit.dg/all-non-failing-tests.h: Add test-arrays-unsigned-long.c.
	* jit.dg/test-arrays-unsigned-long.c: New test.
@antoyo
Copy link
Owner Author

antoyo commented Nov 4, 2024

@davidmalcolm: I'm a bit concerned about using unsigned long.
Would it be OK if I change the type to uint64_t?
I could rename the function to gcc_jit_context_new_array_type_u64.

@davidmalcolm
Copy link
Collaborator

@davidmalcolm: I'm a bit concerned about using unsigned long. Would it be OK if I change the type to uint64_t? I could rename the function to gcc_jit_context_new_array_type_u64.

@antoyo: Yes, unsigned long might not be big enough. My gut feeling is to use size_t rather than uint64_t since that's what's used in the C world, but maybe that could cause issues with rustc?

@antoyo
Copy link
Owner Author

antoyo commented Nov 20, 2024

@antoyo: Yes, unsigned long might not be big enough. My gut feeling is to use size_t rather than uint64_t since that's what's used in the C world, but maybe that could cause issues with rustc?

size_t would be 32-bits on 32-bits platform. Using uint64_t would be 64-bits on all platforms, which would allow rustc_codegen_gcc to work more easily on 32-bit platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants