+ cpu_subtype_t hostsubtype = cpu_subtype();
+
+ switch (exectype) {
+ case CPU_TYPE_X86_64: /* native 64-bit */
+ switch (hostsubtype) {
+ case CPU_SUBTYPE_X86_64_H: /* x86_64h can execute anything */
+ switch (execsubtype) {
+ case CPU_SUBTYPE_X86_64_H:
+ return 3;
+ case CPU_SUBTYPE_X86_64_ALL:
+ return 2;
+ }
+ break;
+ case CPU_SUBTYPE_X86_ARCH1: /* generic systems can only execute ALL subtype */
+ switch (execsubtype) {
+ case CPU_SUBTYPE_X86_64_ALL:
+ return 2;
+ }
+ break;
+ }
+ break;
+ case CPU_TYPE_X86: /* native */
+#if __x86_64__
+ if (bootarg_no32exec && !allow_simulator_binary) {
+ return 0;
+ }
+#endif