Commit e8a170ff authored by Nick Desaulniers's avatar Nick Desaulniers Committed by Alex Deucher

drm/amdgpu: enable -msse2 for GCC 7.1+ users

A final attempt at enabling sse2 for GCC users.

Orininally attempted in:
commit 10117450 ("drm/amd/display: add -msse2 to prevent Clang from emitting libcalls to undefined SW FP routines")

Reverted due to "reported instability" in:
commit 193392ed ("Revert "drm/amd/display: add -msse2 to prevent Clang from emitting libcalls to undefined SW FP routines"")

Re-added just for Clang in:
commit 0f0727d9 ("drm/amd/display: readd -msse2 to prevent Clang from emitting libcalls to undefined SW FP routines")

The original report didn't have enough information to know if the GPF
was due to misalignment, but I suspect that it was. (The missing
information was the disassembly of the function at the bottom of the
trace, to see if the instruction pointer pointed to an instruction with
16B alignment memory operand requirements.  The stack trace does show
the stack was only 8B but not 16B aligned though, which makes this a
strong possibility).

Now that the stack misalignment issue has been fixed for users of GCC
7.1+, reattempt adding -msse2. This matches Clang.

It will likely never be safe to enable this for pre-GCC 7.1 AND use a
16B aligned stack in these translation units.

This is only a functional change for GCC 7.1+ users, and should be boot
tested.

Link: https://bugs.freedesktop.org/show_bug.cgi?id=109487Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 00db2971
...@@ -37,9 +37,7 @@ ifdef IS_OLD_GCC ...@@ -37,9 +37,7 @@ ifdef IS_OLD_GCC
# GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3 # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
# (8B stack alignment). # (8B stack alignment).
calcs_ccflags += -mpreferred-stack-boundary=4 calcs_ccflags += -mpreferred-stack-boundary=4
endif else
ifdef CONFIG_CC_IS_CLANG
calcs_ccflags += -msse2 calcs_ccflags += -msse2
endif endif
......
...@@ -23,9 +23,7 @@ ifdef IS_OLD_GCC ...@@ -23,9 +23,7 @@ ifdef IS_OLD_GCC
# GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3 # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
# (8B stack alignment). # (8B stack alignment).
CFLAGS_$(AMDDALPATH)/dc/dcn20/dcn20_resource.o += -mpreferred-stack-boundary=4 CFLAGS_$(AMDDALPATH)/dc/dcn20/dcn20_resource.o += -mpreferred-stack-boundary=4
endif else
ifdef CONFIG_CC_IS_CLANG
CFLAGS_$(AMDDALPATH)/dc/dcn20/dcn20_resource.o += -msse2 CFLAGS_$(AMDDALPATH)/dc/dcn20/dcn20_resource.o += -msse2
endif endif
......
...@@ -16,9 +16,7 @@ ifdef IS_OLD_GCC ...@@ -16,9 +16,7 @@ ifdef IS_OLD_GCC
# GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3 # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
# (8B stack alignment). # (8B stack alignment).
CFLAGS_$(AMDDALPATH)/dc/dcn21/dcn21_resource.o += -mpreferred-stack-boundary=4 CFLAGS_$(AMDDALPATH)/dc/dcn21/dcn21_resource.o += -mpreferred-stack-boundary=4
endif else
ifdef CONFIG_CC_IS_CLANG
CFLAGS_$(AMDDALPATH)/dc/dcn21/dcn21_resource.o += -msse2 CFLAGS_$(AMDDALPATH)/dc/dcn21/dcn21_resource.o += -msse2
endif endif
......
...@@ -37,9 +37,7 @@ ifdef IS_OLD_GCC ...@@ -37,9 +37,7 @@ ifdef IS_OLD_GCC
# GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3 # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
# (8B stack alignment). # (8B stack alignment).
dml_ccflags += -mpreferred-stack-boundary=4 dml_ccflags += -mpreferred-stack-boundary=4
endif else
ifdef CONFIG_CC_IS_CLANG
dml_ccflags += -msse2 dml_ccflags += -msse2
endif endif
......
...@@ -14,9 +14,7 @@ ifdef IS_OLD_GCC ...@@ -14,9 +14,7 @@ ifdef IS_OLD_GCC
# GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3 # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
# (8B stack alignment). # (8B stack alignment).
dsc_ccflags += -mpreferred-stack-boundary=4 dsc_ccflags += -mpreferred-stack-boundary=4
endif else
ifdef CONFIG_CC_IS_CLANG
dsc_ccflags += -msse2 dsc_ccflags += -msse2
endif endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment