VirtualBox

Changeset 102201 in vbox


Ignore:
Timestamp:
Nov 21, 2023 1:15:33 PM (17 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
160326
Message:

ValKit/bs3-cpu-basic-3: More 64-bit lea testing. bugref:10371

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-3-high-asm.asm

    r102183 r102201  
    7878        dq  0
    7979
     80%ifdef WITH_TRACING
    8081BS3_GLOBAL_DATA g_bs3CpuBasic3_lea_trace, 4
    8182        dd  0
     83%endif
    8284
    8385;
     
    9496export  BS3_CMN_NM(bs3CpuBasic3_lea_64)
    9597BS3_PROC_BEGIN_CMN bs3CpuBasic3_lea_64, BS3_PBC_NEAR
    96 %if 0
    97         times 512-0x1a db 1
    98 %assign x 1
    99 %rep 167
    100 %assign x x+1
    101         times 512 db x
    102 %endrep
    103 %else
    10498        push    rax
    10599        push    rcx
     
    123117        ; Loop thru all the modr/m memory encodings.
    124118        ;
    125  %assign iMod          0
    126  %assign iDstReg       0    ; We don't test all destination registers
    127  %rep   3
    128   %rep   16                 ; Destination registers per encoding. Testing all takes too much space.
    129    %assign iMemReg     0
    130    %rep   16
    131      %assign iDstReg_Value %sel(iDstReg+1, LEA_RAX, LEA_RCX, LEA_RDX, LEA_RBX, LEA_RSP, LEA_RBP, LEA_RSI, LEA_RDI, \
    132                                            LEA_R8, LEA_R9, LEA_R10, LEA_R11, LEA_R12, LEA_R13, LEA_R14, LEA_R15)
    133 
    134     %if (iMemReg & 7) == 4
     119%assign iMod         0
     120%rep   3
     121 %assign iDstReg    0
     122 %rep   16
     123  %assign iMemReg   0
     124  %rep   16
     125   %assign iDstReg_Value %sel(iDstReg+1, LEA_RAX, LEA_RCX, LEA_RDX, LEA_RBX, LEA_RSP, LEA_RBP, LEA_RSI, LEA_RDI, \
     126                                         LEA_R8, LEA_R9, LEA_R10, LEA_R11, LEA_R12, LEA_R13, LEA_R14, LEA_R15)
     127
     128   %if (iMemReg & 7) == 4
    135129        ;
    136130        ; SIB.
    137131        ;
    138        %assign iBase       0
    139        %rep 16
    140         %if (iBase & 7) == 5 && iMod == 0
    141          %assign iBase_Value 0
    142         %else
    143          %assign iBase_Value %sel(iBase+1, LEA_RAX, LEA_RCX, LEA_RDX, LEA_RBX, LEA_RSP, LEA_RBP, LEA_RSI, LEA_RDI, \
    144                                            LEA_R8, LEA_R9, LEA_R10, LEA_R11, LEA_R12, LEA_R13, LEA_R14, LEA_R15)
    145         %endif
    146 
    147         %assign iIndex     0
    148         %assign cShift     0 ; we don't have enough room for checking all the shifts.
    149         %rep 16
    150          %assign iBase_Value %sel(iIndex+1, LEA_RAX, LEA_RCX, LEA_RDX, LEA_RBX, 0, LEA_RBP, LEA_RSI, LEA_RDI, \
    151                                             LEA_R8, LEA_R9, LEA_R10, LEA_R11, LEA_R12, LEA_R13, LEA_R14, LEA_R15)
     132    %assign iBase       0
     133    %rep 16
     134     %if (iBase & 7) == 5 && iMod == 0
     135      %assign iBase_Value 0
     136     %else
     137      %assign iBase_Value %sel(iBase+1, LEA_RAX, LEA_RCX, LEA_RDX, LEA_RBX, LEA_RSP, LEA_RBP, LEA_RSI, LEA_RDI, \
     138                                        LEA_R8, LEA_R9, LEA_R10, LEA_R11, LEA_R12, LEA_R13, LEA_R14, LEA_R15)
     139     %endif
     140
     141     %assign iIndex     0
     142     %assign cShift     0 ; we don't have enough room for checking all the shifts.
     143     %rep 16
     144      %assign iIndex_Value %sel(iIndex+1, LEA_RAX, LEA_RCX, LEA_RDX, LEA_RBX, 0, LEA_RBP, LEA_RSI, LEA_RDI, \
     145                                          LEA_R8, LEA_R9, LEA_R10, LEA_R11, LEA_R12, LEA_R13, LEA_R14, LEA_R15)
    152146
    153147        ;
     
    155149        ; in the image for that.
    156150        ;
    157          %assign cShiftLoops 0 ; Disabled for now
    158          %rep cShiftLoops
    159 %error asdf
     151      %assign cShiftLoops 4
     152      %rep cShiftLoops
     153
    160154        ;
    161155        ; LEA+SIB w/ 64-bit operand size and 64-bit address size.
    162156        ;
     157       %ifdef WITH_TRACING
     158        mov     dword [BS3_DATA16_WRT(BS3_DATA_NM(g_bs3CpuBasic3_lea_trace))], $
     159       %endif
    163160        call    .load_regs
    164           %if iBase == 4 || iDstReg == 4
     161       %if iBase == 4 || iDstReg == 4
    165162        mov     rsp, LEA_RSP
    166           %endif
     163       %endif
    167164
    168165        ; lea
    169           %assign   iValue  iBase_Value + (iIndex_Value << cShift)
    170         db      X86_OP_REX_W | ((iBase & 8) >> 3) | ((iIndex & 8) >> 2) | ((iDstReg) & 8 >> 1)
     166       %assign   iValue  iBase_Value + (iIndex_Value << cShift)
     167        db      X86_OP_REX_W | ((iBase & 8) >> 3) | ((iIndex & 8) >> 2) | ((iDstReg & 8) >> 1)
    171168        db      8dh, X86_MODRM_MAKE(iMod, iDstReg & 7, iMemReg & 7), X86_SIB_MAKE(iBase & 7, iIndex & 7, cShift)
    172           %if iMod == X86_MOD_MEM1
     169       %if iMod == X86_MOD_MEM1
    173170        db      -128
    174            %assign  iValue  iValue - 128
    175           %elif iMod == X86_MOD_MEM4 || (iMod == 0 && iBase == 5)
    176         dd      -07fffffffh
    177            %assign  iValue  iValue - 07fffffffh
    178           %endif
     171        %assign  iValue  iValue - 128
     172       %elif iMod == X86_MOD_MEM4 || (iMod == 0 && (iBase & 7) == 5)
     173        dd      -07ffef3ffh
     174        %assign  iValue  iValue - 07ffef3ffh
     175       %endif
    179176
    180177        ; cmp iDstReg, iValue
    181           %if iValue <= 07fffffffh && iValue >= -080000000h
     178       %if iValue <= 07fffffffh && iValue >= -080000000h
    182179        db      X86_OP_REX_W | ((iDstReg & 8) >> 3)
    183180        db      81h, X86_MODRM_MAKE(X86_MOD_REG, 7, iDstReg & 7)
    184181        dd      iValue & 0ffffffffh
    185           %elif iDstReg != X86_GREG_xAX
     182       %elif iDstReg != X86_GREG_xAX
    186183        mov     rax, iValue
    187184        db      X86_OP_REX_W | ((iDstReg & 8) >> 3)
    188185        db      39h, X86_MODRM_MAKE(X86_MOD_REG, X86_GREG_xAX, iDstReg & 7)
    189           %else
     186       %else
    190187            mov     rcx, iValue
    191188            cmp     rax, rcx
    192           %endif
    193           %if iDstReg == 4
    194         mov     rsp, [BS3_DATA16_WRT(BS3_DATA_NM(g_bs3CpuBasic3_lea_rsp))]
    195           %endif
     189       %endif
     190       %if iBase == 4 || iDstReg == 4
     191        mov     rdx, rsp
     192        mov     rsp, [BS3_DATA16_WRT(BS3_DATA_NM(g_bs3CpuBasic3_lea_rsp))]
     193       %endif
    196194        jz      $+3
    197195        int3
    198            %assign cShift    (cShift + 1) & 3
    199 
    200          %endrep
    201          %assign iIndex    iIndex + 1
    202         %endrep
    203         %assign iBase      iBase + 1
    204        %endrep
    205 
    206     %else ; !SIB
     196
     197       %assign cShift   (cShift + 1) & 3
     198      %endrep
     199      %assign iIndex    iIndex + 1
     200     %endrep
     201     %assign iBase      iBase + 1
     202    %endrep
     203
     204   %else ; !SIB
    207205        ;
    208206        ; Plain lea reg, [reg] with disp according to iMod,
    209207        ; or lea reg, [disp32] if iMemReg == 5 && iMod == 0.
    210208        ;
    211      %if (iMemReg & 7) == 5 && iMod == 0
    212       %assign iMemReg_Value 0
    213      %else
    214       %assign iMemReg_Value %sel(iMemReg+1, LEA_RAX, LEA_RCX, LEA_RDX, LEA_RBX, LEA_RSP, LEA_RBP, LEA_RSI, LEA_RDI, \
    215                                             LEA_R8, LEA_R9, LEA_R10, LEA_R11, LEA_R12, LEA_R13, LEA_R14, LEA_R15)
    216      %endif
     209    %if (iMemReg & 7) == 5 && iMod == 0
     210     %assign iMemReg_Value 0
     211    %else
     212     %assign iMemReg_Value %sel(iMemReg+1, LEA_RAX, LEA_RCX, LEA_RDX, LEA_RBX, LEA_RSP, LEA_RBP, LEA_RSI, LEA_RDI, \
     213                                           LEA_R8, LEA_R9, LEA_R10, LEA_R11, LEA_R12, LEA_R13, LEA_R14, LEA_R15)
     214    %endif
    217215
    218216        ;
    219217        ; 64-bit operand and address size first.
    220218        ;
    221 ;mov eax, $
    222 mov     dword [BS3_DATA16_WRT(BS3_DATA_NM(g_bs3CpuBasic3_lea_trace))], $ ;iMod | (iDstReg << 4) | (iMemReg << 8)
    223 
     219    %ifdef WITH_TRACING
     220        mov     dword [BS3_DATA16_WRT(BS3_DATA_NM(g_bs3CpuBasic3_lea_trace))], $
     221    %endif
    224222        call    .load_regs
    225      %if iDstReg == 4
     223    %if iDstReg == 4
    226224        mov     rsp, LEA_RSP
    227      %endif
     225    %endif
    228226
    229227        ; lea
    230      %assign   iValue  iMemReg_Value
     228    %assign   iValue  iMemReg_Value
    231229        db      X86_OP_REX_W | ((iDstReg & 8) >> 1) | ((iMemReg & 8) >> 3)
    232230        db      8dh, X86_MODRM_MAKE(iMod, iDstReg & 7, iMemReg & 7)
    233      %if iMod == X86_MOD_MEM1
     231    %if iMod == X86_MOD_MEM1
    234232        db      39
    235       %assign  iValue  iValue + 39
    236      %elif iMod == 0 && (iMemReg & 7) == 5
     233     %assign  iValue  iValue + 39
     234    %elif iMod == 0 && (iMemReg & 7) == 5
    237235        dd      .load_regs - $ - 4
    238      %elif iMod == X86_MOD_MEM4
     236    %elif iMod == X86_MOD_MEM4
    239237        dd      058739af8h
    240       %assign  iValue  iValue + 058739af8h
    241      %endif
     238     %assign  iValue  iValue + 058739af8h
     239    %endif
    242240
    243241        ; cmp iDstReg, iValue
    244      %if (iValue <= 07fffffffh && iValue >= -080000000h) || (iMod == 0 && (iMemReg & 7) == 5)
     242    %if (iValue <= 07fffffffh && iValue >= -080000000h) || (iMod == 0 && (iMemReg & 7) == 5)
    245243        db      X86_OP_REX_W | ((iDstReg & 8) >> 3)
    246244        db      81h, X86_MODRM_MAKE(X86_MOD_REG, 7, iDstReg & 7)
    247       %if iMod == 0 && (iMemReg & 7) == 5
     245     %if iMod == 0 && (iMemReg & 7) == 5
    248246        dd      .load_regs wrt BS3FLAT
    249       %else
     247     %else
    250248        dd      iValue & 0ffffffffh
    251       %endif
    252      %else
    253       %if iDstReg != iMemReg && iValue == iMemReg_Value ; This isn't entirely safe, but it saves a bit of space.
     249     %endif
     250    %else
     251     %if iDstReg != iMemReg && iValue == iMemReg_Value ; This isn't entirely safe, but it saves a bit of space.
    254252        db      X86_OP_REX_W | ((iDstReg & 8) >> 1) | ((iMemReg & 8) >> 3)
    255253        db      39h, X86_MODRM_MAKE(X86_MOD_REG, iDstReg & 7, iMemReg & 7)
    256       %elif iDstReg != X86_GREG_xAX
     254     %elif iDstReg != X86_GREG_xAX
    257255        mov     rax, iValue
    258         db      X86_OP_REX_W | ((iDstReg & 8) >> 3)
     256        db      (X86_OP_REX_W | ((iDstReg & 8) >> 3))
    259257        db      39h, X86_MODRM_MAKE(X86_MOD_REG, X86_GREG_xAX, iDstReg & 7)
    260       %else
     258     %else
    261259        mov     rcx, iValue
    262260        cmp     rax, rcx
    263       %endif
    264      %endif
    265      %if iDstReg == 4
    266         mov     rsp, [BS3_DATA16_WRT(BS3_DATA_NM(g_bs3CpuBasic3_lea_rsp))]
    267      %endif
     261     %endif
     262    %endif
     263    %if iDstReg == 4
     264        mov     rsp, [BS3_DATA16_WRT(BS3_DATA_NM(g_bs3CpuBasic3_lea_rsp))]
     265    %endif
    268266        jz      $+3
    269267        int3
     
    273271        ;
    274272        call    .load_regs
    275      %if iDstReg == 4
     273    %if iDstReg == 4
    276274        mov     rsp, LEA_RSP
    277      %endif
     275    %endif
    278276
    279277        ; lea
    280      %assign   iValue  iMemReg_Value
     278    %assign   iValue  iMemReg_Value
    281279        db      X86_OP_PRF_SIZE_ADDR
    282280        db      X86_OP_REX_W | ((iDstReg & 8) >> 1) | ((iMemReg & 8) >> 3)
    283281        db      8dh, X86_MODRM_MAKE(iMod, iDstReg & 7, iMemReg & 7)
    284      %if iMod == X86_MOD_MEM1
     282    %if iMod == X86_MOD_MEM1
    285283        db      -92
    286       %assign  iValue  iValue - 92
    287      %elif iMod == 0 && (iMemReg & 7) == 5
     284     %assign  iValue  iValue - 92
     285    %elif iMod == 0 && (iMemReg & 7) == 5
    288286        dd      .test_label - $ - 4
    289      %elif iMod == X86_MOD_MEM4
     287    %elif iMod == X86_MOD_MEM4
    290288        dd      -038f8acf3h
    291       %assign  iValue  iValue - 038f8acf3h
    292      %endif
    293       %assign  iValue  iValue & 0ffffffffh
     289     %assign  iValue  iValue - 038f8acf3h
     290    %endif
     291    %assign  iValue  iValue & 0ffffffffh
    294292
    295293        ; cmp iDstReg, iValue
    296      %if (iValue <= 07fffffffh && iValue >= 0) || (iMod == 0 && (iMemReg & 7) == 5)
     294    %if (iValue <= 07fffffffh && iValue >= 0) || (iMod == 0 && (iMemReg & 7) == 5)
    297295        db      X86_OP_REX_W | ((iDstReg & 8) >> 3)
    298296        db      81h, X86_MODRM_MAKE(X86_MOD_REG, 7, iDstReg & 7)
    299       %if iMod == 0 && (iMemReg & 7) == 5
     297     %if iMod == 0 && (iMemReg & 7) == 5
    300298        dd      .test_label wrt BS3FLAT
    301       %else
     299     %else
    302300        dd      iValue
    303       %endif
    304      %else
    305       %if iDstReg != X86_GREG_xAX
     301     %endif
     302    %else
     303     %if iDstReg != X86_GREG_xAX
    306304        mov     eax, iValue
     305        ;cmp     eax, %sel(iDstReg+1, rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi, r8, r9, r10, r11, r12, r13, r14, r15)
    307306        db      X86_OP_REX_W | ((iDstReg & 8) >> 3)
    308307        db      39h, X86_MODRM_MAKE(X86_MOD_REG, X86_GREG_xAX, iDstReg & 7)
    309       %else
     308     %else
    310309        mov     ecx, iValue
    311310        cmp     rax, rcx
    312       %endif
    313      %endif
    314      %if iDstReg == 4
    315         mov     rsp, [BS3_DATA16_WRT(BS3_DATA_NM(g_bs3CpuBasic3_lea_rsp))]
    316      %endif
     311     %endif
     312    %endif
     313    %if iDstReg == 4
     314        mov     rsp, [BS3_DATA16_WRT(BS3_DATA_NM(g_bs3CpuBasic3_lea_rsp))]
     315    %endif
    317316        jz      $+3
    318317        int3
     
    322321        ;
    323322        call    .load_regs
    324      %if iDstReg == 4
     323    %if iDstReg == 4
    325324        mov     rsp, LEA_RSP
    326      %endif
     325    %endif
    327326
    328327        ; lea
    329      %assign   iValue  iMemReg_Value
    330       %if iDstReg >= 8 || iMemReg >= 8
     328    %assign   iValue  iMemReg_Value
     329    %if iDstReg >= 8 || iMemReg >= 8
    331330        db      X86_OP_REX | ((iDstReg & 8) >> 1) | ((iMemReg & 8) >> 3)
    332       %endif
     331    %endif
    333332        db      8dh, X86_MODRM_MAKE(iMod, iDstReg & 7, iMemReg & 7)
    334      %if iMod == X86_MOD_MEM1
     333    %if iMod == X86_MOD_MEM1
    335334        db      16
    336       %assign  iValue  iValue + 16
    337      %elif iMod == 0 && (iMemReg & 7) == 5
     335     %assign  iValue  iValue + 16
     336    %elif iMod == 0 && (iMemReg & 7) == 5
    338337        dd      .load_regs - $ - 4
    339      %elif iMod == X86_MOD_MEM4
     338    %elif iMod == X86_MOD_MEM4
    340339        dd      0596829deh
    341       %assign  iValue  iValue + 0596829deh
    342      %endif
    343       %assign  iValue  iValue & 0ffffffffh
     340     %assign  iValue  iValue + 0596829deh
     341    %endif
     342    %assign  iValue  iValue & 0ffffffffh
    344343
    345344        ; cmp iDstReg, iValue
    346      %if (iValue <= 07fffffffh && iValue >= 0) || (iMod == 0 && (iMemReg & 7) == 5)
     345    %if (iValue <= 07fffffffh && iValue >= 0) || (iMod == 0 && (iMemReg & 7) == 5)
    347346        db      X86_OP_REX_W | ((iDstReg & 8) >> 3)
    348347        db      81h, X86_MODRM_MAKE(X86_MOD_REG, 7, iDstReg & 7)
    349       %if iMod == 0 && (iMemReg & 7) == 5
     348     %if iMod == 0 && (iMemReg & 7) == 5
    350349        dd      .load_regs wrt BS3FLAT
    351       %else
     350     %else
    352351        dd      iValue
    353       %endif
    354      %else
    355       %if iDstReg != X86_GREG_xAX
     352     %endif
     353    %else
     354     %if iDstReg != X86_GREG_xAX
    356355        mov     eax, iValue
    357356        db      X86_OP_REX_W | ((iDstReg & 8) >> 3)
    358357        db      39h, X86_MODRM_MAKE(X86_MOD_REG, X86_GREG_xAX, iDstReg & 7)
    359       %else
     358     %else
    360359        mov     ecx, iValue
    361360        cmp     rax, rcx
    362       %endif
    363      %endif
    364      %if iDstReg == 4
    365         mov     rsp, [BS3_DATA16_WRT(BS3_DATA_NM(g_bs3CpuBasic3_lea_rsp))]
    366      %endif
     361     %endif
     362    %endif
     363    %if iDstReg == 4
     364        mov     rsp, [BS3_DATA16_WRT(BS3_DATA_NM(g_bs3CpuBasic3_lea_rsp))]
     365    %endif
    367366        jz      $+3
    368367        int3
     
    372371        ;
    373372        call    .load_regs
    374      %if iDstReg == 4
     373    %if iDstReg == 4
    375374        mov     rsp, LEA_RSP
    376      %endif
     375    %endif
    377376
    378377        ; lea
    379      %assign   iValue  iMemReg_Value
     378    %assign   iValue  iMemReg_Value
    380379        db      X86_OP_PRF_SIZE_OP
    381       %if iDstReg >= 8 || iMemReg >= 8
     380    %if iDstReg >= 8 || iMemReg >= 8
    382381        db      X86_OP_REX | ((iDstReg & 8) >> 1) | ((iMemReg & 8) >> 3)
    383       %endif
     382    %endif
    384383        db      8dh, X86_MODRM_MAKE(iMod, iDstReg & 7, iMemReg & 7)
    385      %if iMod == X86_MOD_MEM1
     384    %if iMod == X86_MOD_MEM1
    386385        db      -16
    387       %assign  iValue  iValue - 16
    388      %elif iMod == 0 && (iMemReg & 7) == 5
     386     %assign  iValue  iValue - 16
     387    %elif iMod == 0 && (iMemReg & 7) == 5
    389388        dd      _Bs3Text16_StartOfSegment - $ - 4 + 7 wrt BS3FLAT
    390       %assign  iValue  7
    391      %elif iMod == X86_MOD_MEM4
     389     %assign  iValue  7
     390    %elif iMod == X86_MOD_MEM4
    392391        dd      075682332h
    393       %assign  iValue  iValue + 075682332h
    394      %endif
    395       %assign  iValue  (iValue & 0ffffh) | (iDstReg_Value & 0ffffffffffff0000h)
     392     %assign  iValue  iValue + 075682332h
     393    %endif
     394    %assign  iValue  (iValue & 0ffffh) | (iDstReg_Value & 0ffffffffffff0000h)
    396395
    397396        ; cmp iDstReg, iValue
    398      %if (iValue <= 07fffffffh && iValue >= -080000000h)
     397    %if (iValue <= 07fffffffh && iValue >= -080000000h)
    399398        db      X86_OP_REX_W | ((iDstReg & 8) >> 3)
    400399        db      81h, X86_MODRM_MAKE(X86_MOD_REG, 7, iDstReg & 7)
    401400        dd      iValue
    402      %elif iDstReg != X86_GREG_xAX
     401    %elif iDstReg != X86_GREG_xAX
    403402        mov     rax, iValue
    404403        db      X86_OP_REX_W | ((iDstReg & 8) >> 3)
    405404        db      39h, X86_MODRM_MAKE(X86_MOD_REG, X86_GREG_xAX, iDstReg & 7)
    406      %else
     405    %else
    407406        mov     rcx, iValue
    408407        cmp     rax, rcx
    409      %endif
    410      %if iDstReg == 4
    411         mov     rsp, [BS3_DATA16_WRT(BS3_DATA_NM(g_bs3CpuBasic3_lea_rsp))]
    412      %endif
     408    %endif
     409    %if iDstReg == 4
     410        mov     rsp, [BS3_DATA16_WRT(BS3_DATA_NM(g_bs3CpuBasic3_lea_rsp))]
     411    %endif
    413412        jz      $+3
    414413        int3
     
    418417        ;
    419418        call    .load_regs
    420      %if iDstReg == 4
     419    %if iDstReg == 4
    421420        mov     rsp, LEA_RSP
    422      %endif
     421    %endif
    423422
    424423        ; lea
    425      %assign   iValue  iMemReg_Value
     424    %assign   iValue  iMemReg_Value
    426425        db      X86_OP_PRF_SIZE_OP
    427426        db      X86_OP_PRF_SIZE_ADDR
    428       %if iDstReg >= 8 || iMemReg >= 8
     427    %if iDstReg >= 8 || iMemReg >= 8
    429428        db      X86_OP_REX | ((iDstReg & 8) >> 1) | ((iMemReg & 8) >> 3)
    430       %endif
     429    %endif
    431430        db      8dh, X86_MODRM_MAKE(iMod, iDstReg & 7, iMemReg & 7)
    432      %if iMod == X86_MOD_MEM1
     431    %if iMod == X86_MOD_MEM1
    433432        db      99
    434       %assign  iValue  iValue + 99
    435      %elif iMod == 0 && (iMemReg & 7) == 5
     433     %assign  iValue  iValue + 99
     434    %elif iMod == 0 && (iMemReg & 7) == 5
    436435        dd      _Bs3Text16_StartOfSegment - $ - 4 + 3347 wrt BS3FLAT
    437       %assign  iValue  3347
    438      %elif iMod == X86_MOD_MEM4
     436     %assign  iValue  3347
     437    %elif iMod == X86_MOD_MEM4
    439438        dd      -075623432h
    440       %assign  iValue  iValue - 075623432h
    441      %endif
    442       %assign  iValue  (iValue & 0ffffh) | (iDstReg_Value & 0ffffffffffff0000h)
     439     %assign  iValue  iValue - 075623432h
     440    %endif
     441    %assign  iValue  (iValue & 0ffffh) | (iDstReg_Value & 0ffffffffffff0000h)
    443442
    444443        ; cmp iDstReg, iValue
    445      %if (iValue <= 07fffffffh && iValue >= -080000000h)
     444    %if (iValue <= 07fffffffh && iValue >= -080000000h)
    446445        db      X86_OP_REX_W | ((iDstReg & 8) >> 3)
    447446        db      81h, X86_MODRM_MAKE(X86_MOD_REG, 7, iDstReg & 7)
    448447        dd      iValue
    449      %elif iDstReg != X86_GREG_xAX
     448    %elif iDstReg != X86_GREG_xAX
    450449        mov     rax, iValue
    451450        db      X86_OP_REX_W | ((iDstReg & 8) >> 3)
    452451        db      39h, X86_MODRM_MAKE(X86_MOD_REG, X86_GREG_xAX, iDstReg & 7)
    453      %else
     452    %else
    454453        mov     rcx, iValue
    455454        cmp     rax, rcx
    456      %endif
    457      %if iDstReg == 4
    458         mov     rsp, [BS3_DATA16_WRT(BS3_DATA_NM(g_bs3CpuBasic3_lea_rsp))]
    459      %endif
     455    %endif
     456    %if iDstReg == 4
     457        mov     rsp, [BS3_DATA16_WRT(BS3_DATA_NM(g_bs3CpuBasic3_lea_rsp))]
     458    %endif
    460459        jz      $+3
    461460        int3
    462461
    463     %endif ; !SIB
    464     %assign iMemReg    iMemReg + 1
    465    %endrep
    466    %assign iDstReg     (iDstReg + 1) & 15
     462   %endif ; !SIB
     463   %assign iMemReg    iMemReg + 1
    467464  %endrep
    468   %assign iMod         iMod + 1
     465  %assign iDstReg     iDstReg + 1
    469466 %endrep
     467 %assign iMod         iMod + 1
     468%endrep
    470469
    471470        mov     rsp, [BS3_DATA16_WRT(BS3_DATA_NM(g_bs3CpuBasic3_lea_rsp))]
     
    504503        mov     r15, LEA_R15
    505504        ret
    506 %endif
    507505BS3_PROC_END_CMN   bs3CpuBasic3_lea_64
    508506
Note: See TracChangeset for help on using the changeset viewer.

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