1# SPDX-License-Identifier: MIT
2#
3# Makefile for the 'dsc' sub-component of DAL.
4
5ifdef CONFIG_X86
6dsc_ccflags := -mhard-float -msse
7endif
8
9ifdef CONFIG_PPC64
10dsc_ccflags := -mhard-float -maltivec
11endif
12
13ifdef CONFIG_ARM64
14dsc_rcflags := -mgeneral-regs-only
15endif
16
17ifdef CONFIG_CC_IS_GCC
18ifeq ($(call cc-ifversion, -lt, 0701, y), y)
19IS_OLD_GCC = 1
20endif
21endif
22
23ifdef CONFIG_X86
24ifdef IS_OLD_GCC
25# Stack alignment mismatch, proceed with caution.
26# GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
27# (8B stack alignment).
28dsc_ccflags += -mpreferred-stack-boundary=4
29else
30dsc_ccflags += -msse2
31endif
32endif
33
34CFLAGS_$(AMDDALPATH)/dc/dsc/rc_calc.o := $(dsc_ccflags)
35CFLAGS_REMOVE_$(AMDDALPATH)/dc/dsc/rc_calc.o := $(dsc_rcflags)
36
37DSC = dc_dsc.o rc_calc.o rc_calc_dpi.o
38
39AMD_DAL_DSC = $(addprefix $(AMDDALPATH)/dc/dsc/,$(DSC))
40
41AMD_DISPLAY_FILES += $(AMD_DAL_DSC)
42