Elliott Hughes | 7c02d94 | 2014-09-16 19:06:31 -0700 | [diff] [blame] | 1 | # 32-bit x86. |
Ying Wang | f25d677 | 2014-01-23 15:17:50 -0800 | [diff] [blame] | 2 | |
Elliott Hughes | 7c02d94 | 2014-09-16 19:06:31 -0700 | [diff] [blame] | 3 | # |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 4 | # Generic x86 optimizations, may be overriden by CPU variants. |
Elliott Hughes | 7c02d94 | 2014-09-16 19:06:31 -0700 | [diff] [blame] | 5 | # |
| 6 | |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 7 | libc_bionic_src_files_x86 += \ |
| 8 | arch-x86/atom/string/sse2-memchr-atom.S \ |
| 9 | arch-x86/atom/string/sse2-memrchr-atom.S \ |
| 10 | arch-x86/atom/string/sse2-strchr-atom.S \ |
| 11 | arch-x86/atom/string/sse2-strnlen-atom.S \ |
| 12 | arch-x86/atom/string/sse2-strrchr-atom.S \ |
| 13 | arch-x86/atom/string/sse2-wcschr-atom.S \ |
| 14 | arch-x86/atom/string/sse2-wcsrchr-atom.S \ |
| 15 | arch-x86/atom/string/sse2-wcslen-atom.S \ |
| 16 | arch-x86/atom/string/sse2-wcscmp-atom.S \ |
| 17 | arch-x86/silvermont/string/sse2-bcopy-slm.S \ |
| 18 | arch-x86/silvermont/string/sse2-bzero-slm.S \ |
| 19 | arch-x86/silvermont/string/sse2-memcpy-slm.S \ |
| 20 | arch-x86/silvermont/string/sse2-memmove-slm.S \ |
| 21 | arch-x86/silvermont/string/sse2-memset-slm.S \ |
| 22 | arch-x86/silvermont/string/sse2-stpcpy-slm.S \ |
| 23 | arch-x86/silvermont/string/sse2-stpncpy-slm.S \ |
| 24 | arch-x86/silvermont/string/sse2-strcpy-slm.S \ |
| 25 | arch-x86/silvermont/string/sse2-strlen-slm.S \ |
| 26 | arch-x86/silvermont/string/sse2-strncpy-slm.S |
Elliott Hughes | 7c02d94 | 2014-09-16 19:06:31 -0700 | [diff] [blame] | 27 | |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 28 | libc_bionic_src_files_x86 += \ |
| 29 | arch-x86/generic/string/memcmp.S \ |
| 30 | arch-x86/generic/string/strcmp.S \ |
| 31 | arch-x86/generic/string/strncmp.S \ |
| 32 | arch-x86/generic/string/strcat.S |
| 33 | |
| 34 | ifeq ($(ARCH_X86_HAVE_SSSE3),true) |
| 35 | libc_bionic_src_files_x86 += \ |
| 36 | arch-x86/atom/string/ssse3-strncat-atom.S \ |
| 37 | arch-x86/atom/string/ssse3-strlcat-atom.S \ |
| 38 | arch-x86/atom/string/ssse3-strlcpy-atom.S \ |
| 39 | arch-x86/atom/string/ssse3-strcmp-atom.S \ |
| 40 | arch-x86/atom/string/ssse3-strncmp-atom.S \ |
| 41 | arch-x86/atom/string/ssse3-strcat-atom.S \ |
| 42 | arch-x86/atom/string/ssse3-wcscat-atom.S \ |
| 43 | arch-x86/atom/string/ssse3-wcscpy-atom.S |
| 44 | libc_bionic_src_files_exclude_x86 += \ |
| 45 | arch-x86/generic/string/strcmp.S \ |
| 46 | arch-x86/generic/string/strncmp.S \ |
| 47 | arch-x86/generic/string/strcat.S |
| 48 | endif |
| 49 | |
| 50 | ifeq ($(ARCH_X86_HAVE_SSE4),true) |
| 51 | libc_bionic_src_files_x86 += \ |
| 52 | arch-x86/silvermont/string/sse4-memcmp-slm.S \ |
| 53 | arch-x86/silvermont/string/sse4-wmemcmp-slm.S |
| 54 | libc_bionic_src_files_exclude_x86 += \ |
| 55 | arch-x86/generic/string/memcmp.S |
| 56 | endif |
| 57 | |
| 58 | # |
| 59 | # Remove default implementations that we have optimized versions of. |
| 60 | # |
| 61 | |
| 62 | libc_freebsd_src_files_exclude_x86 += \ |
| 63 | upstream-freebsd/lib/libc/string/wcschr.c \ |
| 64 | upstream-freebsd/lib/libc/string/wcscmp.c \ |
| 65 | upstream-freebsd/lib/libc/string/wcslen.c \ |
| 66 | upstream-freebsd/lib/libc/string/wcsrchr.c \ |
| 67 | |
| 68 | ifeq ($(ARCH_X86_HAVE_SSSE3),true) |
| 69 | libc_freebsd_src_files_exclude_x86 += \ |
| 70 | upstream-freebsd/lib/libc/string/wcscat.c \ |
| 71 | upstream-freebsd/lib/libc/string/wcscpy.c |
| 72 | endif |
| 73 | |
| 74 | ifeq ($(ARCH_X86_HAVE_SSE4),true) |
| 75 | libc_freebsd_src_files_exclude_x86 += \ |
| 76 | upstream-freebsd/lib/libc/string/wmemcmp.c |
| 77 | endif |
| 78 | |
| 79 | libc_openbsd_src_files_exclude_x86 += \ |
| 80 | upstream-openbsd/lib/libc/string/memchr.c \ |
| 81 | upstream-openbsd/lib/libc/string/memmove.c \ |
| 82 | upstream-openbsd/lib/libc/string/memrchr.c \ |
| 83 | upstream-openbsd/lib/libc/string/stpcpy.c \ |
| 84 | upstream-openbsd/lib/libc/string/stpncpy.c \ |
| 85 | upstream-openbsd/lib/libc/string/strcat.c \ |
| 86 | upstream-openbsd/lib/libc/string/strcpy.c \ |
| 87 | upstream-openbsd/lib/libc/string/strncmp.c \ |
| 88 | upstream-openbsd/lib/libc/string/strncpy.c \ |
| 89 | |
| 90 | ifeq ($(ARCH_X86_HAVE_SSSE3),true) |
| 91 | libc_openbsd_src_files_exclude_x86 += \ |
| 92 | upstream-openbsd/lib/libc/string/strlcat.c \ |
| 93 | upstream-openbsd/lib/libc/string/strlcpy.c \ |
| 94 | upstream-openbsd/lib/libc/string/strncat.c |
| 95 | endif |
| 96 | |
| 97 | libc_bionic_src_files_exclude_x86 += \ |
| 98 | bionic/strchr.cpp \ |
| 99 | bionic/strnlen.c \ |
| 100 | bionic/strrchr.cpp \ |
Ying Wang | f25d677 | 2014-01-23 15:17:50 -0800 | [diff] [blame] | 101 | |
Elliott Hughes | 7c02d94 | 2014-09-16 19:06:31 -0700 | [diff] [blame] | 102 | # |
| 103 | # Inherently architecture-specific functions. |
| 104 | # |
Ying Wang | f25d677 | 2014-01-23 15:17:50 -0800 | [diff] [blame] | 105 | |
Ying Wang | f25d677 | 2014-01-23 15:17:50 -0800 | [diff] [blame] | 106 | libc_bionic_src_files_x86 += \ |
Elliott Hughes | 36d6188 | 2013-11-19 13:31:58 -0800 | [diff] [blame] | 107 | arch-x86/bionic/__bionic_clone.S \ |
Christopher Ferris | 04954a4 | 2013-02-26 01:30:00 -0800 | [diff] [blame] | 108 | arch-x86/bionic/_exit_with_stack_teardown.S \ |
Christopher Ferris | 6869d26 | 2014-10-06 15:11:28 -0700 | [diff] [blame] | 109 | arch-x86/bionic/libgcc_compat.c \ |
Elliott Hughes | 36f451a | 2014-09-10 15:20:40 -0700 | [diff] [blame] | 110 | arch-x86/bionic/__restore.S \ |
Christopher Ferris | 04954a4 | 2013-02-26 01:30:00 -0800 | [diff] [blame] | 111 | arch-x86/bionic/setjmp.S \ |
Christopher Ferris | 04954a4 | 2013-02-26 01:30:00 -0800 | [diff] [blame] | 112 | arch-x86/bionic/syscall.S \ |
Dan Albert | 6a91887 | 2014-08-05 20:53:31 +0000 | [diff] [blame] | 113 | arch-x86/bionic/vfork.S \ |
Liubov Dmitrieva | 0a49066 | 2012-01-17 12:55:46 +0400 | [diff] [blame] | 114 | |
Varvara Rainchik | 5a92284 | 2014-04-24 15:41:20 +0400 | [diff] [blame] | 115 | ## ARCH variant specific source files |
| 116 | arch_variant_mk := $(LOCAL_PATH)/arch-x86/$(TARGET_ARCH_VARIANT)/$(TARGET_ARCH_VARIANT).mk |
| 117 | ifeq ($(wildcard $(arch_variant_mk)),) |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 118 | arch_variant_mk := |
Liubov Dmitrieva | 0a49066 | 2012-01-17 12:55:46 +0400 | [diff] [blame] | 119 | endif |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 120 | ifneq ($(arch_variant_mk),) |
Varvara Rainchik | 5a92284 | 2014-04-24 15:41:20 +0400 | [diff] [blame] | 121 | include $(arch_variant_mk) |
| 122 | libc_common_additional_dependencies += $(arch_variant_mk) |
Liubov Dmitrieva | 0a49066 | 2012-01-17 12:55:46 +0400 | [diff] [blame] | 123 | |
Varvara Rainchik | 5a92284 | 2014-04-24 15:41:20 +0400 | [diff] [blame] | 124 | arch_variant_mk := |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 125 | endif |
Ying Wang | f25d677 | 2014-01-23 15:17:50 -0800 | [diff] [blame] | 126 | |
Ying Wang | f25d677 | 2014-01-23 15:17:50 -0800 | [diff] [blame] | 127 | libc_crt_target_cflags_x86 := \ |
| 128 | -m32 \ |
| 129 | -I$(LOCAL_PATH)/arch-x86/include |
| 130 | |
| 131 | libc_crt_target_ldflags_x86 := -melf_i386 |
| 132 | |
| 133 | libc_crt_target_crtbegin_file_x86 := \ |
| 134 | $(LOCAL_PATH)/arch-common/bionic/crtbegin.c |
| 135 | |
| 136 | libc_crt_target_crtbegin_so_file_x86 := \ |
| 137 | $(LOCAL_PATH)/arch-common/bionic/crtbegin_so.c |
| 138 | |
| 139 | libc_crt_target_so_cflags_x86 := \ |
| 140 | -fPIC |