1 1.1 mrg # Out-of-line LSE atomics for AArch64 architecture. 2 1.1.1.4 mrg # Copyright (C) 2019-2024 Free Software Foundation, Inc. 3 1.1 mrg # Contributed by Linaro Ltd. 4 1.1 mrg # 5 1.1 mrg # This file is part of GCC. 6 1.1 mrg # 7 1.1 mrg # GCC is free software; you can redistribute it and/or modify it 8 1.1 mrg # under the terms of the GNU General Public License as published by 9 1.1 mrg # the Free Software Foundation; either version 3, or (at your option) 10 1.1 mrg # any later version. 11 1.1 mrg # 12 1.1 mrg # GCC is distributed in the hope that it will be useful, but 13 1.1 mrg # WITHOUT ANY WARRANTY; without even the implied warranty of 14 1.1 mrg # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 1.1 mrg # General Public License for more details. 16 1.1 mrg # 17 1.1 mrg # You should have received a copy of the GNU General Public License 18 1.1 mrg # along with GCC; see the file COPYING3. If not see 19 1.1 mrg # <http://www.gnu.org/licenses/>. 20 1.1 mrg 21 1.1.1.2 mrg # Compare-and-swap has 5 sizes and 5 memory models. 22 1.1 mrg S0 := $(foreach s, 1 2 4 8 16, $(addsuffix _$(s), cas)) 23 1.1.1.2 mrg O0 := $(foreach m, 1 2 3 4 5, $(addsuffix _$(m)$(objext), $(S0))) 24 1.1 mrg 25 1.1.1.2 mrg # Swap, Load-and-operate have 4 sizes and 5 memory models 26 1.1 mrg S1 := $(foreach s, 1 2 4 8, $(addsuffix _$(s), swp ldadd ldclr ldeor ldset)) 27 1.1.1.2 mrg O1 := $(foreach m, 1 2 3 4 5, $(addsuffix _$(m)$(objext), $(S1))) 28 1.1 mrg 29 1.1 mrg LSE_OBJS := $(O0) $(O1) 30 1.1 mrg 31 1.1 mrg libgcc-objects += $(LSE_OBJS) lse-init$(objext) 32 1.1 mrg 33 1.1 mrg empty = 34 1.1 mrg space = $(empty) $(empty) 35 1.1 mrg PAT_SPLIT = $(subst _,$(space),$(*F)) 36 1.1 mrg PAT_BASE = $(word 1,$(PAT_SPLIT)) 37 1.1 mrg PAT_N = $(word 2,$(PAT_SPLIT)) 38 1.1 mrg PAT_M = $(word 3,$(PAT_SPLIT)) 39 1.1 mrg 40 1.1 mrg lse-init$(objext): $(srcdir)/config/aarch64/lse-init.c 41 1.1 mrg $(gcc_compile) -c $< 42 1.1 mrg 43 1.1 mrg $(LSE_OBJS): $(srcdir)/config/aarch64/lse.S 44 1.1 mrg $(gcc_compile) -DL_$(PAT_BASE) -DSIZE=$(PAT_N) -DMODEL=$(PAT_M) -c $< 45