diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md index 63aff287795eca85bf7c99ecbc3ea42c6adee5c3..c3afc6b5846cfbd5f1d2b59c7948d346e33c0adb 100644 --- a/gcc/config/i386/mmx.md +++ b/gcc/config/i386/mmx.md @@ -1709,7 +1709,8 @@ [(match_operand:V2SF 1 "register_operand") (match_dup 2)] UNSPEC_ROUND))] - "TARGET_SSE4_1 && !flag_trapping_math" + "TARGET_SSE4_1 && !flag_trapping_math + && TARGET_MMX_WITH_SSE" "operands[2] = GEN_INT (ROUND_TRUNC | ROUND_NO_EXC);") (define_insn "*mmx_roundv2sf2" diff --git a/gcc/testsuite/gcc.target/i386/pr107970.c b/gcc/testsuite/gcc.target/i386/pr107970.c new file mode 100644 index 0000000000000000000000000000000000000000..1fbbb14ee724f4de26971d22b0b4eb1d4c379b75 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr107970.c @@ -0,0 +1,10 @@ +/* { dg-do compile { target ia32 } } */ +/* { dg-options "-Ofast -m3dnow -msse4.1" } */ + +float *foo_p; + +void +foo(float *__restrict q) { + foo_p[0] = __builtin_truncf(q[0]); + foo_p[1] = __builtin_truncf(q[1]); +}