From 6b86b419121901420f2583a2f60049ab458aeb76 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 24 Jun 2021 21:40:21 +0200 Subject: [PATCH] server: Simplify the naming of the YMM regs. Signed-off-by: Alexandre Julliard --- dlls/ntdll/unix/thread.c | 20 ++++++++------------ include/wine/server_protocol.h | 2 +- server/protocol.def | 2 +- server/trace.c | 8 ++++---- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index 65f80a392da..628cc19418f 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -215,8 +215,7 @@ static NTSTATUS context_to_server( context_t *to, const void *src, USHORT machin const XSTATE *xs = (const XSTATE *)((const char *)xctx + xctx->XState.Offset); to->flags |= SERVER_CTX_YMM_REGISTERS; - if (xs->Mask & 4) - memcpy( &to->ymm.ymm_high_regs.ymm_high, &xs->YmmContext, sizeof(xs->YmmContext) ); + if (xs->Mask & 4) memcpy( &to->ymm.regs.ymm_high, &xs->YmmContext, sizeof(xs->YmmContext) ); } return STATUS_SUCCESS; } @@ -283,8 +282,7 @@ static NTSTATUS context_to_server( context_t *to, const void *src, USHORT machin const XSTATE *xs = (const XSTATE *)((const char *)xctx + xctx->XState.Offset); to->flags |= SERVER_CTX_YMM_REGISTERS; - if (xs->Mask & 4) - memcpy( &to->ymm.ymm_high_regs.ymm_high, &xs->YmmContext, sizeof(xs->YmmContext) ); + if (xs->Mask & 4) memcpy( &to->ymm.regs.ymm_high, &xs->YmmContext, sizeof(xs->YmmContext) ); } return STATUS_SUCCESS; } @@ -526,11 +524,10 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma xs->Mask &= ~4; if (user_shared_data->XState.CompactionEnabled) xs->CompactionMask = 0x8000000000000004; - for (i = 0; i < ARRAY_SIZE( from->ymm.ymm_high_regs.ymm_high); i++) + for (i = 0; i < ARRAY_SIZE( from->ymm.regs.ymm_high); i++) { - if (!from->ymm.ymm_high_regs.ymm_high[i].low && !from->ymm.ymm_high_regs.ymm_high[i].high) - continue; - memcpy( &xs->YmmContext, &from->ymm.ymm_high_regs, sizeof(xs->YmmContext) ); + if (!from->ymm.regs.ymm_high[i].low && !from->ymm.regs.ymm_high[i].high) continue; + memcpy( &xs->YmmContext, &from->ymm.regs, sizeof(xs->YmmContext) ); xs->Mask |= 4; break; } @@ -604,11 +601,10 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma xs->Mask &= ~4; if (user_shared_data->XState.CompactionEnabled) xs->CompactionMask = 0x8000000000000004; - for (i = 0; i < ARRAY_SIZE( from->ymm.ymm_high_regs.ymm_high); i++) + for (i = 0; i < ARRAY_SIZE( from->ymm.regs.ymm_high); i++) { - if (!from->ymm.ymm_high_regs.ymm_high[i].low && !from->ymm.ymm_high_regs.ymm_high[i].high) - continue; - memcpy( &xs->YmmContext, &from->ymm.ymm_high_regs, sizeof(xs->YmmContext) ); + if (!from->ymm.regs.ymm_high[i].low && !from->ymm.regs.ymm_high[i].high) continue; + memcpy( &xs->YmmContext, &from->ymm.regs, sizeof(xs->YmmContext) ); xs->Mask |= 4; break; } diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index 5135b1e5e06..4463b8fa380 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -156,7 +156,7 @@ typedef struct } ext; union { - struct { struct { unsigned __int64 low, high; } ymm_high[16]; } ymm_high_regs; + struct { struct { unsigned __int64 low, high; } ymm_high[16]; } regs; } ymm; } context_t; diff --git a/server/protocol.def b/server/protocol.def index 22b03d0c91b..6a11dfac77d 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -172,7 +172,7 @@ typedef struct } ext; /* selected by SERVER_CTX_EXTENDED_REGISTERS */ union { - struct { struct { unsigned __int64 low, high; } ymm_high[16]; } ymm_high_regs; + struct { struct { unsigned __int64 low, high; } ymm_high[16]; } regs; } ymm; /* selected by SERVER_CTX_YMM_REGISTERS */ } context_t; diff --git a/server/trace.c b/server/trace.c index 49d97f77d08..d0c5f6b670b 100644 --- a/server/trace.c +++ b/server/trace.c @@ -666,8 +666,8 @@ static void dump_varargs_context( const char *prefix, data_size_t size ) dump_uints( ",extended=", (const unsigned int *)ctx.ext.i386_regs, sizeof(ctx.ext.i386_regs) / sizeof(int) ); if (ctx.flags & SERVER_CTX_YMM_REGISTERS) - dump_uints( ",ymm_high=", (const unsigned int *)ctx.ymm.ymm_high_regs.ymm_high, - sizeof(ctx.ymm.ymm_high_regs) / sizeof(int) ); + dump_uints( ",ymm_high=", (const unsigned int *)ctx.ymm.regs.ymm_high, + sizeof(ctx.ymm.regs) / sizeof(int) ); break; case IMAGE_FILE_MACHINE_AMD64: fprintf( stderr, "%s{machine=x86_64", prefix ); @@ -719,8 +719,8 @@ static void dump_varargs_context( const char *prefix, data_size_t size ) (unsigned int)ctx.fp.x86_64_regs.fpregs[i].low ); } if (ctx.flags & SERVER_CTX_YMM_REGISTERS) - dump_uints( ",ymm_high=", (const unsigned int *)ctx.ymm.ymm_high_regs.ymm_high, - sizeof(ctx.ymm.ymm_high_regs) / sizeof(int) ); + dump_uints( ",ymm_high=", (const unsigned int *)ctx.ymm.regs.ymm_high, + sizeof(ctx.ymm.regs) / sizeof(int) ); break; case IMAGE_FILE_MACHINE_ARMNT: fprintf( stderr, "%s{machine=arm", prefix );