PERFORCE change 144334 for review

Julian Elischer julian at FreeBSD.org
Mon Jun 30 05:19:32 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=144334

Change 144334 by julian at julian_trafmon1 on 2008/06/30 05:18:42

	IFC at 144321

Affected files ...

.. //depot/projects/vimage-commit/src/sys/amd64/amd64/bpf_jit_machdep.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/amd64/amd64/bpf_jit_machdep.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/amd64/amd64/mem.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/amd64/amd64/minidump_machdep.c#5 integrate
.. //depot/projects/vimage-commit/src/sys/amd64/amd64/pmap.c#3 integrate
.. //depot/projects/vimage-commit/src/sys/amd64/amd64/trap.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/amd64/conf/GENERIC#2 integrate
.. //depot/projects/vimage-commit/src/sys/amd64/include/iodev.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/amd64/include/memdev.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/amd64/include/pmap.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/amd64/include/pmc_mdep.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/amd64/include/stack.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/amd64/include/vmparam.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/arm/include/memdev.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/boot/Makefile.inc#1 branch
.. //depot/projects/vimage-commit/src/sys/boot/arm/Makefile.inc#1 branch
.. //depot/projects/vimage-commit/src/sys/boot/arm/at91/Makefile.inc#2 integrate
.. //depot/projects/vimage-commit/src/sys/boot/efi/Makefile.inc#2 integrate
.. //depot/projects/vimage-commit/src/sys/boot/i386/Makefile.inc#2 integrate
.. //depot/projects/vimage-commit/src/sys/boot/i386/loader/Makefile#2 integrate
.. //depot/projects/vimage-commit/src/sys/boot/ia64/Makefile.inc#2 integrate
.. //depot/projects/vimage-commit/src/sys/boot/ia64/common/Makefile#2 integrate
.. //depot/projects/vimage-commit/src/sys/boot/ia64/efi/Makefile#2 integrate
.. //depot/projects/vimage-commit/src/sys/boot/ia64/ski/Makefile#2 integrate
.. //depot/projects/vimage-commit/src/sys/boot/ofw/Makefile.inc#1 branch
.. //depot/projects/vimage-commit/src/sys/boot/pc98/Makefile.inc#2 integrate
.. //depot/projects/vimage-commit/src/sys/boot/pc98/boot2/Makefile#2 integrate
.. //depot/projects/vimage-commit/src/sys/boot/pc98/loader/Makefile#2 integrate
.. //depot/projects/vimage-commit/src/sys/boot/powerpc/Makefile.inc#1 branch
.. //depot/projects/vimage-commit/src/sys/boot/powerpc/ofw/Makefile#2 integrate
.. //depot/projects/vimage-commit/src/sys/boot/sparc64/Makefile.inc#2 integrate
.. //depot/projects/vimage-commit/src/sys/boot/sparc64/loader/Makefile#2 integrate
.. //depot/projects/vimage-commit/src/sys/boot/uboot/Makefile.inc#1 branch
.. //depot/projects/vimage-commit/src/sys/conf/NOTES#3 integrate
.. //depot/projects/vimage-commit/src/sys/conf/files#6 integrate
.. //depot/projects/vimage-commit/src/sys/conf/kern.mk#2 integrate
.. //depot/projects/vimage-commit/src/sys/conf/kern.pre.mk#3 integrate
.. //depot/projects/vimage-commit/src/sys/dev/aac/aac.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/dev/aac/aac_pci.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/dev/acpi_support/acpi_asus.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/dev/agp/agp_i810.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/dev/et/if_et.c#1 branch
.. //depot/projects/vimage-commit/src/sys/dev/et/if_etreg.h#1 branch
.. //depot/projects/vimage-commit/src/sys/dev/et/if_etvar.h#1 branch
.. //depot/projects/vimage-commit/src/sys/dev/fe/if_fe.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/dev/fe/if_fe_cbus.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/dev/fe/if_fe_isa.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/dev/fe/if_fe_pccard.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/dev/fe/if_fevar.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/dev/gem/if_gem.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/dev/io/iodev.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/dev/mfi/mfi.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/dev/mii/miidevs#3 integrate
.. //depot/projects/vimage-commit/src/sys/dev/mii/truephy.c#1 branch
.. //depot/projects/vimage-commit/src/sys/dev/mii/truephyreg.h#1 branch
.. //depot/projects/vimage-commit/src/sys/dev/usb/usbdevs#4 integrate
.. //depot/projects/vimage-commit/src/sys/dev/usb/uscanner.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/dev/wpi/if_wpi.c#3 integrate
.. //depot/projects/vimage-commit/src/sys/fs/devfs/devfs_rule.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/geom/journal/g_journal.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/i386/conf/GENERIC#2 integrate
.. //depot/projects/vimage-commit/src/sys/i386/i386/bpf_jit_machdep.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/i386/i386/bpf_jit_machdep.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/i386/include/iodev.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/i386/include/memdev.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/ia64/include/memdev.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/kern/kern_cpuset.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/kern/kern_descrip.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/kern/kern_intr.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/kern/kern_jail.c#4 integrate
.. //depot/projects/vimage-commit/src/sys/kern/kern_lockf.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/kern/kern_umtx.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/kern/kern_xxx.c#4 integrate
.. //depot/projects/vimage-commit/src/sys/kern/link_elf_obj.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/kern/stack_protector.c#1 branch
.. //depot/projects/vimage-commit/src/sys/kern/subr_bus.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/kern/sysv_sem.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/kern/uipc_sem.c#3 integrate
.. //depot/projects/vimage-commit/src/sys/kern/uipc_shm.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/kern/vfs_aio.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/kern/vfs_syscalls.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/mips/include/iodev.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/mips/include/memdev.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/modules/Makefile#5 integrate
.. //depot/projects/vimage-commit/src/sys/modules/ath_rate_amrr/Makefile#2 integrate
.. //depot/projects/vimage-commit/src/sys/modules/et/Makefile#1 branch
.. //depot/projects/vimage-commit/src/sys/modules/mii/Makefile#2 integrate
.. //depot/projects/vimage-commit/src/sys/modules/nfslockd/Makefile#2 integrate
.. //depot/projects/vimage-commit/src/sys/modules/ralfw/Makefile#2 integrate
.. //depot/projects/vimage-commit/src/sys/modules/sem/Makefile#2 integrate
.. //depot/projects/vimage-commit/src/sys/net/if.c#5 integrate
.. //depot/projects/vimage-commit/src/sys/net/if_gre.c#3 integrate
.. //depot/projects/vimage-commit/src/sys/net/if_gre.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/net/if_loop.c#4 integrate
.. //depot/projects/vimage-commit/src/sys/net/if_var.h#5 integrate
.. //depot/projects/vimage-commit/src/sys/netgraph/netgraph.h#4 integrate
.. //depot/projects/vimage-commit/src/sys/netinet/in.c#4 integrate
.. //depot/projects/vimage-commit/src/sys/netinet/libalias/alias.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/netinet/libalias/alias_db.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/netinet/libalias/alias_ftp.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/netinet6/in6_rmx.c#5 integrate
.. //depot/projects/vimage-commit/src/sys/netinet6/ip6_ipsec.c#5 integrate
.. //depot/projects/vimage-commit/src/sys/netipsec/key.c#4 integrate
.. //depot/projects/vimage-commit/src/sys/nfsclient/nfs.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/nfsclient/nfs_node.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/nfsclient/nfs_vfsops.c#4 integrate
.. //depot/projects/vimage-commit/src/sys/nfsclient/nfs_vnops.c#4 integrate
.. //depot/projects/vimage-commit/src/sys/nfsclient/nfsmount.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/nfsclient/nfsnode.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/nlm/nlm.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/nlm/nlm_advlock.c#1 branch
.. //depot/projects/vimage-commit/src/sys/nlm/nlm_prot.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/nlm/nlm_prot_clnt.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/nlm/nlm_prot_impl.c#3 integrate
.. //depot/projects/vimage-commit/src/sys/nlm/nlm_prot_server.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/pci/viapm.c#3 integrate
.. //depot/projects/vimage-commit/src/sys/powerpc/include/memdev.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/rpc/auth_unix.c#3 integrate
.. //depot/projects/vimage-commit/src/sys/rpc/authunix_prot.c#4 integrate
.. //depot/projects/vimage-commit/src/sys/rpc/clnt.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/rpc/clnt_dg.c#3 integrate
.. //depot/projects/vimage-commit/src/sys/rpc/clnt_rc.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/rpc/clnt_vc.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/rpc/rpcb_clnt.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/rpc/svc_vc.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/security/mac/mac_framework.h#3 integrate
.. //depot/projects/vimage-commit/src/sys/security/mac/mac_policy.h#3 integrate
.. //depot/projects/vimage-commit/src/sys/security/mac/mac_posix_sem.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/security/mac_biba/mac_biba.c#3 integrate
.. //depot/projects/vimage-commit/src/sys/security/mac_mls/mac_mls.c#3 integrate
.. //depot/projects/vimage-commit/src/sys/security/mac_stub/mac_stub.c#3 integrate
.. //depot/projects/vimage-commit/src/sys/security/mac_test/mac_test.c#3 integrate
.. //depot/projects/vimage-commit/src/sys/sparc64/include/in_cksum.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/sparc64/include/memdev.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/sun4v/include/in_cksum.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/sun4v/include/memdev.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/sys/bus.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/sys/fcntl.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/sys/file.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/sys/jail.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/sys/ksem.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/sys/lockf.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/sys/param.h#4 integrate
.. //depot/projects/vimage-commit/src/sys/sys/priv.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/sys/semaphore.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/sys/umtx.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/sys/user.h#2 integrate
.. //depot/projects/vimage-commit/src/sys/vm/vm_kern.c#2 integrate
.. //depot/projects/vimage-commit/src/sys/vm/vm_map.c#2 integrate

Differences ...

==== //depot/projects/vimage-commit/src/sys/amd64/amd64/bpf_jit_machdep.c#2 (text+ko) ====

@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/bpf_jit_machdep.c,v 1.4 2006/01/03 20:26:02 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/bpf_jit_machdep.c,v 1.6 2008/06/24 20:12:12 jkim Exp $");
 
 #include "opt_bpf.h"
 
@@ -132,11 +132,11 @@
 
 		/* create the procedure header */
 		PUSH(RBP);
-		MOVrq(RBP, RSP);
-		MOVoqd(RBP, -8, ESI);
-		MOVoqd(RBP, -12, EDX);
+		MOVrq(RSP, RBP);
+		MOVdoq(ESI, -8, RBP);
+		MOVdoq(EDX, -12, RBP);
 		PUSH(RBX);
-		MOVrq(RBX, RDI);
+		MOVrq(RDI, RBX);
 
 		for (i = 0; i < nins; i++) {
 			stream.bpf_pc++;
@@ -146,7 +146,7 @@
 				return NULL;
 
 			case BPF_RET|BPF_K:
-				MOVid(EAX, ins->k);
+				MOVid(ins->k, EAX);
 				POP(RBX);
 				LEAVE_RET();
 				break;
@@ -157,119 +157,119 @@
 				break;
 
 			case BPF_LD|BPF_W|BPF_ABS:
-				MOVid(ECX, ins->k);
-				MOVrd(ESI, ECX);
-				ADDib(ECX, sizeof(int));
-				CMPodd(ECX, RBP, -12);
+				MOVid(ins->k, ECX);
+				MOVrd(ECX, ESI);
+				ADDib(sizeof(int), ECX);
+				CMPoqd(-12, RBP, ECX);
 				JLEb(5);
-				ZERO_EAX();
+				ZEROrd(EAX);
 				POP(RBX);
 				LEAVE_RET();
-				MOVobd(EAX, RBX, RSI);
+				MOVobd(RBX, RSI, EAX);
 				BSWAP(EAX);
 				break;
 
 			case BPF_LD|BPF_H|BPF_ABS:
-				ZERO_EAX();
-				MOVid(ECX, ins->k);
-				MOVrd(ESI, ECX);
-				ADDib(ECX, sizeof(short));
-				CMPodd(ECX, RBP, -12);
+				ZEROrd(EAX);
+				MOVid(ins->k, ECX);
+				MOVrd(ECX, ESI);
+				ADDib(sizeof(short), ECX);
+				CMPoqd(-12, RBP, ECX);
 				JLEb(3);
 				POP(RBX);
 				LEAVE_RET();
-				MOVobw(AX, RBX, RSI);
+				MOVobw(RBX, RSI, AX);
 				SWAP_AX();
 				break;
 
 			case BPF_LD|BPF_B|BPF_ABS:
-				ZERO_EAX();
-				MOVid(ECX, ins->k);
-				CMPodd(ECX, RBP, -12);
+				ZEROrd(EAX);
+				MOVid(ins->k, ECX);
+				CMPoqd(-12, RBP, ECX);
 				JLEb(3);
 				POP(RBX);
 				LEAVE_RET();
-				MOVobb(AL, RBX, RCX);
+				MOVobb(RBX, RCX, AL);
 				break;
 
 			case BPF_LD|BPF_W|BPF_LEN:
-				MOVodd(EAX, RBP, -8);
+				MOVoqd(-8, RBP, EAX);
 				break;
 
 			case BPF_LDX|BPF_W|BPF_LEN:
-				MOVodd(EDX, RBP, -8);
+				MOVoqd(-8, RBP, EDX);
 				break;
 
 			case BPF_LD|BPF_W|BPF_IND:
-				MOVid(ECX, ins->k);
-				ADDrd(ECX, EDX);
-				MOVrd(ESI, ECX);
-				ADDib(ECX, sizeof(int));
-				CMPodd(ECX, RBP, -12);
+				MOVid(ins->k, ECX);
+				ADDrd(EDX, ECX);
+				MOVrd(ECX, ESI);
+				ADDib(sizeof(int), ECX);
+				CMPoqd(-12, RBP, ECX);
 				JLEb(5);
-				ZERO_EAX();
+				ZEROrd(EAX);
 				POP(RBX);
 				LEAVE_RET();
-				MOVobd(EAX, RBX, RSI);
+				MOVobd(RBX, RSI, EAX);
 				BSWAP(EAX);
 				break;
 
 			case BPF_LD|BPF_H|BPF_IND:
-				ZERO_EAX();
-				MOVid(ECX, ins->k);
-				ADDrd(ECX, EDX);
-				MOVrd(ESI, ECX);
-				ADDib(ECX, sizeof(short));
-				CMPodd(ECX, RBP, -12);
+				ZEROrd(EAX);
+				MOVid(ins->k, ECX);
+				ADDrd(EDX, ECX);
+				MOVrd(ECX, ESI);
+				ADDib(sizeof(short), ECX);
+				CMPoqd(-12, RBP, ECX);
 				JLEb(3);
 				POP(RBX);
 				LEAVE_RET();
-				MOVobw(AX, RBX, RSI);
+				MOVobw(RBX, RSI, AX);
 				SWAP_AX();
 				break;
 
 			case BPF_LD|BPF_B|BPF_IND:
-				ZERO_EAX();
-				MOVid(ECX, ins->k);
-				ADDrd(ECX, EDX);
-				CMPodd(ECX, RBP, -12);
+				ZEROrd(EAX);
+				MOVid(ins->k, ECX);
+				ADDrd(EDX, ECX);
+				CMPoqd(-12, RBP, ECX);
 				JLEb(3);
 				POP(RBX);
 				LEAVE_RET();
-				MOVobb(AL, RBX, RCX);
+				MOVobb(RBX, RCX, AL);
 				break;
 
 			case BPF_LDX|BPF_MSH|BPF_B:
-				MOVid(ECX, ins->k);
-				CMPodd(ECX, RBP, -12);
+				MOVid(ins->k, ECX);
+				CMPoqd(-12, RBP, ECX);
 				JLEb(5);
-				ZERO_EAX();
+				ZEROrd(EAX);
 				POP(RBX);
 				LEAVE_RET();
-				ZERO_EDX();
-				MOVobb(DL, RBX, RCX);
-				ANDib(DL, 0xf);
-				SHLib(EDX, 2);
+				ZEROrd(EDX);
+				MOVobb(RBX, RCX, DL);
+				ANDib(0xf, DL);
+				SHLib(2, EDX);
 				break;
 
 			case BPF_LD|BPF_IMM:
-				MOVid(EAX, ins->k);
+				MOVid(ins->k, EAX);
 				break;
 
 			case BPF_LDX|BPF_IMM:
-				MOVid(EDX, ins->k);
+				MOVid(ins->k, EDX);
 				break;
 
 			case BPF_LD|BPF_MEM:
-				MOViq(RCX, (uintptr_t)mem);
-				MOVid(ESI, ins->k * 4);
-				MOVobd(EAX, RCX, RSI);
+				MOViq((uintptr_t)mem, RCX);
+				MOVid(ins->k * 4, ESI);
+				MOVobd(RCX, RSI, EAX);
 				break;
 
 			case BPF_LDX|BPF_MEM:
-				MOViq(RCX, (uintptr_t)mem);
-				MOVid(ESI, ins->k * 4);
-				MOVobd(EDX, RCX, RSI);
+				MOViq((uintptr_t)mem, RCX);
+				MOVid(ins->k * 4, ESI);
+				MOVobd(RCX, RSI, EDX);
 				break;
 
 			case BPF_ST:
@@ -278,15 +278,15 @@
 				 * be optimized if the previous instruction
 				 * was already of this type
 				 */
-				MOViq(RCX, (uintptr_t)mem);
-				MOVid(ESI, ins->k * 4);
-				MOVomd(RCX, RSI, EAX);
+				MOViq((uintptr_t)mem, RCX);
+				MOVid(ins->k * 4, ESI);
+				MOVomd(EAX, RCX, RSI);
 				break;
 
 			case BPF_STX:
-				MOViq(RCX, (uintptr_t)mem);
-				MOVid(ESI, ins->k * 4);
-				MOVomd(RCX, RSI, EDX);
+				MOViq((uintptr_t)mem, RCX);
+				MOVid(ins->k * 4, ESI);
+				MOVomd(EDX, RCX, RSI);
 				break;
 
 			case BPF_JMP|BPF_JA:
@@ -295,7 +295,7 @@
 				break;
 
 			case BPF_JMP|BPF_JGT|BPF_K:
-				CMPid(EAX, ins->k);
+				CMPid(ins->k, EAX);
 				/* 5 is the size of the following JMP */
 				JG(stream.refs[stream.bpf_pc + ins->jt] -
 				    stream.refs[stream.bpf_pc] + 5 );
@@ -304,7 +304,7 @@
 				break;
 
 			case BPF_JMP|BPF_JGE|BPF_K:
-				CMPid(EAX, ins->k);
+				CMPid(ins->k, EAX);
 				JGE(stream.refs[stream.bpf_pc + ins->jt] -
 				    stream.refs[stream.bpf_pc] + 5);
 				JMP(stream.refs[stream.bpf_pc + ins->jf] -
@@ -312,7 +312,7 @@
 				break;
 
 			case BPF_JMP|BPF_JEQ|BPF_K:
-				CMPid(EAX, ins->k);
+				CMPid(ins->k, EAX);
 				JE(stream.refs[stream.bpf_pc + ins->jt] -
 				    stream.refs[stream.bpf_pc] + 5);
 				JMP(stream.refs[stream.bpf_pc + ins->jf] -
@@ -320,8 +320,8 @@
 				break;
 
 			case BPF_JMP|BPF_JSET|BPF_K:
-				MOVrd(ECX, EAX);
-				ANDid(ECX, ins->k);
+				MOVrd(EAX, ECX);
+				ANDid(ins->k, ECX);
 				JE(stream.refs[stream.bpf_pc + ins->jf] -
 				    stream.refs[stream.bpf_pc] + 5);
 				JMP(stream.refs[stream.bpf_pc + ins->jt] -
@@ -329,7 +329,7 @@
 				break;
 
 			case BPF_JMP|BPF_JGT|BPF_X:
-				CMPrd(EAX, EDX);
+				CMPrd(EDX, EAX);
 				JA(stream.refs[stream.bpf_pc + ins->jt] -
 				    stream.refs[stream.bpf_pc] + 5);
 				JMP(stream.refs[stream.bpf_pc + ins->jf] -
@@ -337,7 +337,7 @@
 				break;
 
 			case BPF_JMP|BPF_JGE|BPF_X:
-				CMPrd(EAX, EDX);
+				CMPrd(EDX, EAX);
 				JAE(stream.refs[stream.bpf_pc + ins->jt] -
 				    stream.refs[stream.bpf_pc] + 5);
 				JMP(stream.refs[stream.bpf_pc + ins->jf] -
@@ -345,7 +345,7 @@
 				break;
 
 			case BPF_JMP|BPF_JEQ|BPF_X:
-				CMPrd(EAX, EDX);
+				CMPrd(EDX, EAX);
 				JE(stream.refs[stream.bpf_pc + ins->jt] -
 				    stream.refs[stream.bpf_pc] + 5);
 				JMP(stream.refs[stream.bpf_pc + ins->jf] -
@@ -353,8 +353,8 @@
 				break;
 
 			case BPF_JMP|BPF_JSET|BPF_X:
-				MOVrd(ECX, EAX);
-				ANDrd(ECX, EDX);
+				MOVrd(EAX, ECX);
+				ANDrd(EDX, ECX);
 				JE(stream.refs[stream.bpf_pc + ins->jf] -
 				    stream.refs[stream.bpf_pc] + 5);
 				JMP(stream.refs[stream.bpf_pc + ins->jt] -
@@ -362,46 +362,46 @@
 				break;
 
 			case BPF_ALU|BPF_ADD|BPF_X:
-				ADDrd(EAX, EDX);
+				ADDrd(EDX, EAX);
 				break;
 
 			case BPF_ALU|BPF_SUB|BPF_X:
-				SUBrd(EAX, EDX);
+				SUBrd(EDX, EAX);
 				break;
 
 			case BPF_ALU|BPF_MUL|BPF_X:
+				MOVrd(EDX, ECX);
+				MULrd(EDX);
 				MOVrd(ECX, EDX);
-				MULrd(EDX);
-				MOVrd(EDX, ECX);
 				break;
 
 			case BPF_ALU|BPF_DIV|BPF_X:
-				CMPid(EDX, 0);
+				CMPid(0, EDX);
 				JNEb(5);
-				ZERO_EAX();
+				ZEROrd(EAX);
 				POP(RBX);
 				LEAVE_RET();
+				MOVrd(EDX, ECX);
+				ZEROrd(EDX);
+				DIVrd(ECX);
 				MOVrd(ECX, EDX);
-				ZERO_EDX();
-				DIVrd(ECX);
-				MOVrd(EDX, ECX);
 				break;
 
 			case BPF_ALU|BPF_AND|BPF_X:
-				ANDrd(EAX, EDX);
+				ANDrd(EDX, EAX);
 				break;
 
 			case BPF_ALU|BPF_OR|BPF_X:
-				ORrd(EAX, EDX);
+				ORrd(EDX, EAX);
 				break;
 
 			case BPF_ALU|BPF_LSH|BPF_X:
-				MOVrd(ECX, EDX);
+				MOVrd(EDX, ECX);
 				SHL_CLrb(EAX);
 				break;
 
 			case BPF_ALU|BPF_RSH|BPF_X:
-				MOVrd(ECX, EDX);
+				MOVrd(EDX, ECX);
 				SHR_CLrb(EAX);
 				break;
 
@@ -414,34 +414,34 @@
 				break;
 
 			case BPF_ALU|BPF_MUL|BPF_K:
+				MOVrd(EDX, ECX);
+				MOVid(ins->k, EDX);
+				MULrd(EDX);
 				MOVrd(ECX, EDX);
-				MOVid(EDX, ins->k);
-				MULrd(EDX);
-				MOVrd(EDX, ECX);
 				break;
 
 			case BPF_ALU|BPF_DIV|BPF_K:
+				MOVrd(EDX, ECX);
+				ZEROrd(EDX);
+				MOVid(ins->k, ESI);
+				DIVrd(ESI);
 				MOVrd(ECX, EDX);
-				ZERO_EDX();
-				MOVid(ESI, ins->k);
-				DIVrd(ESI);
-				MOVrd(EDX, ECX);
 				break;
 
 			case BPF_ALU|BPF_AND|BPF_K:
-				ANDid(EAX, ins->k);
+				ANDid(ins->k, EAX);
 				break;
 
 			case BPF_ALU|BPF_OR|BPF_K:
-				ORid(EAX, ins->k);
+				ORid(ins->k, EAX);
 				break;
 
 			case BPF_ALU|BPF_LSH|BPF_K:
-				SHLib(EAX, (ins->k) & 255);
+				SHLib((ins->k) & 0xff, EAX);
 				break;
 
 			case BPF_ALU|BPF_RSH|BPF_K:
-				SHRib(EAX, (ins->k) & 255);
+				SHRib((ins->k) & 0xff, EAX);
 				break;
 
 			case BPF_ALU|BPF_NEG:
@@ -449,11 +449,11 @@
 				break;
 
 			case BPF_MISC|BPF_TAX:
-				MOVrd(EDX, EAX);
+				MOVrd(EAX, EDX);
 				break;
 
 			case BPF_MISC|BPF_TXA:
-				MOVrd(EAX, EDX);
+				MOVrd(EDX, EAX);
 				break;
 			}
 			ins++;

==== //depot/projects/vimage-commit/src/sys/amd64/amd64/bpf_jit_machdep.h#2 (text+ko) ====

@@ -28,7 +28,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/amd64/bpf_jit_machdep.h,v 1.3 2005/12/06 20:11:07 jkim Exp $
+ * $FreeBSD: src/sys/amd64/amd64/bpf_jit_machdep.h,v 1.5 2008/06/24 20:12:12 jkim Exp $
  */
 
 #ifndef _BPF_JIT_MACHDEP_H_
@@ -104,254 +104,252 @@
  * native Instruction Macros
  */
 
-/* mov r32,i32 */
-#define MOVid(r32, i32) do {						\
+/* movl i32,r32 */
+#define MOVid(i32, r32) do {						\
 	emitm(&stream, (11 << 4) | (1 << 3) | (r32 & 0x7), 1);		\
 	emitm(&stream, i32, 4);						\
 } while (0)
 
-/* mov r64,i64 */
-#define MOViq(r64, i64) do {						\
+/* movq i64,r64 */
+#define MOViq(i64, r64) do {						\
 	emitm(&stream, 0x48, 1);					\
 	emitm(&stream, (11 << 4) | (1 << 3) | (r64 & 0x7), 1);		\
 	emitm(&stream, i64, 4);						\
 	emitm(&stream, (i64 >> 32), 4);					\
 } while (0)
 
-/* mov dr32,sr32 */
-#define MOVrd(dr32, sr32) do {						\
-	emitm(&stream, (8 << 4) | 3 | (1 << 3), 1);			\
+/* movl sr32,dr32 */
+#define MOVrd(sr32, dr32) do {						\
+	emitm(&stream, 0x89, 1);					\
 	emitm(&stream,							\
-	    (3 << 6) | ((dr32 & 0x7) << 3) | (sr32 & 0x7), 1);		\
+	    (3 << 6) | ((sr32 & 0x7) << 3) | (dr32 & 0x7), 1);		\
 } while (0)
 
-/* mov dr64,sr64 */
-#define MOVrq(dr64, sr64) do {						\
-	emitm(&stream, 0x48, 1);					\
-	emitm(&stream, (8 << 4) | 3 | (1 << 3), 1);			\
+/* movq sr64,dr64 */
+#define MOVrq(sr64, dr64) do {						\
+	emitm(&stream, 0x8948, 2);					\
 	emitm(&stream,							\
-	    (3 << 6) | ((dr64 & 0x7) << 3) | (sr64 & 0x7), 1);		\
+	    (3 << 6) | ((sr64 & 0x7) << 3) | (dr64 & 0x7), 1);		\
 } while (0)
 
-/* mov dr32,sr64[off] */
-#define MOVodd(dr32, sr64, off) do {					\
-	emitm(&stream, (8 << 4) | 3 | (1 << 3), 1);			\
+/* movl off(sr64),dr32 */
+#define MOVoqd(off, sr64, dr32) do {					\
+	emitm(&stream, 0x8b, 1);					\
 	emitm(&stream,							\
 	    (1 << 6) | ((dr32 & 0x7) << 3) | (sr64 & 0x7), 1);		\
 	emitm(&stream, off, 1);						\
 } while (0)
 
-/* mov dr64[off],sr32 */
-#define MOVoqd(dr64, off, sr32) do {					\
-	emitm(&stream, (8 << 4) | 1 | (1 << 3), 1);			\
+/* movl sr32,off(dr64) */
+#define MOVdoq(sr32, off, dr64) do {					\
+	emitm(&stream, 0x89, 1);					\
 	emitm(&stream,							\
 	    (1 << 6) | ((sr32 & 0x7) << 3) | (dr64 & 0x7), 1);		\
 	emitm(&stream, off, 1);						\
 } while (0)
 
-/* mov dr32,sr64[or64] */
-#define MOVobd(dr32, sr64, or64) do {					\
-	emitm(&stream, (8 << 4) | 3 | (1 << 3), 1);			\
+/* movl (sr64,or64,1),dr32 */
+#define MOVobd(sr64, or64, dr32) do {					\
+	emitm(&stream, 0x8b, 1);					\
 	emitm(&stream, ((dr32 & 0x7) << 3) | 4, 1);			\
 	emitm(&stream, ((or64 & 0x7) << 3) | (sr64 & 0x7), 1);		\
 } while (0)
 
-/* mov dr16,sr64[or64] */
-#define MOVobw(dr32, sr64, or64) do {					\
-	emitm(&stream, 0x66, 1);					\
-	emitm(&stream, (8 << 4) | 3 | (1 << 3), 1);			\
-	emitm(&stream, ((dr32 & 0x7) << 3) | 4, 1);			\
+/* movw (sr64,or64,1),dr16 */
+#define MOVobw(sr64, or64, dr16) do {					\
+	emitm(&stream, 0x8b66, 2);					\
+	emitm(&stream, ((dr16 & 0x7) << 3) | 4, 1);			\
 	emitm(&stream, ((or64 & 0x7) << 3) | (sr64 & 0x7), 1);		\
 } while (0)
 
-/* mov dr8,sr64[or64] */
-#define MOVobb(dr8, sr64, or64) do {					\
+/* movb (sr64,or64,1),dr8 */
+#define MOVobb(sr64, or64, dr8) do {					\
 	emitm(&stream, 0x8a, 1);					\
 	emitm(&stream, ((dr8 & 0x7) << 3) | 4, 1);			\
 	emitm(&stream, ((or64 & 0x7) << 3) | (sr64 & 0x7), 1);		\
 } while (0)
 
-/* mov [dr64][or64],sr32 */
-#define MOVomd(dr64, or64, sr32) do {					\
+/* movl sr32,(dr64,or64,1) */
+#define MOVomd(sr32, dr64, or64) do {					\
 	emitm(&stream, 0x89, 1);					\
 	emitm(&stream, ((sr32 & 0x7) << 3) | 4, 1);			\
 	emitm(&stream, ((or64 & 0x7) << 3) | (dr64 & 0x7), 1);		\
 } while (0)
 
-/* bswap dr32 */
+/* bswapl dr32 */
 #define BSWAP(dr32) do {						\
 	emitm(&stream, 0xf, 1);						\
 	emitm(&stream, (0x19 << 3) | dr32, 1);				\
 } while (0)
 
-/* xchg al,ah */
+/* xchgb %al,%ah */
 #define SWAP_AX() do {							\
-	emitm(&stream, 0x86, 1);					\
-	emitm(&stream, 0xc4, 1);					\
+	emitm(&stream, 0xc486, 2);					\
 } while (0)
 
-/* push r64 */
+/* pushq r64 */
 #define PUSH(r64) do {							\
 	emitm(&stream, (5 << 4) | (0 << 3) | (r64 & 0x7), 1);		\
 } while (0)
 
-/* pop r64 */
+/* popq r64 */
 #define POP(r64) do {							\
 	emitm(&stream, (5 << 4) | (1 << 3) | (r64 & 0x7), 1);		\
 } while (0)
 
-/* leave/ret */
+/* leaveq/retq */
 #define LEAVE_RET() do {						\
-	emitm(&stream, 0xc9, 1);					\
-	emitm(&stream, 0xc3, 1);					\
+	emitm(&stream, 0xc3c9, 2);					\
 } while (0)
 
-/* add dr32,sr32 */
-#define ADDrd(dr32, sr32) do {						\
-	emitm(&stream, 0x03, 1);					\
+/* addl sr32,dr32 */
+#define ADDrd(sr32, dr32) do {						\
+	emitm(&stream, 0x01, 1);					\
 	emitm(&stream,							\
-	    (3 << 6) | ((dr32 & 0x7) << 3) | (sr32 & 0x7), 1);	\
+	    (3 << 6) | ((sr32 & 0x7) << 3) | (dr32 & 0x7), 1);		\
 } while (0)
 
-/* add eax,i32 */
+/* addl i32,%eax */
 #define ADD_EAXi(i32) do {						\
 	emitm(&stream, 0x05, 1);					\
 	emitm(&stream, i32, 4);						\
 } while (0)
 
-/* add r32,i32 */
-#define ADDid(r32, i32) do {						\
+/* addl i32,r32 */
+#define ADDid(i32, r32) do {						\
 	emitm(&stream, 0x81, 1);					\
 	emitm(&stream, (24 << 3) | r32, 1);				\
 	emitm(&stream, i32, 4);						\
 } while (0)
 
-/* add r32,i8 */
-#define ADDib(r32, i8) do {						\
+/* addl i8,r32 */
+#define ADDib(i8, r32) do {						\
 	emitm(&stream, 0x83, 1);					\
 	emitm(&stream, (24 << 3) | r32, 1);				\
 	emitm(&stream, i8, 1);						\
 } while (0)
 
-/* sub dr32,sr32 */
-#define SUBrd(dr32, sr32) do {						\
-	emitm(&stream, 0x2b, 1);					\
+/* subl sr32,dr32 */
+#define SUBrd(sr32, dr32) do {						\
+	emitm(&stream, 0x29, 1);					\
 	emitm(&stream,							\
-	    (3 << 6) | ((dr32 & 0x7) << 3) | (sr32 & 0x7), 1);		\
+	    (3 << 6) | ((sr32 & 0x7) << 3) | (dr32 & 0x7), 1);		\
 } while (0)
 
-/* sub eax,i32 */
+/* subl i32,%eax */
 #define SUB_EAXi(i32) do {						\
 	emitm(&stream, 0x2d, 1);					\
 	emitm(&stream, i32, 4);						\
 } while (0)
 
-/* mul r32 */
+/* mull r32 */
 #define MULrd(r32) do {							\
 	emitm(&stream, 0xf7, 1);					\
 	emitm(&stream, (7 << 5) | (r32 & 0x7), 1);			\
 } while (0)
 
-/* div r32 */
+/* divl r32 */
 #define DIVrd(r32) do {							\
 	emitm(&stream, 0xf7, 1);					\
 	emitm(&stream, (15 << 4) | (r32 & 0x7), 1);			\
 } while (0)
 
-/* and r8,i8 */
-#define ANDib(r8, i8) do {						\
-	emitm(&stream, 0x80, 1);					\
-	emitm(&stream, (7 << 5) | r8, 1);				\
+/* andb i8,r8 */
+#define ANDib(i8, r8) do {						\
+	if (r8 == AL) {							\
+		emitm(&stream, 0x24, 1);				\
+	} else {							\
+		emitm(&stream, 0x80, 1);				\
+		emitm(&stream, (7 << 5) | r8, 1);			\
+	}								\
 	emitm(&stream, i8, 1);						\
 } while (0)
 
-/* and r32,i32 */
-#define ANDid(r32, i32) do {						\
+/* andl i32,r32 */
+#define ANDid(i32, r32) do {						\
 	if (r32 == EAX) {						\
 		emitm(&stream, 0x25, 1);				\
-		emitm(&stream, i32, 4);					\
 	} else {							\
 		emitm(&stream, 0x81, 1);				\
 		emitm(&stream, (7 << 5) | r32, 1);			\
-		emitm(&stream, i32, 4);					\
 	}								\
+	emitm(&stream, i32, 4);						\
 } while (0)
 
-/* and dr32,sr32 */
-#define ANDrd(dr32, sr32) do {						\
-	emitm(&stream, 0x23, 1);					\
+/* andl sr32,dr32 */
+#define ANDrd(sr32, dr32) do {						\
+	emitm(&stream, 0x21, 1);					\
 	emitm(&stream,							\
-	    (3 << 6) | ((dr32 & 0x7) << 3) | (sr32 & 0x7), 1);		\
+	    (3 << 6) | ((sr32 & 0x7) << 3) | (dr32 & 0x7), 1);		\
 } while (0)
 
-/* or dr32,sr32 */
-#define ORrd(dr32, sr32) do {						\
-	emitm(&stream, 0x0b, 1);					\
+/* orl sr32,dr32 */
+#define ORrd(sr32, dr32) do {						\
+	emitm(&stream, 0x09, 1);					\
 	emitm(&stream,							\
-	    (3 << 6) | ((dr32 & 0x7) << 3) | (sr32 & 0x7), 1);		\
+	    (3 << 6) | ((sr32 & 0x7) << 3) | (dr32 & 0x7), 1);		\
 } while (0)
 
-/* or r32,i32 */
-#define ORid(r32, i32) do {						\
+/* orl i32,r32 */
+#define ORid(i32, r32) do {						\
 	if (r32 == EAX) {						\
 		emitm(&stream, 0x0d, 1);				\
-		emitm(&stream, i32, 4);					\
 	} else {							\
 		emitm(&stream, 0x81, 1);				\
 		emitm(&stream, (25 << 3) | r32, 1);			\
-		emitm(&stream, i32, 4);					\
 	}								\
+	emitm(&stream, i32, 4);						\
 } while (0)
 
-/* shl r32,i8 */
-#define SHLib(r32, i8) do {						\
+/* shll i8,r32 */
+#define SHLib(i8, r32) do {						\
 	emitm(&stream, 0xc1, 1);					\
 	emitm(&stream, (7 << 5) | (r32 & 0x7), 1);			\
 	emitm(&stream, i8, 1);						\
 } while (0)
 
-/* shl dr32,cl */
+/* shll %cl,dr32 */
 #define SHL_CLrb(dr32) do {						\
 	emitm(&stream, 0xd3, 1);					\
 	emitm(&stream, (7 << 5) | (dr32 & 0x7), 1);			\
 } while (0)
 
-/* shr r32,i8 */
-#define SHRib(r32, i8) do {						\
+/* shrl i8,r32 */
+#define SHRib(i8, r32) do {						\
 	emitm(&stream, 0xc1, 1);					\
 	emitm(&stream, (29 << 3) | (r32 & 0x7), 1);			\
 	emitm(&stream, i8, 1);						\
 } while (0)
 
-/* shr dr32,cl */
+/* shrl %cl,dr32 */
 #define SHR_CLrb(dr32) do {						\
 	emitm(&stream, 0xd3, 1);					\
 	emitm(&stream, (29 << 3) | (dr32 & 0x7), 1);			\
 } while (0)
 
-/* neg r32 */
+/* negl r32 */
 #define NEGd(r32) do {							\
 	emitm(&stream, 0xf7, 1);					\
 	emitm(&stream, (27 << 3) | (r32 & 0x7), 1);			\
 } while (0)
 
-/* cmp dr32,sr64[off] */
-#define CMPodd(dr32, sr64, off) do {					\
-	emitm(&stream, (3 << 4) | 3 | (1 << 3), 1);			\
+/* cmpl off(sr64),dr32 */
+#define CMPoqd(off, sr64, dr32) do {					\
+	emitm(&stream, 0x3b, 1);					\
 	emitm(&stream,							\
 	    (1 << 6) | ((dr32 & 0x7) << 3) | (sr64 & 0x7), 1);		\
 	emitm(&stream, off, 1);						\
 } while (0)
 
-/* cmp dr32,sr32 */
-#define CMPrd(dr32, sr32) do {						\
-	emitm(&stream, 0x3b, 1);					\
+/* cmpl sr32,dr32 */
+#define CMPrd(sr32, dr32) do {						\
+	emitm(&stream, 0x39, 1);					\
 	emitm(&stream,							\
-	    (3 << 6) | ((dr32 & 0x7) << 3) | (sr32 & 0x7), 1);		\
+	    (3 << 6) | ((sr32 & 0x7) << 3) | (dr32 & 0x7), 1);		\
 } while (0)
 
-/* cmp dr32,i32 */
-#define CMPid(dr32, i32) do {						\
+/* cmpl i32,dr32 */
+#define CMPid(i32, dr32) do {						\
 	if (dr32 == EAX){						\
 		emitm(&stream, 0x3d, 1);				\
 		emitm(&stream, i32, 4);					\
@@ -362,7 +360,7 @@
 	}								\
 } while (0)
 
-/* jne off32 */
+/* jne off8 */
 #define JNEb(off8) do {							\
 	emitm(&stream, 0x75, 1);					\
 	emitm(&stream, off8, 1);					\
@@ -370,15 +368,13 @@
 
 /* je off32 */
 #define JE(off32) do {							\
-	emitm(&stream, 0x0f, 1);					\
-	emitm(&stream, 0x84, 1);					\
+	emitm(&stream, 0x840f, 2);					\
 	emitm(&stream, off32, 4);					\
 } while (0)
 
 /* jle off32 */
 #define JLE(off32) do {							\
-	emitm(&stream, 0x0f, 1);					\
-	emitm(&stream, 0x8e, 1);					\
+	emitm(&stream, 0x8e0f, 2);					\
 	emitm(&stream, off32, 4);					\
 } while (0)
 
@@ -390,29 +386,25 @@
 
 /* ja off32 */
 #define JA(off32) do {							\
-	emitm(&stream, 0x0f, 1);					\
-	emitm(&stream, 0x87, 1);					\
+	emitm(&stream, 0x870f, 2);					\
 	emitm(&stream, off32, 4);					\
 } while (0)
 
 /* jae off32 */
 #define JAE(off32) do {							\
-	emitm(&stream, 0x0f, 1);					\
-	emitm(&stream, 0x83, 1);					\
+	emitm(&stream, 0x830f, 2);					\
 	emitm(&stream, off32, 4);					\
 } while (0)
 
 /* jg off32 */
 #define JG(off32) do {							\
-	emitm(&stream, 0x0f, 1);					\
-	emitm(&stream, 0x8f, 1);					\
+	emitm(&stream, 0x8f0f, 2);					\
 	emitm(&stream, off32, 4);					\
 } while (0)
 
 /* jge off32 */
 #define JGE(off32) do {							\
-	emitm(&stream, 0x0f, 1);					\
-	emitm(&stream, 0x8d, 1);					\
+	emitm(&stream, 0x8d0f, 2);					\
 	emitm(&stream, off32, 4);					\

>>> TRUNCATED FOR MAIL (1000 lines) <<<


More information about the p4-projects mailing list