From db2dacf24552b6f7ee8d6a72f0f753d0a45eec0a Mon Sep 17 00:00:00 2001
From: magnum <magnum>
Date: Sat, 12 Nov 2011 15:22:38 +0100
Subject: [PATCH] Added a bunch of new experimental make targets for
 intrinsics and/or pre-built dito

---
 src/Makefile |   88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 82 insertions(+), 6 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index 006d39c..1e2e1cb 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -159,13 +159,17 @@ default:
 #	@echo "linux-ppc64-altivec      Linux, PowerPC 64-bit w/AltiVec"
 	@echo "linux-ppc64              Linux, PowerPC 64-bit"
 	@echo "linux-ia64               Linux, IA-64"
-	@echo "freebsd-x86-64           FreeBSD, x86-64 with SSE2 (best)"
-	@echo "freebsd-x86-sse2         FreeBSD, x86 with SSE2 (best if 32-bit)"
+	@echo "freebsd-x86-64i          FreeBSD, x86-64 with pre-built intrinsics (best)"
+	@echo "freebsd-x86-64           FreeBSD, x86-64 with SSE2"
+	@echo "freebsd-x86-sse2i        FreeBSD, x86 with pre-built intrinsics (best if 32-bit)"
+	@echo "freebsd-x86-sse2         FreeBSD, x86 with SSE2"
 	@echo "freebsd-x86-mmx          FreeBSD, x86 with MMX"
 	@echo "freebsd-x86-any          FreeBSD, x86"
 	@echo "freebsd-alpha            FreeBSD, Alpha"
-	@echo "openbsd-x86-64           OpenBSD, x86-64 with SSE2 (best)"
-	@echo "openbsd-x86-sse2         OpenBSD, x86 with SSE2 (best if 32-bit)"
+	@echo "openbsd-x86-64i          OpenBSD, x86-64 with pre-built intrinsics (best)"
+	@echo "openbsd-x86-64           OpenBSD, x86-64 with SSE2"
+	@echo "openbsd-x86-sse2i        OpenBSD, x86 with pre-built intrinsics (best if 32-bit)"
+	@echo "openbsd-x86-sse2         OpenBSD, x86 with SSE2"
 	@echo "openbsd-x86-mmx          OpenBSD, x86 with MMX"
 	@echo "openbsd-x86-any          OpenBSD, x86"
 	@echo "openbsd-alpha            OpenBSD, Alpha"
@@ -182,9 +186,11 @@ default:
 	@echo "solaris-sparcv9-cc       Solaris, SPARC V9 32-bit, cc"
 	@echo "solaris-sparcv8-cc       Solaris, SPARC V8 32-bit, cc"
 	@echo "solaris-sparc-gcc        Solaris, SPARC 32-bit, gcc"
-	@echo "solaris-x86-64-cc        Solaris, x86-64 with SSE2, cc (best)"
+	@echo "solaris-x86-64-cc        Solaris, x86-64 with SSE2, cc"
+	@echo "solaris-x86-64i-gcc      Solaris, x86-64 with pre-built instrinsics, gcc"
 	@echo "solaris-x86-64-gcc       Solaris, x86-64 with SSE2, gcc"
 	@echo "solaris-x86-sse2-cc      Solaris 9 4/04+, x86 with SSE2, cc"
+	@echo "solaris-x86-sse2i-gcc    Solaris 9 4/04+, x86 with pre-built instrinsics, gcc"
 	@echo "solaris-x86-sse2-gcc     Solaris 9 4/04+, x86 with SSE2, gcc"
 	@echo "solaris-x86-mmx-cc       Solaris, x86 with MMX, cc"
 	@echo "solaris-x86-mmx-gcc      Solaris, x86 with MMX, gcc"
@@ -194,7 +200,9 @@ default:
 	@echo "sco-x86-any-cc           SCO, x86, cc"
 	@echo "tru64-alpha              Tru64 (Digital UNIX, OSF/1), Alpha"
 	@echo "aix-ppc32                AIX, PowerPC 32-bit"
-	@echo "macosx-x86-64            Mac OS X 10.5+, Xcode 3.0+, x86-64 with SSE2 (best)"
+	@echo "macosx-x86-64i           Mac OS X 10.5+, Xcode 3.0+, x86-64 with pre-built instrinsics (best)"
+	@echo "macosx-x86-64            Mac OS X 10.5+, Xcode 3.0+, x86-64 with SSE2"
+	@echo "macosx-x86-sse2i         Mac OS X, x86 with pre-built instrinsics"
 	@echo "macosx-x86-sse2          Mac OS X, x86 with SSE2"
 	@echo "macosx-ppc32-altivec     Mac OS X, PowerPC w/AltiVec (best)"
 	@echo "macosx-ppc32             Mac OS X, PowerPC 32-bit"
@@ -436,6 +444,13 @@ freebsd-x86-64:
 	$(MAKE) $(PROJ) \
 		JOHN_OBJS="$(JOHN_OBJS) x86-64.o sse-intrinsics.o"
 
+freebsd-x86-64i:
+	$(LN) x86-64.h arch.h
+	@echo "#define JOHN_BLD" '"'$@'"' > john_build_rule.h
+	$(MAKE) $(PROJ) \
+		JOHN_OBJS="$(JOHN_OBJS) x86-64.o sse-intrinsics-64.o" \
+		CFLAGS="$(CFLAGS) -DUSING_ICC_S_FILE"
+
 freebsd-x86-sse2:
 	$(LN) x86-sse.h arch.h
 	@echo "#define JOHN_BLD" '"'$@'"' > john_build_rule.h
@@ -443,6 +458,14 @@ freebsd-x86-sse2:
 		JOHN_OBJS="$(JOHN_OBJS) x86.o x86-sse.o sha1-mmx.o md5-mmx.o" \
 		ASFLAGS="$(ASFLAGS) -DBSD"
 
+freebsd-x86-sse2i:
+	$(LN) x86-ssei.h arch.h
+	@echo "#define JOHN_BLD" '"'$@'"' > john_build_rule.h
+	$(MAKE) $(PROJ) \
+		JOHN_OBJS="$(JOHN_OBJS) x86.o x86-sse.o sha1-mmx.o md5-mmx.o sse-intrinsics-32.o" \
+		CFLAGS="$(CFLAGS) -msse2 -DUSING_ICC_S_FILE" \
+		ASFLAGS="$(ASFLAGS) -msse2 -DBSD" \
+
 freebsd-x86-mmx:
 	$(LN) x86-mmx.h arch.h
 	@echo "#define JOHN_BLD" '"'$@'"' > john_build_rule.h
@@ -476,6 +499,13 @@ openbsd-x86-64:
 	$(MAKE) $(PROJ) \
 		JOHN_OBJS="$(JOHN_OBJS) x86-64.o sse-intrinsics.o"
 
+openbsd-x86-64i:
+	$(LN) x86-64.h arch.h
+	@echo "#define JOHN_BLD" '"'$@'"' > john_build_rule.h
+	$(MAKE) $(PROJ) \
+		JOHN_OBJS="$(JOHN_OBJS) x86-64.o sse-intrinsics-64.o" \
+		CFLAGS="$(CFLAGS) -DUSING_ICC_S_FILE"
+
 openbsd-x86-sse2:
 	$(LN) x86-sse.h arch.h
 	@echo "#define JOHN_BLD" '"'$@'"' > john_build_rule.h
@@ -483,6 +513,14 @@ openbsd-x86-sse2:
 		JOHN_OBJS="$(JOHN_OBJS) x86.o x86-sse.o sha1-mmx.o md5-mmx.o" \
 		ASFLAGS="$(ASFLAGS) -DBSD"
 
+openbsd-x86-sse2i:
+	$(LN) x86-ssei.h arch.h
+	@echo "#define JOHN_BLD" '"'$@'"' > john_build_rule.h
+	$(MAKE) $(PROJ) \
+		JOHN_OBJS="$(JOHN_OBJS) x86.o x86-sse.o sha1-mmx.o md5-mmx.o sse-intrinsics-32.o" \
+		CFLAGS="$(CFLAGS) -msse2 -DUSING_ICC_S_FILE" \
+		ASFLAGS="$(ASFLAGS) -msse2 -DBSD"
+
 openbsd-x86-mmx:
 	$(LN) x86-mmx.h arch.h
 	@echo "#define JOHN_BLD" '"'$@'"' > john_build_rule.h
@@ -635,6 +673,16 @@ solaris-x86-64-gcc:
 		ASFLAGS="$(CFLAGS) -m64" \
 		LDFLAGS="$(LDFLAGS) -m64 $(LDFLAGS_SOLARIS)"
 
+solaris-x86-64i-gcc:
+	$(RM) arch.h
+	$(LN) x86-64.h arch.h
+	@echo "#define JOHN_BLD" '"'$@'"' > john_build_rule.h
+	$(MAKE) $(PROJ) \
+		JOHN_OBJS="$(JOHN_OBJS) c3_fmt.o x86-64.o sse-intrinsics-64.o" \
+		CFLAGS="$(CFLAGS) -m64 -DHAVE_CRYPT -DUSING_ICC_S_FILE" \
+		ASFLAGS="$(CFLAGS) -m64" \
+		LDFLAGS="$(LDFLAGS) -m64 $(LDFLAGS_SOLARIS)"
+
 solaris-x86-sse2-cc:
 	$(RM) arch.h
 	$(LN) x86-sse.h arch.h
@@ -657,6 +705,16 @@ solaris-x86-sse2-gcc:
 		CFLAGS="$(CFLAGS) -DHAVE_CRYPT" \
 		LDFLAGS="$(LDFLAGS) $(LDFLAGS_SOLARIS)"
 
+solaris-x86-sse2i-gcc:
+	$(RM) arch.h
+	$(LN) x86-ssei.h arch.h
+	@echo "#define JOHN_BLD" '"'$@'"' > john_build_rule.h
+	$(MAKE) $(PROJ) \
+		JOHN_OBJS="$(JOHN_OBJS) c3_fmt.o solaris-x86.o x86-sse.o sha1-mmx.o md5-mmx.o sse-intrinsics-32.o" \
+		CFLAGS="$(CFLAGS) -DHAVE_CRYPT -msse2 -DUSING_ICC_S_FILE" \
+		ASFLAGS="$(ASFLAGS) -msse2" \
+		LDFLAGS="$(LDFLAGS) $(LDFLAGS_SOLARIS)"
+
 solaris-x86-mmx-cc:
 	$(RM) arch.h
 	$(LN) x86-mmx.h arch.h
@@ -774,6 +832,15 @@ macosx-x86-64:
 		CFLAGS="$(CFLAGS) -m64" \
 		LDFLAGS="$(LDFLAGS) -m64"
 
+macosx-x86-64i:
+	$(LN) x86-64.h arch.h
+	@echo "#define JOHN_BLD" '"'$@'"' > john_build_rule.h
+	$(MAKE) $(PROJ) \
+		JOHN_OBJS="$(JOHN_OBJS) x86-64.o sse-intrinsics-64.o" \
+		ASFLAGS="$(ASFLAGS) -m64 -DUNDERSCORES -DBSD -DALIGN_LOG" \
+		CFLAGS="$(CFLAGS) -m64 -DUSING_ICC_S_FILE" \
+		LDFLAGS="$(LDFLAGS) -m64"
+
 macosx-x86-sse2:
 	$(LN) x86-sse.h arch.h
 	@echo "#define JOHN_BLD" '"'$@'"' > john_build_rule.h
@@ -783,6 +850,15 @@ macosx-x86-sse2:
 		CFLAGS="$(CFLAGS) -m32" \
 		LDFLAGS="$(LDFLAGS) -m32"
 
+macosx-x86-sse2i:
+	$(LN) x86-ssei.h arch.h
+	@echo "#define JOHN_BLD" '"'$@'"' > john_build_rule.h
+	$(MAKE) $(PROJ) \
+		JOHN_OBJS="$(JOHN_OBJS) x86.o x86-sse.o sha1-mmx.o md5-mmx.o sse-intrinsics-32.o" \
+		ASFLAGS="$(ASFLAGS) -m32 -msse2 -DUNDERSCORES -DBSD -DALIGN_LOG" \
+		CFLAGS="$(CFLAGS) -m32 -msse2 -DUSING_ICC_S_FILE" \
+		LDFLAGS="$(LDFLAGS) -m32"
+
 macosx-x86-mmx:
 	$(LN) x86-mmx.h arch.h
 	@echo "#define JOHN_BLD" '"'$@'"' > john_build_rule.h
-- 
1.7.5.4

