From: Richard Henderson Date: Fri, 13 Jun 2003 06:13:51 +0000 (-0700) Subject: re PR target/11089 (ICE: instantiate_virtual_regs_lossage while using sse built-ins) X-Git-Tag: releases/gcc-3.4.0~5882 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ee4336ea817d3e6f91c0d2b33dc92bc8227538a8;p=thirdparty%2Fgcc.git re PR target/11089 (ICE: instantiate_virtual_regs_lossage while using sse built-ins) PR target/11089 * config/i386/i386.md (sse_movaps): Use an expander to force one operand to be a register. (sse_movups): Likewise. From-SVN: r67883 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cec44af1546e..5396c79ce1ff 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2003-06-12 Richard Henderson + + PR target/11089 + * config/i386/i386.md (sse_movaps): Use an expander to force + one operand to be a register. + (sse_movups): Likewise. + 2003-06-13 Doug Evans Remove some build warnings. diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 850e9a1dfdc1..faf0e5a5b98b 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -19530,7 +19530,22 @@ ;; These two patterns are useful for specifying exactly whether to use ;; movaps or movups -(define_insn "sse_movaps" +(define_expand "sse_movaps" + [(set (match_operand:V4SF 0 "nonimmediate_operand" "") + (unspec:V4SF [(match_operand:V4SF 1 "nonimmediate_operand" "")] + UNSPEC_MOVA))] + "TARGET_SSE" +{ + if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM) + { + rtx tmp = gen_reg_rtx (V4SFmode); + emit_insn (gen_sse_movaps (tmp, operands[1])); + emit_move_insn (operands[0], tmp); + DONE; + } +}) + +(define_insn "*sse_movaps_1" [(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,m") (unspec:V4SF [(match_operand:V4SF 1 "nonimmediate_operand" "xm,x")] UNSPEC_MOVA))] @@ -19540,7 +19555,22 @@ [(set_attr "type" "ssemov,ssemov") (set_attr "mode" "V4SF")]) -(define_insn "sse_movups" +(define_expand "sse_movups" + [(set (match_operand:V4SF 0 "nonimmediate_operand" "") + (unspec:V4SF [(match_operand:V4SF 1 "nonimmediate_operand" "")] + UNSPEC_MOVU))] + "TARGET_SSE" +{ + if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM) + { + rtx tmp = gen_reg_rtx (V4SFmode); + emit_insn (gen_sse_movups (tmp, operands[1])); + emit_move_insn (operands[0], tmp); + DONE; + } +}) + +(define_insn "*sse_movups_1" [(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,m") (unspec:V4SF [(match_operand:V4SF 1 "nonimmediate_operand" "xm,x")] UNSPEC_MOVU))] @@ -19550,7 +19580,6 @@ [(set_attr "type" "ssecvt,ssecvt") (set_attr "mode" "V4SF")]) - ;; SSE Strange Moves. (define_insn "sse_movmskps" diff --git a/gcc/testsuite/gcc.dg/i386-sse-4.c b/gcc/testsuite/gcc.dg/i386-sse-4.c new file mode 100644 index 000000000000..c94e7f8607ff --- /dev/null +++ b/gcc/testsuite/gcc.dg/i386-sse-4.c @@ -0,0 +1,27 @@ +/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-O0 -msse" } */ + +typedef void __vr __attribute__ ((__mode__ (__V4SF__))); + +struct vector +{ + union + { + __vr v; + float f[4]; + }; +}; + +void +doit () +{ + float f[4]; + struct vector v; + + f[0] = 0; + f[1] = 1; + f[2] = 2; + f[3] = 3; + + v.v = __builtin_ia32_loadups (f); +}