xref: /titanic_50/usr/src/uts/intel/bignum/Makefile.64 (revision 8475e04352e630e4bd0f59a283286ee2475a14ce)
1b60f2a0bSfr41279#
2b60f2a0bSfr41279# CDDL HEADER START
3b60f2a0bSfr41279#
4b60f2a0bSfr41279# The contents of this file are subject to the terms of the
5b60f2a0bSfr41279# Common Development and Distribution License (the "License").
6b60f2a0bSfr41279# You may not use this file except in compliance with the License.
7b60f2a0bSfr41279#
8b60f2a0bSfr41279# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9b60f2a0bSfr41279# or http://www.opensolaris.org/os/licensing.
10b60f2a0bSfr41279# See the License for the specific language governing permissions
11b60f2a0bSfr41279# and limitations under the License.
12b60f2a0bSfr41279#
13b60f2a0bSfr41279# When distributing Covered Code, include this CDDL HEADER in each
14b60f2a0bSfr41279# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15b60f2a0bSfr41279# If applicable, add the following below this CDDL HEADER, with the
16b60f2a0bSfr41279# fields enclosed by brackets "[]" replaced with your own identifying
17b60f2a0bSfr41279# information: Portions Copyright [yyyy] [name of copyright owner]
18b60f2a0bSfr41279#
19b60f2a0bSfr41279# CDDL HEADER END
20b60f2a0bSfr41279#
21b60f2a0bSfr41279#
22*8475e043SDan OpenSolaris Anderson# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23b60f2a0bSfr41279# Use is subject to license terms.
24b60f2a0bSfr41279#
25b60f2a0bSfr41279#	Configuration and targets for bignum module
26b60f2a0bSfr41279#	specific to AMD 64-bit architecture, amd64.
27b60f2a0bSfr41279#
28b60f2a0bSfr41279# Bignum configuration (BIGNUM_CFG):
29b60f2a0bSfr41279#   PSR_MUL:
30b60f2a0bSfr41279#       There is a processor-specific implementation bignum multiply functions
31b60f2a0bSfr41279#   HWCAP:
32b60f2a0bSfr41279#       There are multiple implementations of bignum functions, and the
33b60f2a0bSfr41279#	appropriate one must be chosen at run time, based on testing
34b60f2a0bSfr41279#	hardware capabilites.
35b60f2a0bSfr41279#
36b60f2a0bSfr41279# -DPSR_MUL:
37b60f2a0bSfr41279# For AMD64, there is a processor-specific implementation of
38b60f2a0bSfr41279# the bignum multiply functions, which takes advantage of the
39b60f2a0bSfr41279# 64x64->128 bit multiply instruction.
40b60f2a0bSfr41279#
41b60f2a0bSfr41279# -UHWCAP:
42b60f2a0bSfr41279# There is only one implementation, because the 128 bit multiply using
43b60f2a0bSfr41279# general-purpose registers is faster than any MMX or SSE2 implementation.
44b60f2a0bSfr41279
45b60f2a0bSfr41279BIGNUM_CFG = -DPSR_MUL
46*8475e043SDan OpenSolaris AndersonCFLAGS	+= -xO4 -xcrossfile
47b60f2a0bSfr41279$(OBJS_DIR)/bignumimpl.o $(LINTS_DIR)/bignumimpl.ln := \
48b60f2a0bSfr41279	CPPFLAGS += $(BIGNUM_CFG)
49b60f2a0bSfr41279$(OBJS_DIR)/bignum_amd64.o $(LINTS_DIR)/bignum_amd64.ln := \
50b60f2a0bSfr41279	CPPFLAGS += $(BIGNUM_CFG)
51b60f2a0bSfr41279
52b60f2a0bSfr41279$(OBJS_DIR)/bignum_amd64.o: $(BIGNUMDIR)/amd64/bignum_amd64.c
53*8475e043SDan OpenSolaris Anderson	$(COMPILE.c) -o $@ $(BIGNUM_CFG) $(BIGNUMDIR)/amd64/bignum_amd64.c
54b60f2a0bSfr41279	$(CTFCONVERT_O)
55b60f2a0bSfr41279	$(POST_PROCESS_O)
56b60f2a0bSfr41279
57b60f2a0bSfr41279$(OBJS_DIR)/bignum_amd64_asm.o: $(BIGNUMDIR)/amd64/bignum_amd64_asm.s
58*8475e043SDan OpenSolaris Anderson	$(COMPILE.s) -P -o $@ $(BIGNUM_CFG) \
59*8475e043SDan OpenSolaris Anderson		$(BIGNUMDIR)/amd64/bignum_amd64_asm.s
60b60f2a0bSfr41279	$(POST_PROCESS_O)
61b60f2a0bSfr41279
62b60f2a0bSfr41279$(LINTS_DIR)/bignum_amd64.ln: $(BIGNUMDIR)/amd64/bignum_amd64.c
63b60f2a0bSfr41279	@($(LHEAD) $(LINT.c) $(BIGNUMDIR)/amd64/bignum_amd64.c $(LTAIL))
64b60f2a0bSfr41279
65b60f2a0bSfr41279$(LINTS_DIR)/bignum_amd64_asm.ln: $(BIGNUMDIR)/amd64/bignum_amd64_asm.s
66b60f2a0bSfr41279	@($(LHEAD) $(LINT.s) $(BIGNUMDIR)/amd64/bignum_amd64_asm.s $(LTAIL))
67