Skip to content

Commit

Permalink
Merge branch 'ish-app-master' into dev
Browse files Browse the repository at this point in the history
Merged upstream
  • Loading branch information
Mike Miller committed Oct 25, 2022
2 parents 410615e + 4daeff3 commit 568eee3
Show file tree
Hide file tree
Showing 12 changed files with 186 additions and 51 deletions.
2 changes: 1 addition & 1 deletion deps/aports/community/x86/index.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
APKINDEX-v3.14-2022-10-01.tar.gz
APKINDEX-v3.14-2022-10-22.tar.gz
2 changes: 1 addition & 1 deletion deps/aports/main/x86/index.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
APKINDEX-v3.14-2022-10-09.tar.gz
APKINDEX-v3.14-2022-10-22.tar.gz
32 changes: 19 additions & 13 deletions emu/decode.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,15 +269,18 @@ __no_instrument DECODER_RET glue(DECODER_NAME, OP_SIZE)(DECODER_ARGS) {
READMODRM; VMOV(xmm_modrm_val, xmm_modrm_reg,128); break;
case 0x11: TRACEI("movupd xmm, xmm:modrm");
READMODRM; VMOV(xmm_modrm_reg, xmm_modrm_val,128); break;
case 0x12: TRACEI("movlpd xmm, xmm:modrm");
READMODRM; V_OP(movl_pd, xmm_modrm_val, xmm_modrm_reg,128); break;
case 0x13: TRACEI("movlpd xmm:modrm, reg");
READMODRM; V_OP(movl_mem_pd, xmm_modrm_val, modrm_reg,128); break;
case 0x12: TRACEI("movlpd xmm, modrm");
READMODRM; V_OP(movl_p, modrm_val, xmm_modrm_reg,64); break;
case 0x13: TRACEI("movlpd modrm, xmm");
READMODRM; V_OP(movl_pm, xmm_modrm_reg, modrm_val,64); break;
case 0x14: TRACEI("unpcklpd xmm, xmm:modrm");
READMODRM; V_OP(unpackl_pd, xmm_modrm_val, xmm_modrm_reg,128); break;
case 0x15: TRACEI("unpckhpd xmm, xmm:modrm");
READMODRM; V_OP(unpackh_pd, xmm_modrm_val, xmm_modrm_reg,128); break;

case 0x16: TRACEI("movhpd xmm, modrm");
READMODRM; V_OP(movh_p, modrm_val, xmm_modrm_reg,64); break;
case 0x17: TRACEI("movhpd modrm, xmm");
READMODRM; V_OP(movh_pm, xmm_modrm_reg, modrm_val,64); break;
case 0x2e: TRACEI("ucomisd xmm, xmm:modrm");
READMODRM; V_OP(single_ucomi, xmm_modrm_val, xmm_modrm_reg,64); break;
case 0x2f: TRACEI("comisd xmm, xmm:modrm");
Expand Down Expand Up @@ -427,8 +430,8 @@ __no_instrument DECODER_RET glue(DECODER_NAME, OP_SIZE)(DECODER_ARGS) {
READMODRM; V_OP(mulu, xmm_modrm_val, xmm_modrm_reg, 128); break;
case 0xe6: TRACEI("cvttpd2dq xmm:modrm, xmm");
READMODRM; V_OP(cvttpd2dq, xmm_modrm_val, xmm_modrm_reg,64); break;
case 0xe7: TRACEI("movntdq xmm:modrm, xmm");
READMODRM_MEM; VMOV(xmm_modrm_reg, xmm_modrm_val,128); break;
case 0xe7: TRACEI("movntdq xmm, xmm:modrm");
READMODRM; VMOV(xmm_modrm_reg, xmm_modrm_val,128); break;
case 0xe8: TRACEI("psubsb xmm:modrm, xmm");
READMODRM; V_OP(subss_b, xmm_modrm_val, xmm_modrm_reg,128); break;
case 0xe9: TRACEI("psubsw xmm:modrm, xmm");
Expand Down Expand Up @@ -472,14 +475,18 @@ __no_instrument DECODER_RET glue(DECODER_NAME, OP_SIZE)(DECODER_ARGS) {
READMODRM; VMOV(xmm_modrm_val, xmm_modrm_reg,128); break;
case 0x11: TRACEI("movups xmm, xmm:modrm");
READMODRM; VMOV(xmm_modrm_reg, xmm_modrm_val,128); break;

case 0x12: TRACEI("movlps xmm, modrm");
READMODRM; V_OP(movl_p, modrm_val, xmm_modrm_reg,64); break;
case 0x13: TRACEI("movlps modrm, xmm");
READMODRM; V_OP(movl_pm, xmm_modrm_reg, modrm_val,64); break;
case 0x14: TRACEI("unpcklps xmm, xmm:modrm");
READMODRM; V_OP(unpackl_ps, xmm_modrm_val, xmm_modrm_reg,128); break;
case 0x15: TRACEI("unpckhps xmm, xmm:modrm");
READMODRM; V_OP(unpackh_ps, xmm_modrm_val, xmm_modrm_reg,128); break;
case 0x16: TRACEI("movlhps xmm, xmm:modrm");
READMODRM; V_OP(movlh_ps, xmm_modrm_val, xmm_modrm_reg,128); break;

case 0x16: TRACEI("movhps xmm, modrm");
READMODRM; V_OP(movh_p, modrm_val, xmm_modrm_reg,64); break;
case 0x17: TRACEI("movhps modrm, xmm");
READMODRM; V_OP(movh_pm, xmm_modrm_reg, modrm_val,64); break;
case 0x2e: TRACEI("ucomiss xmm, xmm:modrm");
READMODRM; V_OP(single_ucomi, xmm_modrm_val, xmm_modrm_reg,32); break;
case 0x2f: TRACEI("comiss xmm, xmm:modrm");
Expand Down Expand Up @@ -537,9 +544,8 @@ __no_instrument DECODER_RET glue(DECODER_NAME, OP_SIZE)(DECODER_ARGS) {

case 0xe5: TRACEI("pmulhw mm:modrm, mm");
READMODRM; V_OP(mulu, mm_modrm_val, mm_modrm_reg,64); break;
case 0xe7: TRACEI("movntq mm:modrm, mm");
case 0xe7: TRACEI("movntq mm, mm:modrm");
READMODRM_MEM; VMOV(mm_modrm_reg, mm_modrm_val,64); break;

case 0xef: TRACEI("pxor mm:modrm, mm");
READMODRM; V_OP(xor, mm_modrm_val, mm_modrm_reg,64); break;

Expand Down
15 changes: 9 additions & 6 deletions emu/vec.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,6 @@ void vec_unpackh_pd128(NO_CPU, const union xmm_reg *src, union xmm_reg *dst) {
dst->f64[0] = dst->f64[1];
dst->f64[1] = src->f64[1];
}
void vec_movlh_ps128(NO_CPU, union xmm_reg *src, union xmm_reg *dst) {
dst->qw[1] = src->qw[0];
}

void vec_packss_w128(NO_CPU, const union xmm_reg *src, union xmm_reg *dst) {
dst->u32[0] = (satsw(dst->u16[0]) << 0x00) | (satsw(dst->u16[1]) << 0x08) |
Expand Down Expand Up @@ -672,12 +669,18 @@ void vec_fmovmask_d128(NO_CPU, const union xmm_reg *src, uint32_t *dst) {
}
}

void vec_movl_pd128(NO_CPU, const union xmm_reg *src, union xmm_reg *dst) {
dst->qw[0] = src->qw[0];
void vec_movl_p64(NO_CPU, const uint64_t *src, union xmm_reg *dst) {
dst->qw[0] = *src;
}
void vec_movl_mem_pd128(NO_CPU, const union xmm_reg *src, uint64_t *dst) {
void vec_movl_pm64(NO_CPU, const union xmm_reg *src, uint64_t *dst) {
*dst = src->qw[0];
}
void vec_movh_p64(NO_CPU, const uint64_t *src, union xmm_reg *dst) {
dst->qw[1] = *src;
}
void vec_movh_pm64(NO_CPU, const union xmm_reg *src, uint64_t *dst) {
*dst = src->qw[1];
}

void vec_extract_w128(NO_CPU, const union xmm_reg *src, uint32_t *dst, uint8_t index) {
*dst = src->u16[index % 8];
Expand Down
7 changes: 6 additions & 1 deletion emu/vec.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void vec_unpackh_d128(NO_CPU, const union xmm_reg *src, union xmm_reg *dst);
void vec_unpackh_dq128(NO_CPU, const union xmm_reg *src, union xmm_reg *dst);
void vec_unpackh_ps128(NO_CPU, const union xmm_reg *src, union xmm_reg *dst);
void vec_unpackh_pd128(NO_CPU, const union xmm_reg *src, union xmm_reg *dst);
void vec_movlh_ps128(NO_CPU, union xmm_reg *src, union xmm_reg *dst);

void vec_shuffle_lw128(NO_CPU, const union xmm_reg *src, union xmm_reg *dst, uint8_t encoding);
void vec_shuffle_hw128(NO_CPU, const union xmm_reg *src, union xmm_reg *dst, uint8_t encoding);
void vec_shuffle_d128(NO_CPU, const union xmm_reg *src, union xmm_reg *dst, uint8_t encoding);
Expand All @@ -141,6 +141,11 @@ void vec_compares_gtd128(NO_CPU, const union xmm_reg *src, union xmm_reg *dst);

void vec_movl_pd128(NO_CPU, const union xmm_reg *src, union xmm_reg *dst);
void vec_movl_mem_pd128(NO_CPU, const union xmm_reg *src, uint64_t *dst);
void vec_movl_p64(NO_CPU, const uint64_t *src, union xmm_reg *dst);
void vec_movl_pm64(NO_CPU, const union xmm_reg *src, uint64_t *dst);
void vec_movh_p64(NO_CPU, const uint64_t *src, union xmm_reg *dst);
void vec_movh_pm64(NO_CPU, const union xmm_reg *src, uint64_t *dst);

void vec_movmask_b128(NO_CPU, const union xmm_reg *src, uint32_t *dst);
void vec_fmovmask_d128(NO_CPU, const union xmm_reg *src, uint32_t *dst);
void vec_extract_w128(NO_CPU, const union xmm_reg *src, uint32_t *dst, uint8_t index);
Expand Down
32 changes: 16 additions & 16 deletions iSH-AOK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2476,7 +2476,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = BB0B85A42586F1CB00208600 /* ProjectDebug.xcconfig */;
buildSettings = {
CURRENT_PROJECT_VERSION = 420;
CURRENT_PROJECT_VERSION = 427;
DEAD_CODE_STRIPPING = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
};
Expand All @@ -2486,7 +2486,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = BB0B85A52586F1E100208600 /* ProjectRelease.xcconfig */;
buildSettings = {
CURRENT_PROJECT_VERSION = 420;
CURRENT_PROJECT_VERSION = 427;
DEAD_CODE_STRIPPING = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
SWIFT_COMPILATION_MODE = wholemodule;
Expand All @@ -2501,7 +2501,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 420;
CURRENT_PROJECT_VERSION = 427;
DEVELOPMENT_TEAM = UYU5FM4LQ4;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -2527,7 +2527,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 420;
CURRENT_PROJECT_VERSION = 427;
DEVELOPMENT_TEAM = UYU5FM4LQ4;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -2548,7 +2548,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = BB28C7532689522C00BDC834 /* ProjectDebugLinux.xcconfig */;
buildSettings = {
CURRENT_PROJECT_VERSION = 420;
CURRENT_PROJECT_VERSION = 427;
DEAD_CODE_STRIPPING = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
};
Expand All @@ -2562,7 +2562,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 420;
CURRENT_PROJECT_VERSION = 427;
DEVELOPMENT_TEAM = UYU5FM4LQ4;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -2586,7 +2586,7 @@
buildSettings = {
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 420;
CURRENT_PROJECT_VERSION = 427;
DEVELOPMENT_TEAM = UYU5FM4LQ4;
PRODUCT_BUNDLE_IDENTIFIER = "app.ish.iSH-AOK";
PRODUCT_NAME = "iSH-AOK";
Expand All @@ -2610,7 +2610,7 @@
CODE_SIGN_ENTITLEMENTS = app/FileProvider/iSHFileProvider.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 420;
CURRENT_PROJECT_VERSION = 427;
DEVELOPMENT_TEAM = UYU5FM4LQ4;
INFOPLIST_FILE = app/FileProvider/Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = "app.ish.iSH-AOK.FileProvider";
Expand Down Expand Up @@ -2720,7 +2720,7 @@
CODE_SIGN_ENTITLEMENTS = app/FileProvider/iSHFileProvider.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 420;
CURRENT_PROJECT_VERSION = 427;
DEVELOPMENT_TEAM = UYU5FM4LQ4;
INFOPLIST_FILE = app/FileProvider/Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = "app.ish.iSH-AOK.FileProvider";
Expand All @@ -2738,7 +2738,7 @@
CODE_SIGN_ENTITLEMENTS = iSHFileProviderRelease.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 420;
CURRENT_PROJECT_VERSION = 427;
DEVELOPMENT_TEAM = UYU5FM4LQ4;
INFOPLIST_FILE = app/FileProvider/Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = "app.ish.iSH-AOK.FileProvider";
Expand Down Expand Up @@ -2841,7 +2841,7 @@
buildSettings = {
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 420;
CURRENT_PROJECT_VERSION = 427;
DEVELOPMENT_TEAM = UYU5FM4LQ4;
PRODUCT_BUNDLE_IDENTIFIER = "app.ish.iSH-AOK";
PRODUCT_NAME = "iSH-AOK";
Expand All @@ -2855,7 +2855,7 @@
buildSettings = {
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 420;
CURRENT_PROJECT_VERSION = 427;
DEVELOPMENT_TEAM = UYU5FM4LQ4;
PRODUCT_BUNDLE_IDENTIFIER = "app.ish.iSH-AOK";
PRODUCT_NAME = "iSH-AOK";
Expand All @@ -2867,7 +2867,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = BB28C7522689522700BDC834 /* ProjectReleaseLinux.xcconfig */;
buildSettings = {
CURRENT_PROJECT_VERSION = 420;
CURRENT_PROJECT_VERSION = 427;
DEAD_CODE_STRIPPING = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
SWIFT_COMPILATION_MODE = wholemodule;
Expand All @@ -2882,7 +2882,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 420;
CURRENT_PROJECT_VERSION = 427;
DEVELOPMENT_TEAM = UYU5FM4LQ4;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -2905,7 +2905,7 @@
buildSettings = {
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 420;
CURRENT_PROJECT_VERSION = 427;
DEVELOPMENT_TEAM = UYU5FM4LQ4;
PRODUCT_BUNDLE_IDENTIFIER = "app.ish.iSH-AOK";
PRODUCT_NAME = "iSH-AOK";
Expand All @@ -2929,7 +2929,7 @@
CODE_SIGN_ENTITLEMENTS = app/FileProvider/iSHFileProvider.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 420;
CURRENT_PROJECT_VERSION = 427;
DEVELOPMENT_TEAM = UYU5FM4LQ4;
INFOPLIST_FILE = app/FileProvider/Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = "app.ish.iSH-AOK.FileProvider";
Expand Down
8 changes: 8 additions & 0 deletions jit/gadgets-aarch64/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,18 @@ NAME(jit_enter):
jit_ret_chain:
cmp _ip, 0
b.lt jit_ret
ldr x8, [_cpu, CPU_poked_ptr]
ldrb w8, [x8]
cmp w8, 0
b.ne poke
sub x8, _ip, JIT_BLOCK_code
str x8, [_cpu, LOCAL_last_block]
gret

poke:
ldr eip, [_ip, -JIT_BLOCK_code+JIT_BLOCK_addr]
# fallthrough

.global jit_ret
jit_ret:
# load -1
Expand Down
16 changes: 8 additions & 8 deletions jit/gadgets-x86_64/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@ NAME(jit_enter):
.global jit_ret_chain
jit_ret_chain:
btq $63, %_ip
jc 1f
jc jit_ret
mov CPU_poked_ptr(%_cpu), %r10
testb $1, (%r10)
cmpb $0, (%r10)
jnz poke
leaq -JIT_BLOCK_code(%_ip), %r10
mov %r10, LOCAL_last_block(%_cpu)
gret
1:
.global jit_ret
jit_ret:
movl $-1, %_tmp
jmp jit_exit

poke:
mov -JIT_BLOCK_code+JIT_BLOCK_addr(%_ip), %_eip
jmp jit_ret
# fallthrough

.global jit_ret
jit_ret:
movl $-1, %_tmp
# fallthrough

.global jit_exit
jit_exit:
Expand Down
2 changes: 1 addition & 1 deletion kernel/calls.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ void handle_interrupt(int interrupt) {
////modify_critical_region_counter(current, -1, __FILE__, __LINE__);
}

void dump_maps() {
void dump_maps(void) {
extern void proc_maps_dump(struct task *task, struct proc_data *buf);
struct proc_data buf = {};
proc_maps_dump(current, &buf);
Expand Down
30 changes: 30 additions & 0 deletions tests/e2e/qemu/expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4696,3 +4696,33 @@ cvttsd2si: a=c00b3333333333334004cccccccccccd r=00000002
cvttpd2dq: a=c00b3333333333334004cccccccccccd r=0000000000000000fffffffd00000002
cvtsi2ss : a=fffffffa r=0000000000000000fffffffdc0c00000
cvtsi2sd : a=fffffffa r=0000000000000000c018000000000000
movlps : a=456723c698694873 r=0000000000000000456723c698694873
movlps : a=007c62c2085427f8 r=0000000000000000007c62c2085427f8
movlps : a=dc515cff944a58ec456723c698694873 r=456723c698694873
movlps : a=231be9e8cde7438d007c62c2085427f8 r=007c62c2085427f8
movhps : a=dc515cff944a58ec r=dc515cff944a58ec007c62c2085427f8
movhps : a=231be9e8cde7438d r=231be9e8cde7438d007c62c2085427f8
movhps : a=dc515cff944a58ec456723c698694873 r=dc515cff944a58ec
movhps : a=231be9e8cde7438d007c62c2085427f8 r=231be9e8cde7438d
movlpd : a=456723c698694873 r=231be9e8cde7438d456723c698694873
movlpd : a=007c62c2085427f8 r=231be9e8cde7438d007c62c2085427f8
movlpd : a=dc515cff944a58ec456723c698694873 r=456723c698694873
movlpd : a=231be9e8cde7438d007c62c2085427f8 r=007c62c2085427f8
movhpd : a=dc515cff944a58ec r=dc515cff944a58ec007c62c2085427f8
movhpd : a=231be9e8cde7438d r=231be9e8cde7438d007c62c2085427f8
movhpd : a=dc515cff944a58ec456723c698694873 r=dc515cff944a58ec
movhpd : a=231be9e8cde7438d007c62c2085427f8 r=231be9e8cde7438d
movntq : a=456723c698694873 r=456723c698694873
movntq : a=007c62c2085427f8 r=007c62c2085427f8
movntdq : a=dc515cff944a58ec456723c698694873 r=dc515cff944a58ec456723c698694873
movntdq : a=231be9e8cde7438d007c62c2085427f8 r=231be9e8cde7438d007c62c2085427f8
movups : a=dc515cff944a58ec456723c698694873 r=dc515cff944a58ec456723c698694873
movups : a=231be9e8cde7438d007c62c2085427f8 r=231be9e8cde7438d007c62c2085427f8
movupd : a=dc515cff944a58ec456723c698694873 r=dc515cff944a58ec456723c698694873
movupd : a=231be9e8cde7438d007c62c2085427f8 r=231be9e8cde7438d007c62c2085427f8
minss : a=dc515cff944a58ec456723c698694873 b=41f21efba9e3e1461f297ccd58bad7ab r=dc515cff944a58ec456723c698694873
minss : a=231be9e8cde7438d007c62c2085427f8 b=c233e9e8c4c9439a0f76255a085427f8 r=231be9e8cde7438d007c62c2085427f8
maxss : a=dc515cff944a58ec456723c698694873 b=41f21efba9e3e1461f297ccd58bad7ab r=dc515cff944a58ec456723c658bad7ab
maxss : a=231be9e8cde7438d007c62c2085427f8 b=c233e9e8c4c9439a0f76255a085427f8 r=231be9e8cde7438d007c62c2085427f8
sqrtss : a=dc515cff944a58ec456723c698694873 b=41f21efba9e3e1461f297ccd58bad7ab r=dc515cff944a58ec456723c64c1aa5bf
sqrtss : a=231be9e8cde7438d007c62c2085427f8 b=c233e9e8c4c9439a0f76255a085427f8 r=231be9e8cde7438d007c62c223e90c9e
Loading

0 comments on commit 568eee3

Please sign in to comment.