This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: x86-64: fix ABI incompatibilities in parameter and returnvalue passing


I think it's rather an omission on my part not to have consolidated
VALID_MMX_REG_MODE_3DNOW with VALID_MMX_REG_MODE; I simply didn't
realize there is such a distinction while for SSE vs. SSE2 the earlier
includes the latter. The point is that parameters of all these types get
passed through %mm registers, and you can't even store them to memory
(in order to then operate on them one element at a time) without the
move patterns. Jan

>>> Richard Henderson <rth@redhat.com> 10.07.04 00:35:14 >>>
On Tue, Jul 06, 2004 at 04:33:40PM +0200, Jan Beulich wrote:
> 	* config/i386/i386.c (classify_argument): Treat V1xx modes the
same as
> 	their base modes. CTImode, TCmode, and XCmode must be passed in
memory.
> 	TFmode (__float128) must be is an SSE/SSEUP pair. V2SImode,
V4HImode,
> 	and V8QI are class SSE. All sufficiently small remaining vector
modes
> 	must be passed in one or two integer registers.
> 	(ix86_libcall_value): TFmode must be returned in xmm0, XCmode
must be
> 	returned in memory.
> 	(bdesc_2arg, ix86_init_mmx_sse_builtins): __builtin_ia32_pmuludq
and
> 	__builtin_ia32_pmuludq128 have non-uniform argument and return
types
> 	and must thus be handled explicitly.
> 	* config/i386/i386.md (*movdi_1_rex64): Add cases for moving
between
> 	MMX and XMM regs.
> 	(movv8qi_internal, movv4hi_internal, movv2si_internal,
> 	movv2sf_internal): Permit moving between MMX and XMM registers
(since
> 	MMX areguments and return values are passed in XMM registers).
> 	(sse2_umulsidi3): Correct type and mode.

Applied, mostly.

>  (define_insn "movv2sf_internal"
> -  [(set (match_operand:V2SF 0 "nonimmediate_operand" "=y,y,m")
> -        (match_operand:V2SF 1 "vector_move_operand" "C,ym,y"))]
> -  "TARGET_3DNOW
> +  [(set (match_operand:V2SF 0 "nonimmediate_operand"
> "=y,y,m,!y,!*Y,?*x,?m")
> +        (match_operand:V2SF 1 "vector_move_operand"
> "C,ym,y,*Y,y,*xm,*x"))]
> +  "TARGET_MMX

I think the change from TARGET_3DNOW to TARGET_MMX is wrong.
V2SF is not in VALID_MMX_REG_MODE, only in VALID_MMX_REG_MODE_3DNOW.

I changed that back before applying the patch.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]