forked from iains/gcc-14-branch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't assume it's AVX_U128_CLEAN after call_insn whose abi.mode_clobb…
…er(V4DImode) deosn't contains all SSE_REGS. If the function desn't clobber any sse registers or only clobber 128-bit part, then vzeroupper isn't issued before the function exit. the status not CLEAN but ANY after the function. Also for sibling_call, it's safe to issue an vzeroupper. Also there could be missing vzeroupper since there's no mode_exit for sibling_call_p. gcc/ChangeLog: PR target/112891 * config/i386/i386.cc (ix86_avx_u128_mode_after): Return AVX_U128_ANY if callee_abi doesn't clobber all_sse_regs to align with ix86_avx_u128_mode_needed. (ix86_avx_u128_mode_needed): Return AVX_U128_ClEAN for sibling_call. gcc/testsuite/ChangeLog: * gcc.target/i386/pr112891.c: New test. * gcc.target/i386/pr112891-2.c: New test.
- Loading branch information
Showing
3 changed files
with
78 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* { dg-do compile } */ | ||
/* { dg-options "-mavx2 -O3" } */ | ||
/* { dg-final { scan-assembler-times "vzeroupper" 1 } } */ | ||
|
||
void | ||
__attribute__((noinline)) | ||
bar (double* a) | ||
{ | ||
a[0] = 1.0; | ||
a[1] = 2.0; | ||
} | ||
|
||
double | ||
__attribute__((noinline)) | ||
foo (double* __restrict a, double* b) | ||
{ | ||
a[0] += b[0]; | ||
a[1] += b[1]; | ||
a[2] += b[2]; | ||
a[3] += b[3]; | ||
bar (b); | ||
return a[5] + b[5]; | ||
} | ||
|
||
double | ||
foo1 (double* __restrict a, double* b) | ||
{ | ||
double c = foo (a, b); | ||
return __builtin_exp (c); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* { dg-do compile } */ | ||
/* { dg-options "-mavx2 -O3" } */ | ||
/* { dg-final { scan-assembler-times "vzeroupper" 1 } } */ | ||
|
||
void | ||
__attribute__((noinline)) | ||
bar (double* a) | ||
{ | ||
a[0] = 1.0; | ||
a[1] = 2.0; | ||
} | ||
|
||
void | ||
__attribute__((noinline)) | ||
foo (double* __restrict a, double* b) | ||
{ | ||
a[0] += b[0]; | ||
a[1] += b[1]; | ||
a[2] += b[2]; | ||
a[3] += b[3]; | ||
bar (b); | ||
} | ||
|
||
double | ||
foo1 (double* __restrict a, double* b) | ||
{ | ||
foo (a, b); | ||
return __builtin_exp (b[1]); | ||
} |