VirtualBox

Changeset 104378 in vbox


Ignore:
Timestamp:
Apr 19, 2024 2:43:14 PM (10 months ago)
Author:
vboxsync
Message:

VMM/IEM: Automtically convert IEMInternal.h & IEMN8veRecompiler.h into nasm/yasm include files so IEMAllN8veHlpA.asm can make use of some of the constants define in them for the prolog code. bugref:10653 bugref:10370

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/various.sed

    r98103 r104378  
    33# Converts some C header elements into nasm/yasm syntax.
    44#
    5 # This is used by 'incs' in /Maintenance.kmk (/Makefile.kmk).
    6 #
    7 
    8 #
    9 # Copyright (C) 2006-2023 Oracle and/or its affiliates.
     5# This is used by 'incs' in /Maintenance.kmk (/Makefile.kmk) as well as the VMM
     6# for IEM headers.
     7#
     8
     9#
     10# Copyright (C) 2006-2024 Oracle and/or its affiliates.
    1011#
    1112# This file is part of VirtualBox base platform packages, as
     
    4849:next
    4950
    50 # Check for markers (typically in comments).
    51 /ASM-INC/basm-inc
    52 /ASM-NOINC/basm-noinc
     51# Check for block markers (typically in comments).
     52/ASM-NOINC-START/,/ASM-NOINC-END/ {
     53    d
     54}
    5355
    5456# Newline escapes.
     
    5961:no-more-newline-escapes
    6062
    61 # Strip comments and trailing space.
    62 s/[[:space:]][[:space:]]*\/\*.*$//g
    63 s/[[:space:]][[:space:]]*\/\/.*$//g
     63# Check for line markers (typically in comments).
     64/ASM-INC/basm-inc
     65/ASM-NOINC/basm-noinc
     66
     67# Save the original line in the hold space for error reporting.
     68h
     69
     70# Strip comments.
     71/\/\*/!b strip_cpp_style_comment
     72:load_another_c_style_comment_line
     73/\*\//b strip_c_style_comment
     74N
     75b load_another_c_style_comment_line
     76:strip_c_style_comment
     77s/\/\*.*\*\// /g
     78
     79:strip_cpp_style_comment
     80s,//.*$, ,g
     81
     82# Strip trailing spaces
    6483s/[[:space:]][[:space:]]*$//g
    6584
     
    119138b end
    120139
     140
    121141:ifndef
    122142s/#\([[:space:]]*\)ifndef/\1%ifndef/
    123143b end
    124144
     145
    125146:if
    126147s/#\([[:space:]]*\)if/\1%if/
    127 b end
     148
     149# Replace 'defined(DOXYGEN_RUNNING)' with '0' to simplify subsequent matching to '[0]' when we mean 'defined[(]DOXYGEN_RUNNING[)]'.
     150s/defined[(]DOXYGEN_RUNNING[)]/0/
     151
     152# Simplify stuff that was turned into '0' in the previous step (or in the input file).
     153s/||[[:space:]]*0[[:space:]]*$//g
     154s/||[[:space:]]*0\([[:space:]|&]\)/\1/g
     155s/\([[:space:]|&]\)0[[:space:]]*||/\1/g
     156s/[[:space:]][[:space:]]*$//
     157
     158# Convert #if [!]defined(xxxx) into %if[n]def xxxx
     159s/%if[[:space:]][[:space:]]*defined[(]\([^)][^)]*\)[)]$/%ifdef \1/
     160s/%if[[:space:]][[:space:]]*[!][[:space:]]*defined[(]\([^)][^)]*\)[)]$/%ifndef \1/
     161
     162# Convert '#if ... && 0' and '#if 0 && ...' to %if 0
     163s/%if[[:space:]].*&&[[:space:]]*00*$/%if 0/
     164s/%if[[:space:]][[:space:]]*00*[[:space:]]*&&$/%if 0/
     165
     166# Convert '#if ... || 1' and '#if 1 || ...' to '%if 1'
     167s/%if[[:space:]].*||[[:space:]]*1[0-9]*$/%if 1/
     168s/%if[[:space:]][[:space:]]*1[0-9]*[[:space:]]*||$/%if 1/
     169
     170/defined/b defined_error
     171b end
     172
    128173
    129174:elif
    130175s/#\([[:space:]]*\)elif/\1%elif/
    131 b end
     176
     177# Replace 'defined(DOXYGEN_RUNNING)' with '0' to simplify subsequent matching to '[0]' when we mean 'defined[(]DOXYGEN_RUNNING[)]'.
     178s/defined[(]DOXYGEN_RUNNING[)]/0/
     179
     180# Simplify stuff that was turned into '0' in the previous step (or in the input file).
     181s/||[[:space:]]*0[[:space:]]*$//g
     182s/||[[:space:]]*0\([[:space:]|&]\)/\1/g
     183s/\([[:space:]|&]\)0[[:space:]]*||/\1/g
     184s/[[:space:]][[:space:]]*$//
     185
     186# Convert #if [!]defined(xxxx) into %if[n]def xxxx
     187s/%elif[[:space:]][[:space:]]*defined[(]\([^)][^)]*\)[)]$/%elifdef \1/
     188s/%elif[[:space:]][[:space:]]*[!][[:space:]]*defined[(]\([^)][^)]*\)[)]$/%elifndef \1/
     189
     190# Convert '#elif ... && 0' and '#elif 0 && ...' to '%elif 0'
     191s/%elif[[:space:]].*&&[[:space:]]*00*$/%elif 0/
     192s/%elif[[:space:]][[:space:]]*00*[[:space:]]*&&$/%elif 0/
     193
     194# Convert '#elif ... || 1' and '#elif 1 || ...' to '%elif 1'
     195s/%elif[[:space:]].*||[[:space:]]*1[0-9]*$/%elif 1/
     196s/%elif[[:space:]][[:space:]]*1[0-9]*[[:space:]]*||$/%elif 1/
     197
     198/defined/b defined_error
     199b end
     200
    132201
    133202:else
     
    135204b end
    136205
     206
    137207:endif
    138208s/#\([[:space:]]*\)endif.*$/\1%endif/
    139209b end
    140210
    141 #
    142 # Assembly statement... may need adjusting when used.
     211
     212:defined_error
     213x
     214s/^/error: yasm & nasm does not grok 'defined': /
     215p
     216x
     217s/^/info: state: /
     218q1
     219
     220
     221#
     222# Assembly statement inside a C-style comment.
    143223#
    144224:asm-inc
    145 b end
     225/\/\*[[:space:]]*ASM-INC:.*\*\//b asm-inc-c-style-oneliner
     226/\/\/[[:space:]]*ASM-INC:/b asm-inc-cpp-style-oneliner
     227/\/\*[[:space:]]*ASM-INC/b asm-inc-c-style-block
     228s/^/error: unknown ASM-INC form: /
     229q1
     230
     231# /* ASM-INC: %include "whatever.mac" */
     232:asm-inc-c-style-oneliner
     233s/[[:space:]]*\/\*[[:space:]][[:space:]]*ASM-INC:[[:space:]]*\(.*\)[[:space:]]*\*\//\1/
     234b end
     235
     236# // ASM-INC: %include "whatever.mac"
     237:asm-inc-cpp-style-oneliner
     238s/[[:space:]]*\/\/[[:space:]][[:space:]]*ASM-INC:[[:space:]]*\(.*\)[[:space:]]*$/\1/
     239b end
     240
     241# /* ASM-INC
     242# %include "whatever.mac"
     243# */
     244:asm-inc-c-style-block
     245s/.*$//
     246:asm-inc-c-style-block-next
     247h
     248N
     249/\*\//!b asm-inc-c-style-block-next
     250x
     251b end
     252
    146253
    147254:end
  • trunk/src/VBox/VMM/Makefile.kmk

    r104367 r104378  
    745745 if1of ($(KBUILD_TARGET_ARCH), arm64)
    746746  VBoxVMM_CLEAN += \
    747         $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h.ts \
    748         $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h
     747        $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h.ts \
     748        $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h
    749749  $(call KB_FN_AUTO_CMD_DEPS,$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h.ts)
    750750  $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h.ts \
     
    753753                $(PATH_SUB_CURRENT)/dwarfdump-to-offsets.sed
    754754        $(QUIET)$(call MSG_GENERATE,VBoxVMM,$@,IEMAllN8veRecompiler.o)
    755         $(QUIET)$(RM) -f -- "$@" "[email protected]" "$(basename $@)"
     755        $(QUIET)$(RM) -f -- "$@" "[email protected]"
    756756        $(QUIET)$(MKDIR) -p -- "$(dir $@)"
    757757        $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
     
    764764  # Set up the dependencies.
    765765  $(VBoxVMM_0_OUTDIR)/VMMAll/IEMAllN8veHlpA-arm64.o: $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h
     766 endif
     767
     768 #
     769 # Generate member offsets for selected structures for use from ARM64 assembly.
     770 #
     771 if1of ($(KBUILD_TARGET_ARCH), amd64)
     772  VBoxVMM_CLEAN += \
     773        $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInternal.mac.ts \
     774        $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInternal.mac \
     775        $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMN8veRecompiler.mac.ts \
     776        $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMN8veRecompiler.mac
     777
     778  VBoxVMM_INTERMEDIATES.amd64 += $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInternal.mac
     779  $(call KB_FN_AUTO_CMD_DEPS,$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInternal.mac.ts)
     780  $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInternal.mac.ts \
     781  +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInternal.mac: \
     782                $(PATH_SUB_CURRENT)/include/IEMInternal.h \
     783                $(PATH_ROOT)/include/VBox/various.sed
     784        $(QUIET)$(call MSG_GENERATE,VBoxVMM,$@,$<)
     785        $(QUIET)$(MKDIR) -p -- "$(dir $@)"
     786        $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
     787        $(QUIET)$(SED) -f "$(filter %.sed,$^)" --output "$@" "$<"
     788        $(QUIET)$(CP) -v -f --changed -- "$@" "$(basename $@)"
     789
     790  VBoxVMM_INTERMEDIATES.amd64 += $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMN8veRecompiler.mac
     791  $(call KB_FN_AUTO_CMD_DEPS,$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMN8veRecompiler.mac.ts)
     792  $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMN8veRecompiler.mac.ts \
     793  +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMN8veRecompiler.mac: \
     794                $(PATH_SUB_CURRENT)/include/IEMN8veRecompiler.h \
     795                $(PATH_ROOT)/include/VBox/various.sed
     796        $(QUIET)$(call MSG_GENERATE,VBoxVMM,$@,$<)
     797        $(QUIET)$(MKDIR) -p -- "$(dir $@)"
     798        $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
     799        $(QUIET)$(SED) -f "$(filter %.sed,$^)" --output "$@" "$<"
     800        $(QUIET)$(CP) -v -f --changed -- "$@" "$(basename $@)"
    766801 endif
    767802
  • trunk/src/VBox/VMM/VMMAll/IEMAllN8veHlpA.asm

    r104331 r104378  
    3232%include "VBox/asmdefs.mac"
    3333
    34 ;; @todo r=aeichner The following is copied from IEMInternal.h
    35 ;%define VBOX_WITH_IEM_NATIVE_RECOMPILER_LONGJMP - not enabled right now on amd64
    36 
    37 ;; @todo r=aeichner The following defines are copied from IEMN8veRecompiler.h
    38 
    39 ; /** @def IEMNATIVE_WITH_RECOMPILER_PROLOGUE_SINGLETON
    40 ;  * Enables having only a single prologue for native TBs. */
    41 %define IEMNATIVE_WITH_RECOMPILER_PROLOGUE_SINGLETON
    42 
    43 ; /** An stack alignment adjustment (between non-volatile register pushes and
    44 ;  *  the stack variable area, so the latter better aligned). */
    45 %define IEMNATIVE_FRAME_ALIGN_SIZE              8
    46 
    47 ; /** The size of the area for stack variables and spills and stuff.
    48 ; * @note This limit is duplicated in the python script(s).  We add 0x40 for
    49 ; *       alignment padding. */
    50 %define IEMNATIVE_FRAME_VAR_SIZE                (0xc0 + 0x40)
    51 
    52 ; This needs to correspond to IEMNATIVE_REG_FIXED_PVMCPU in IEMN8veRecompiler.h
    53 %define IEMNATIVE_REG_FIXED_PVMCPU_ASM          xBX
    54 
    55 ; /** Number of stack arguments slots for calls made from the frame. */
    56 %ifdef RT_OS_WINDOWS
    57 %define IEMNATIVE_FRAME_STACK_ARG_COUNT         4
    58 %else
    59 %define IEMNATIVE_FRAME_STACK_ARG_COUNT         2
    60 %endif
    61 ; /** Number of any shadow arguments (spill area) for calls we make. */
    62 %ifdef RT_OS_WINDOWS
    63 %define IEMNATIVE_FRAME_SHADOW_ARG_COUNT        4
    64 %else
    65 %define IEMNATIVE_FRAME_SHADOW_ARG_COUNT        0
    66 %endif
    67 
    68 
     34%include "IEMInternal.mac"
     35%include "IEMN8veRecompiler.mac"
     36
     37
     38;*********************************************************************************************************************************
     39;*  External Symbols                                                                                                             *
     40;*********************************************************************************************************************************
    6941BEGINCODE
    70 
    7142extern NAME(iemThreadedFunc_BltIn_LogCpuStateWorker)
    7243extern NAME(iemNativeHlpCheckTlbLookup)
    7344
    7445
    75 %ifdef IEMNATIVE_WITH_RECOMPILER_PROLOGUE_SINGLETON
    76 
     46BEGINCODE
    7747;;
    7848; This is the common prologue of a TB, saving all volatile registers
     
    11383        SEH64_PUSH_GREG r15
    11484%ifdef VBOX_WITH_IEM_NATIVE_RECOMPILER_LONGJMP
    115  %error "Port me - need to store RBP in IEMCPU::pvTbFramePointerR3"
     85 %error "Port me - need to store RBP in IEMCPU::pvTbFramePointerR3; Create ASM version of IEMCPU in IEMInternalStruct.mac"
    11686%endif
    11787%define MY_STACK_ALLOC (  IEMNATIVE_FRAME_ALIGN_SIZE \
     
    131101%endif
    132102ENDPROC     iemNativeTbEntry
    133 %endif
    134103
    135104
  • trunk/src/VBox/VMM/include/IEMInternal.h

    r104367 r104378  
    5353 */
    5454
     55/* Make doxygen happy w/o overcomplicating the #if checks. */
     56#ifdef DOXYGEN_RUNNING
     57# define IEM_WITH_THROW_CATCH
     58# define VBOX_WITH_IEM_NATIVE_RECOMPILER_LONGJMP
     59#endif
     60
    5561/** For expanding symbol in slickedit and other products tagging and
    5662 *  crossreferencing IEM symbols. */
     
    8389 * Linux, but it should be quite a bit faster for normal code.
    8490 */
    85 #if (defined(__cplusplus) && defined(IEM_WITH_SETJMP) && defined(IN_RING3) && (defined(__GNUC__) || defined(_MSC_VER))) \
    86  || defined(DOXYGEN_RUNNING)
     91#if defined(__cplusplus) && defined(IEM_WITH_SETJMP) && defined(IN_RING3) && (defined(__GNUC__) || defined(_MSC_VER)) /* ASM-NOINC-START */
    8792# define IEM_WITH_THROW_CATCH
    88 #endif
     93#endif /*ASM-NOINC-END*/
    8994
    9095/** @def IEMNATIVE_WITH_DELAYED_PC_UPDATING
     
    117122 * non-volatile (and does something even more crazy for ARM), this probably
    118123 * won't work reliably on Windows. */
    119 #if defined(DOXYGEN_RUNNING) || (!defined(RT_OS_WINDOWS) && (defined(RT_ARCH_ARM64) /*|| defined(_RT_ARCH_AMD64)*/))
    120 # define VBOX_WITH_IEM_NATIVE_RECOMPILER_LONGJMP
    121 #endif
     124#ifdef RT_ARCH_ARM64
     125# ifndef RT_OS_WINDOWS
     126#  define VBOX_WITH_IEM_NATIVE_RECOMPILER_LONGJMP
     127# endif
     128#endif
     129/* ASM-NOINC-START */
    122130#ifdef VBOX_WITH_IEM_NATIVE_RECOMPILER_LONGJMP
    123131# if !defined(IN_RING3) \
     
    189197# define IEM_NOEXCEPT_MAY_LONGJMP   RT_NOEXCEPT
    190198#endif
     199/* ASM-NOINC-END */
    191200
    192201#define IEM_IMPLEMENTS_TASKSWITCH
     
    194203/** @def IEM_WITH_3DNOW
    195204 * Includes the 3DNow decoding.  */
    196 #if (!defined(IEM_WITH_3DNOW) && !defined(IEM_WITHOUT_3DNOW)) || defined(DOXYGEN_RUNNING)   /* For doxygen, set in Config.kmk. */
    197 # define IEM_WITH_3DNOW
     205#if !defined(IEM_WITH_3DNOW) || defined(DOXYGEN_RUNNING)   /* For doxygen, set in Config.kmk. */
     206# ifndef IEM_WITHOUT_3DNOW
     207#  define IEM_WITH_3DNOW
     208# endif
    198209#endif
    199210
    200211/** @def IEM_WITH_THREE_0F_38
    201212 * Includes the three byte opcode map for instrs starting with 0x0f 0x38. */
    202 #if (!defined(IEM_WITH_THREE_0F_38) && !defined(IEM_WITHOUT_THREE_0F_38)) || defined(DOXYGEN_RUNNING) /* For doxygen, set in Config.kmk. */
    203 # define IEM_WITH_THREE_0F_38
     213#if !defined(IEM_WITH_THREE_0F_38) || defined(DOXYGEN_RUNNING) /* For doxygen, set in Config.kmk. */
     214# ifdef IEM_WITHOUT_THREE_0F_38
     215#  define IEM_WITH_THREE_0F_38
     216# endif
    204217#endif
    205218
    206219/** @def IEM_WITH_THREE_0F_3A
    207220 * Includes the three byte opcode map for instrs starting with 0x0f 0x38. */
    208 #if (!defined(IEM_WITH_THREE_0F_3A) && !defined(IEM_WITHOUT_THREE_0F_3A)) || defined(DOXYGEN_RUNNING) /* For doxygen, set in Config.kmk. */
    209 # define IEM_WITH_THREE_0F_3A
     221#if !defined(IEM_WITH_THREE_0F_3A) || defined(DOXYGEN_RUNNING) /* For doxygen, set in Config.kmk. */
     222# ifndef IEM_WITHOUT_THREE_0F_3A
     223#  define IEM_WITH_THREE_0F_3A
     224# endif
    210225#endif
    211226
    212227/** @def IEM_WITH_VEX
    213228 * Includes the VEX decoding. */
    214 #if (!defined(IEM_WITH_VEX) && !defined(IEM_WITHOUT_VEX)) || defined(DOXYGEN_RUNNING)       /* For doxygen, set in Config.kmk. */
    215 # define IEM_WITH_VEX
     229#if !defined(IEM_WITH_VEX) || defined(DOXYGEN_RUNNING)       /* For doxygen, set in Config.kmk. */
     230# ifndef IEM_WITHOUT_VEX
     231#  define IEM_WITH_VEX
     232# endif
    216233#endif
    217234
     
    234251/** @def IEM_USE_UNALIGNED_DATA_ACCESS
    235252 * Use unaligned accesses instead of elaborate byte assembly. */
    236 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) || defined(DOXYGEN_RUNNING)
     253#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) || defined(DOXYGEN_RUNNING)  /*ASM-NOINC*/
    237254# define IEM_USE_UNALIGNED_DATA_ACCESS
    238 #endif
     255#endif                                                                          /*ASM-NOINC*/
    239256
    240257//#define IEM_LOG_MEMORY_WRITES
     
    242259
    243260
    244 #ifndef RT_IN_ASSEMBLER /* the rest of the file */
     261#ifndef RT_IN_ASSEMBLER /* ASM-NOINC-START - the rest of the file */
    245262
    246263# if !defined(IN_TSTVMSTRUCT) && !defined(DOXYGEN_RUNNING)
     
    61986215DECLASM(DECL_NO_RETURN(void)) iemNativeTbLongJmp(void *pvFramePointer, int rc) RT_NOEXCEPT;
    61996216
    6200 #endif /* !RT_IN_ASSEMBLER */
     6217#endif /* !RT_IN_ASSEMBLER - ASM-NOINC-END */
    62016218
    62026219
     
    62056222RT_C_DECLS_END
    62066223
     6224/* ASM-INC: %include "IEMInternalStruct.mac" */
     6225
    62076226#endif /* !VMM_INCLUDED_SRC_include_IEMInternal_h */
    62086227
  • trunk/src/VBox/VMM/include/IEMN8veRecompiler.h

    r104367 r104378  
    5555/** @def IEMNATIVE_WITH_EFLAGS_SKIPPING
    5656 * Enables skipping EFLAGS calculations/updating based on liveness info.  */
    57 #if (defined(IEMNATIVE_WITH_LIVENESS_ANALYSIS) && 1) || defined(DOXYGEN_RUNNING)
     57#if defined(IEMNATIVE_WITH_LIVENESS_ANALYSIS) || defined(DOXYGEN_RUNNING)
    5858# define IEMNATIVE_WITH_EFLAGS_SKIPPING
    5959#endif
     
    6363 * Enables strict consistency checks around EFLAGS skipping.
    6464 * @note Only defined when IEMNATIVE_WITH_EFLAGS_SKIPPING is also defined. */
    65 #if (defined(VBOX_STRICT) && defined(IEMNATIVE_WITH_EFLAGS_SKIPPING)) || defined(DOXYGEN_RUNNING)
     65#ifdef IEMNATIVE_WITH_EFLAGS_SKIPPING
     66# ifdef VBOX_STRICT
     67#  define IEMNATIVE_STRICT_EFLAGS_SKIPPING
     68# endif
     69#elif defined(DOXYGEN_RUNNING)
    6670# define IEMNATIVE_STRICT_EFLAGS_SKIPPING
    6771#endif
     
    186190 * Dedicated temporary SIMD register. */
    187191#endif
    188 #if defined(RT_ARCH_AMD64) && !defined(DOXYGEN_RUNNING)
     192#ifdef RT_ARCH_AMD64
    189193# define IEMNATIVE_REG_FIXED_PVMCPU         X86_GREG_xBX
     194# define IEMNATIVE_REG_FIXED_PVMCPU_ASM     xBX
    190195# define IEMNATIVE_REG_FIXED_TMP0           X86_GREG_x11
    191 # define IEMNATIVE_REG_FIXED_MASK          (  RT_BIT_32(IEMNATIVE_REG_FIXED_PVMCPU) \
    192                                             | RT_BIT_32(IEMNATIVE_REG_FIXED_TMP0) \
    193                                             | RT_BIT_32(X86_GREG_xSP) \
    194                                             | RT_BIT_32(X86_GREG_xBP) )
     196# define IEMNATIVE_REG_FIXED_MASK           (  RT_BIT_32(IEMNATIVE_REG_FIXED_PVMCPU) \
     197                                             | RT_BIT_32(IEMNATIVE_REG_FIXED_TMP0) \
     198                                             | RT_BIT_32(X86_GREG_xSP) \
     199                                             | RT_BIT_32(X86_GREG_xBP) )
    195200
    196201# ifdef IEMNATIVE_WITH_SIMD_REG_ALLOCATOR
    197 #  define IEMNATIVE_SIMD_REG_FIXED_TMP0    5 /* xmm5/ymm5 */
    198 #  if defined(IEMNATIVE_WITH_SIMD_REG_ACCESS_ALL_REGISTERS) || !defined(_MSC_VER)
    199 #   define IEMNATIVE_SIMD_REG_FIXED_MASK   (RT_BIT_32(IEMNATIVE_SIMD_REG_FIXED_TMP0))
     202#  define IEMNATIVE_SIMD_REG_FIXED_TMP0     5 /* xmm5/ymm5 */
     203#  ifndef IEMNATIVE_WITH_SIMD_REG_ACCESS_ALL_REGISTERS
     204#   ifndef _MSC_VER /* On Windows xmm6 through xmm15 are marked as callee saved. */
     205#    define IEMNATIVE_WITH_SIMD_REG_ACCESS_ALL_REGISTERS
     206#   endif
     207#  endif
     208#  ifdef IEMNATIVE_WITH_SIMD_REG_ACCESS_ALL_REGISTERS
     209#   define IEMNATIVE_SIMD_REG_FIXED_MASK    (RT_BIT_32(IEMNATIVE_SIMD_REG_FIXED_TMP0))
    200210#  else
    201 /** On Windows xmm6 through xmm15 are marked as callee saved. */
    202 #   define IEMNATIVE_SIMD_REG_FIXED_MASK   (  UINT32_C(0xffc0) \
    203                                             | RT_BIT_32(IEMNATIVE_SIMD_REG_FIXED_TMP0))
     211#   define IEMNATIVE_SIMD_REG_FIXED_MASK    (  UINT32_C(0xffc0) \
     212                                             | RT_BIT_32(IEMNATIVE_SIMD_REG_FIXED_TMP0))
    204213#  endif
    205214# endif
     
    229238
    230239# ifdef IEMNATIVE_WITH_SIMD_REG_ALLOCATOR
    231 # define IEMNATIVE_SIMD_REG_FIXED_TMP0     ARMV8_A64_REG_Q30
     240# define IEMNATIVE_SIMD_REG_FIXED_TMP0      ARMV8_A64_REG_Q30
    232241#  if defined(IEMNATIVE_WITH_SIMD_REG_ACCESS_ALL_REGISTERS)
    233 #   define IEMNATIVE_SIMD_REG_FIXED_MASK   RT_BIT_32(ARMV8_A64_REG_Q30)
     242#   define IEMNATIVE_SIMD_REG_FIXED_MASK    RT_BIT_32(ARMV8_A64_REG_Q30)
    234243#  else
    235244/*
     
    242251 * having to save and restore them in the prologue/epilogue.
    243252 */
    244 #   define IEMNATIVE_SIMD_REG_FIXED_MASK   (  UINT32_C(0xff00) \
    245                                             | RT_BIT_32(ARMV8_A64_REG_Q31) \
    246                                             | RT_BIT_32(ARMV8_A64_REG_Q30) \
    247                                             | RT_BIT_32(ARMV8_A64_REG_Q29) \
    248                                             | RT_BIT_32(ARMV8_A64_REG_Q27) \
    249                                             | RT_BIT_32(ARMV8_A64_REG_Q25) \
    250                                             | RT_BIT_32(ARMV8_A64_REG_Q23) \
    251                                             | RT_BIT_32(ARMV8_A64_REG_Q21) \
    252                                             | RT_BIT_32(ARMV8_A64_REG_Q19) \
    253                                             | RT_BIT_32(ARMV8_A64_REG_Q17) \
    254                                             | RT_BIT_32(ARMV8_A64_REG_Q15) \
    255                                             | RT_BIT_32(ARMV8_A64_REG_Q13) \
    256                                             | RT_BIT_32(ARMV8_A64_REG_Q11) \
    257                                             | RT_BIT_32(ARMV8_A64_REG_Q9) \
    258                                             | RT_BIT_32(ARMV8_A64_REG_Q7) \
    259                                             | RT_BIT_32(ARMV8_A64_REG_Q5) \
    260                                             | RT_BIT_32(ARMV8_A64_REG_Q3) \
    261                                             | RT_BIT_32(ARMV8_A64_REG_Q1))
     253#   define IEMNATIVE_SIMD_REG_FIXED_MASK    (  UINT32_C(0xff00) \
     254                                             | RT_BIT_32(ARMV8_A64_REG_Q31) \
     255                                             | RT_BIT_32(ARMV8_A64_REG_Q30) \
     256                                             | RT_BIT_32(ARMV8_A64_REG_Q29) \
     257                                             | RT_BIT_32(ARMV8_A64_REG_Q27) \
     258                                             | RT_BIT_32(ARMV8_A64_REG_Q25) \
     259                                             | RT_BIT_32(ARMV8_A64_REG_Q23) \
     260                                             | RT_BIT_32(ARMV8_A64_REG_Q21) \
     261                                             | RT_BIT_32(ARMV8_A64_REG_Q19) \
     262                                             | RT_BIT_32(ARMV8_A64_REG_Q17) \
     263                                             | RT_BIT_32(ARMV8_A64_REG_Q15) \
     264                                             | RT_BIT_32(ARMV8_A64_REG_Q13) \
     265                                             | RT_BIT_32(ARMV8_A64_REG_Q11) \
     266                                             | RT_BIT_32(ARMV8_A64_REG_Q9) \
     267                                             | RT_BIT_32(ARMV8_A64_REG_Q7) \
     268                                             | RT_BIT_32(ARMV8_A64_REG_Q5) \
     269                                             | RT_BIT_32(ARMV8_A64_REG_Q3) \
     270                                             | RT_BIT_32(ARMV8_A64_REG_Q1))
    262271#  endif
    263272# endif
     
    309318#  endif
    310319
    311 # else
     320# else  /* !RT_OS_WINDOWS */
    312321#  define IEMNATIVE_CALL_ARG_GREG_COUNT     6
    313322#  define IEMNATIVE_CALL_ARG0_GREG          X86_GREG_xDI
     
    336345#   define IEMNATIVE_CALL_VOLATILE_SIMD_REG_MASK (UINT32_C(0xffff))
    337346#  endif
    338 # endif
     347# endif /* !RT_OS_WINDOWS */
    339348
    340349#elif defined(RT_ARCH_ARM64)
     
    384393
    385394/** This is the maximum argument count we'll ever be needing. */
    386 #if defined(RT_OS_WINDOWS) && defined(VBOXSTRICTRC_STRICT_ENABLED)
    387 # define IEMNATIVE_CALL_MAX_ARG_COUNT       8
    388 #else
    389 # define IEMNATIVE_CALL_MAX_ARG_COUNT       7
     395#define IEMNATIVE_CALL_MAX_ARG_COUNT        7
     396#ifdef RT_OS_WINDOWS
     397# ifdef VBOXSTRICTRC_STRICT_ENABLED
     398#  undef IEMNATIVE_CALL_MAX_ARG_COUNT
     399#  define IEMNATIVE_CALL_MAX_ARG_COUNT      8
     400# endif
    390401#endif
    391402/** @} */
     
    427438
    428439
    429 #ifndef RT_IN_ASSEMBLER /* the rest of the file */
     440#ifndef RT_IN_ASSEMBLER /* ASM-NOINC-START - the rest of the file */
    430441
    431442
     
    25032514#endif
    25042515
    2505 #endif /* !RT_IN_ASSEMBLER */
     2516#endif /* !RT_IN_ASSEMBLER - ASM-NOINC-END */
    25062517
    25072518/** @} */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette