This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfc] Implement support for IBM XL C for OpenCL vector ABI
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: mark dot kettenis at xs4all dot nl (Mark Kettenis)
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 14 Feb 2011 14:41:22 +0100 (CET)
- Subject: Re: [rfc] Implement support for IBM XL C for OpenCL vector ABI
Mark Kettenis wrote:
> I didn't look too closely at the diff yet, but given that
> push_dummy_call() functions tend to be fairly complex already, would
> it be possible to move the OpenCL calling convention into a seperate
> function?
Having a completely separate function at the push_dummy_call level
would lead to significant code duplication, since most of the "regular"
data types are also available in OpenCL C. The new code just adds
support for the special vector types.
I certainly agree that those functions are quite complex already. One
reason for that is that pushing arguments is inherently stateful, and
that state is currently spread out across a significant number of local
variables in the push_dummy_call functions. This makes using subroutines
and helper functions difficult.
It seems one way towards a refactoring of those routines would be to
extract that state into an explicit data structure (along the lines of
CUMULATIVE_ARGS in GCC), and then split handling of different types
of arguments into functions of their own, passing that state around.
If this looks useful, I can work on patch along those lines ...
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com