src/stdlib/SDL_stdlib.c
author Sam Lantinga <slouken@libsdl.org>
Sun, 28 May 2006 13:04:16 +0000
branchSDL-1.3
changeset 1662 782fd950bd46
parent 1433 bb6839704ed6
child 1663 11775724e3fe
permissions -rw-r--r--
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.

WARNING: None of the video drivers have been updated for the new API yet! The API is still under design and very fluid.

The code is now run through a consistent indent format:
indent -i4 -nut -nsc -br -ce

The headers are being converted to automatically generate doxygen documentation.
slouken@1330
     1
/*
slouken@1330
     2
    SDL - Simple DirectMedia Layer
slouken@1330
     3
    Copyright (C) 1997-2006 Sam Lantinga
slouken@1330
     4
slouken@1330
     5
    This library is free software; you can redistribute it and/or
slouken@1330
     6
    modify it under the terms of the GNU Lesser General Public
slouken@1330
     7
    License as published by the Free Software Foundation; either
slouken@1330
     8
    version 2.1 of the License, or (at your option) any later version.
slouken@1330
     9
slouken@1330
    10
    This library is distributed in the hope that it will be useful,
slouken@1330
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@1330
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@1330
    13
    Lesser General Public License for more details.
slouken@1330
    14
slouken@1330
    15
    You should have received a copy of the GNU Lesser General Public
slouken@1330
    16
    License along with this library; if not, write to the Free Software
slouken@1330
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
slouken@1330
    18
slouken@1330
    19
    Sam Lantinga
slouken@1330
    20
    slouken@libsdl.org
slouken@1330
    21
*/
slouken@1402
    22
#include "SDL_config.h"
slouken@1330
    23
slouken@1330
    24
/* This file contains portable stdlib functions for SDL */
slouken@1330
    25
slouken@1354
    26
#include "SDL_stdinc.h"
slouken@1330
    27
slouken@1330
    28
#ifndef HAVE_LIBC
slouken@1330
    29
/* These are some C runtime intrinsics that need to be defined */
slouken@1330
    30
slouken@1330
    31
#if defined(_MSC_VER)
slouken@1330
    32
slouken@1433
    33
#ifndef __FLTUSED__
slouken@1433
    34
#define __FLTUSED__
slouken@1433
    35
#ifdef __cplusplus
slouken@1662
    36
extern "C"
slouken@1433
    37
#endif
slouken@1662
    38
__declspec (selectany)
slouken@1662
    39
     int _fltused = 1;
slouken@1433
    40
#endif
slouken@1433
    41
slouken@1346
    42
/* Float to long */
slouken@1662
    43
     void __declspec (naked) _ftol ()
slouken@1345
    44
{
slouken@1662
    45
    __asm {
slouken@1662
    46
        push ebp mov ebp, esp sub esp, 20 h and esp, 0F FFFFFF0h fld st (0)
slouken@1662
    47
        fst dword ptr[esp + 18 h]
slouken@1662
    48
        fistp qword ptr[esp + 10 h]
slouken@1662
    49
        fild qword ptr[esp + 10 h]
slouken@1662
    50
        mov edx, dword ptr[esp + 18 h]
slouken@1662
    51
        mov eax, dword ptr[esp + 10 h]
slouken@1662
    52
        test eax, eax
slouken@1662
    53
            je integer_QnaN_or_zero
slouken@1662
    54
            arg_is_not_integer_QnaN:fsubp st (1), st
slouken@1662
    55
            test edx, edx jns positive fstp dword ptr[esp]
slouken@1662
    56
        mov ecx, dword ptr[esp]
slouken@1662
    57
        xor ecx, 80000000 h
slouken@1662
    58
            add ecx, 7F FFFFFFh adc eax, 0 mov edx, dword ptr[esp + 14 h]
slouken@1662
    59
        adc edx, 0 jmp localexit positive:fstp dword ptr[esp]
slouken@1662
    60
        mov ecx, dword ptr[esp]
slouken@1662
    61
        add ecx, 7F FFFFFFh sbb eax, 0 mov edx, dword ptr[esp + 14 h]
slouken@1662
    62
        sbb edx, 0
slouken@1662
    63
            jmp localexit integer_QnaN_or_zero:mov edx, dword ptr[esp + 14 h]
slouken@1662
    64
        test edx, 7F FFFFFFh
slouken@1662
    65
            jne arg_is_not_integer_QnaN fstp dword ptr[esp + 18 h]
slouken@1662
    66
    fstp dword ptr[esp + 18 h] localexit:leave ret}
slouken@1345
    67
}
slouken@1662
    68
void
slouken@1662
    69
__declspec (naked)
slouken@1662
    70
_ftol2_sse ()
slouken@1330
    71
{
slouken@1662
    72
    _ftol ();
slouken@1330
    73
}
slouken@1330
    74
slouken@1346
    75
/* 64-bit math operators for 32-bit systems */
slouken@1662
    76
void
slouken@1662
    77
__declspec (naked)
slouken@1662
    78
_allmul ()
slouken@1330
    79
{
slouken@1662
    80
    __asm {
slouken@1662
    81
        push ebp
slouken@1662
    82
            mov ebp, esp
slouken@1662
    83
            push edi
slouken@1662
    84
            push esi push ebx sub esp, 0 Ch mov eax, dword ptr[ebp + 10 h]
slouken@1662
    85
        mov edi, dword ptr[ebp + 8]
slouken@1662
    86
        mov ebx, eax mov esi, eax sar esi, 1F h mov eax, dword ptr[ebp + 8]
slouken@1662
    87
        mul ebx
slouken@1662
    88
            imul edi, esi
slouken@1662
    89
            mov ecx, edx
slouken@1662
    90
            mov dword ptr[ebp - 18 h], eax mov edx, dword ptr[ebp + 0 Ch]
slouken@1662
    91
        add ecx, edi imul ebx, edx mov eax, dword ptr[ebp - 18 h]
slouken@1662
    92
        lea ebx,[ebx + ecx]
slouken@1662
    93
        mov dword ptr[ebp - 14 h], ebx mov edx, dword ptr[ebp - 14 h]
slouken@1662
    94
    add esp, 0 Ch pop ebx pop esi pop edi pop ebp ret}
slouken@1330
    95
}
slouken@1662
    96
void
slouken@1662
    97
__declspec (naked)
slouken@1662
    98
_alldiv ()
slouken@1330
    99
{
slouken@1662
   100
    __asm {
slouken@1662
   101
        push edi push esi push ebx xor edi, edi mov eax, dword ptr[esp + 14 h]
slouken@1662
   102
        or eax, eax jge L1 inc edi mov edx, dword ptr[esp + 10 h]
slouken@1662
   103
        neg eax
slouken@1662
   104
            neg edx
slouken@1662
   105
            sbb eax, 0
slouken@1662
   106
            mov dword ptr[esp + 14 h], eax
slouken@1662
   107
            mov dword ptr[esp + 10 h], edx L1:mov eax, dword ptr[esp + 1 Ch]
slouken@1662
   108
        or eax, eax jge L2 inc edi mov edx, dword ptr[esp + 18 h]
slouken@1662
   109
        neg eax
slouken@1662
   110
            neg edx
slouken@1662
   111
            sbb eax, 0
slouken@1662
   112
            mov dword ptr[esp + 1 Ch], eax
slouken@1662
   113
            mov dword ptr[esp + 18 h], edx
slouken@1662
   114
            L2:or eax, eax jne L3 mov ecx, dword ptr[esp + 18 h]
slouken@1662
   115
        mov eax, dword ptr[esp + 14 h]
slouken@1662
   116
        xor edx, edx div ecx mov ebx, eax mov eax, dword ptr[esp + 10 h]
slouken@1662
   117
        div ecx
slouken@1662
   118
            mov edx, ebx jmp L4 L3:mov ebx, eax mov ecx, dword ptr[esp + 18 h]
slouken@1662
   119
        mov edx, dword ptr[esp + 14 h]
slouken@1662
   120
        mov eax, dword ptr[esp + 10 h]
slouken@1662
   121
slouken@1662
   122
slouken@1662
   123
slouken@1662
   124
slouken@1662
   125
slouken@1662
   126
slouken@1662
   127
         
slouken@1662
   128
            L5:shr ebx, 1
slouken@1662
   129
            rcr ecx, 1
slouken@1662
   130
            shr edx, 1
slouken@1662
   131
            rcr eax, 1
slouken@1662
   132
            or ebx, ebx jne L5 div ecx mov esi, eax mul dword ptr[esp + 1 Ch]
slouken@1662
   133
        mov ecx, eax mov eax, dword ptr[esp + 18 h]
slouken@1662
   134
        mul esi add edx, ecx jb L6 cmp edx, dword ptr[esp + 14 h]
slouken@1662
   135
        ja L6 jb L7 cmp eax, dword ptr[esp + 10 h]
slouken@1662
   136
    jbe L7
slouken@1662
   137
            L6:dec esi
slouken@1662
   138
            L7:xor edx, edx
slouken@1662
   139
            mov eax, esi
slouken@1662
   140
            L4:dec edi
slouken@1662
   141
            jne L8
slouken@1662
   142
            neg edx neg eax sbb edx, 0 L8:pop ebx pop esi pop edi ret 10 h}
slouken@1330
   143
}
slouken@1662
   144
void
slouken@1662
   145
__declspec (naked)
slouken@1662
   146
_aulldiv ()
slouken@1330
   147
{
slouken@1662
   148
    __asm {
slouken@1662
   149
        push ebx push esi mov eax, dword ptr[esp + 18 h]
slouken@1662
   150
        or eax, eax jne L1 mov ecx, dword ptr[esp + 14 h]
slouken@1662
   151
        mov eax, dword ptr[esp + 10 h]
slouken@1662
   152
        xor edx, edx div ecx mov ebx, eax mov eax, dword ptr[esp + 0 Ch]
slouken@1662
   153
        div ecx
slouken@1662
   154
            mov edx, ebx jmp L2 L1:mov ecx, eax mov ebx, dword ptr[esp + 14 h]
slouken@1662
   155
        mov edx, dword ptr[esp + 10 h]
slouken@1662
   156
        mov eax, dword ptr[esp + 0 Ch]
slouken@1662
   157
slouken@1662
   158
slouken@1662
   159
slouken@1662
   160
slouken@1662
   161
slouken@1662
   162
slouken@1662
   163
         
slouken@1662
   164
            L3:shr ecx, 1
slouken@1662
   165
            rcr ebx, 1
slouken@1662
   166
            shr edx, 1
slouken@1662
   167
            rcr eax, 1
slouken@1662
   168
            or ecx, ecx jne L3 div ebx mov esi, eax mul dword ptr[esp + 18 h]
slouken@1662
   169
        mov ecx, eax mov eax, dword ptr[esp + 14 h]
slouken@1662
   170
        mul esi add edx, ecx jb L4 cmp edx, dword ptr[esp + 10 h]
slouken@1662
   171
        ja L4 jb L5 cmp eax, dword ptr[esp + 0 Ch]
slouken@1662
   172
    jbe L5
slouken@1662
   173
            L4:dec esi
slouken@1662
   174
            L5:xor edx, edx mov eax, esi L2:pop esi pop ebx ret 10 h}
slouken@1330
   175
}
slouken@1662
   176
void
slouken@1662
   177
__declspec (naked)
slouken@1662
   178
_allrem ()
slouken@1330
   179
{
slouken@1662
   180
    __asm {
slouken@1662
   181
        push ebx push edi xor edi, edi mov eax, dword ptr[esp + 10 h]
slouken@1662
   182
        or eax, eax jge L1 inc edi mov edx, dword ptr[esp + 0 Ch]
slouken@1662
   183
        neg eax
slouken@1662
   184
            neg edx
slouken@1662
   185
            sbb eax, 0
slouken@1662
   186
            mov dword ptr[esp + 10 h], eax
slouken@1662
   187
            mov dword ptr[esp + 0 Ch], edx L1:mov eax, dword ptr[esp + 18 h]
slouken@1662
   188
        or eax, eax jge L2 mov edx, dword ptr[esp + 14 h]
slouken@1662
   189
        neg eax
slouken@1662
   190
            neg edx
slouken@1662
   191
            sbb eax, 0
slouken@1662
   192
            mov dword ptr[esp + 18 h], eax
slouken@1662
   193
            mov dword ptr[esp + 14 h], edx
slouken@1662
   194
            L2:or eax, eax jne L3 mov ecx, dword ptr[esp + 14 h]
slouken@1662
   195
        mov eax, dword ptr[esp + 10 h]
slouken@1662
   196
        xor edx, edx div ecx mov eax, dword ptr[esp + 0 Ch]
slouken@1662
   197
        div ecx
slouken@1662
   198
            mov eax, edx
slouken@1662
   199
            xor edx, edx
slouken@1662
   200
            dec edi
slouken@1662
   201
            jns L4 jmp L8 L3:mov ebx, eax mov ecx, dword ptr[esp + 14 h]
slouken@1662
   202
        mov edx, dword ptr[esp + 10 h]
slouken@1662
   203
        mov eax, dword ptr[esp + 0 Ch]
slouken@1662
   204
slouken@1662
   205
slouken@1662
   206
slouken@1662
   207
slouken@1662
   208
slouken@1662
   209
slouken@1662
   210
         
slouken@1662
   211
            L5:shr ebx, 1
slouken@1662
   212
            rcr ecx, 1
slouken@1662
   213
            shr edx, 1
slouken@1662
   214
            rcr eax, 1
slouken@1662
   215
            or ebx, ebx jne L5 div ecx mov ecx, eax mul dword ptr[esp + 18 h]
slouken@1662
   216
        xchg eax, ecx mul dword ptr[esp + 14 h]
slouken@1662
   217
        add edx, ecx jb L6 cmp edx, dword ptr[esp + 10 h]
slouken@1662
   218
        ja L6 jb L7 cmp eax, dword ptr[esp + 0 Ch]
slouken@1662
   219
        jbe L7 L6:sub eax, dword ptr[esp + 14 h]
slouken@1662
   220
        sbb edx, dword ptr[esp + 18 h]
slouken@1662
   221
          L7:sub eax, dword ptr[esp + 0 Ch]
slouken@1662
   222
        sbb edx, dword ptr[esp + 10 h]
slouken@1662
   223
    dec edi
slouken@1662
   224
            jns L8 L4:neg edx neg eax sbb edx, 0 L8:pop edi pop ebx ret 10 h}
slouken@1330
   225
}
slouken@1662
   226
void
slouken@1662
   227
__declspec (naked)
slouken@1662
   228
_aullrem ()
slouken@1330
   229
{
slouken@1662
   230
    __asm {
slouken@1662
   231
        push ebx mov eax, dword ptr[esp + 14 h]
slouken@1662
   232
        or eax, eax jne L1 mov ecx, dword ptr[esp + 10 h]
slouken@1662
   233
        mov eax, dword ptr[esp + 0 Ch]
slouken@1662
   234
        xor edx, edx div ecx mov eax, dword ptr[esp + 8]
slouken@1662
   235
        div ecx
slouken@1662
   236
            mov eax, edx
slouken@1662
   237
            xor edx, edx jmp L2 L1:mov ecx, eax mov ebx, dword ptr[esp + 10 h]
slouken@1662
   238
        mov edx, dword ptr[esp + 0 Ch]
slouken@1662
   239
        mov eax, dword ptr[esp + 8]
slouken@1662
   240
slouken@1662
   241
slouken@1662
   242
slouken@1662
   243
slouken@1662
   244
slouken@1662
   245
slouken@1662
   246
         
slouken@1662
   247
            L3:shr ecx, 1
slouken@1662
   248
            rcr ebx, 1
slouken@1662
   249
            shr edx, 1
slouken@1662
   250
            rcr eax, 1
slouken@1662
   251
            or ecx, ecx jne L3 div ebx mov ecx, eax mul dword ptr[esp + 14 h]
slouken@1662
   252
        xchg eax, ecx mul dword ptr[esp + 10 h]
slouken@1662
   253
        add edx, ecx jb L4 cmp edx, dword ptr[esp + 0 Ch]
slouken@1662
   254
        ja L4 jb L5 cmp eax, dword ptr[esp + 8]
slouken@1662
   255
        jbe L5 L4:sub eax, dword ptr[esp + 10 h]
slouken@1662
   256
        sbb edx, dword ptr[esp + 14 h]
slouken@1662
   257
          L5:sub eax, dword ptr[esp + 8]
slouken@1662
   258
        sbb edx, dword ptr[esp + 0 Ch]
slouken@1662
   259
    neg edx neg eax sbb edx, 0 L2:pop ebx ret 10 h}
slouken@1330
   260
}
slouken@1662
   261
void
slouken@1662
   262
__declspec (naked)
slouken@1662
   263
_alldvrm ()
slouken@1330
   264
{
slouken@1662
   265
    __asm {
slouken@1662
   266
        push edi
slouken@1662
   267
            push esi
slouken@1662
   268
            push ebp xor edi, edi xor ebp, ebp mov eax, dword ptr[esp + 14 h]
slouken@1662
   269
        or eax, eax jge L1 inc edi inc ebp mov edx, dword ptr[esp + 10 h]
slouken@1662
   270
        neg eax
slouken@1662
   271
            neg edx
slouken@1662
   272
            sbb eax, 0
slouken@1662
   273
            mov dword ptr[esp + 14 h], eax
slouken@1662
   274
            mov dword ptr[esp + 10 h], edx L1:mov eax, dword ptr[esp + 1 Ch]
slouken@1662
   275
        or eax, eax jge L2 inc edi mov edx, dword ptr[esp + 18 h]
slouken@1662
   276
        neg eax
slouken@1662
   277
            neg edx
slouken@1662
   278
            sbb eax, 0
slouken@1662
   279
            mov dword ptr[esp + 1 Ch], eax
slouken@1662
   280
            mov dword ptr[esp + 18 h], edx
slouken@1662
   281
            L2:or eax, eax jne L3 mov ecx, dword ptr[esp + 18 h]
slouken@1662
   282
        mov eax, dword ptr[esp + 14 h]
slouken@1662
   283
        xor edx, edx div ecx mov ebx, eax mov eax, dword ptr[esp + 10 h]
slouken@1662
   284
        div ecx mov esi, eax mov eax, ebx mul dword ptr[esp + 18 h]
slouken@1662
   285
        mov ecx, eax mov eax, esi mul dword ptr[esp + 18 h]
slouken@1662
   286
        add edx, ecx jmp L4 L3:mov ebx, eax mov ecx, dword ptr[esp + 18 h]
slouken@1662
   287
        mov edx, dword ptr[esp + 14 h]
slouken@1662
   288
        mov eax, dword ptr[esp + 10 h]
slouken@1662
   289
slouken@1662
   290
slouken@1662
   291
slouken@1662
   292
slouken@1662
   293
slouken@1662
   294
slouken@1662
   295
         
slouken@1662
   296
            L5:shr ebx, 1
slouken@1662
   297
            rcr ecx, 1
slouken@1662
   298
            shr edx, 1
slouken@1662
   299
            rcr eax, 1
slouken@1662
   300
            or ebx, ebx jne L5 div ecx mov esi, eax mul dword ptr[esp + 1 Ch]
slouken@1662
   301
        mov ecx, eax mov eax, dword ptr[esp + 18 h]
slouken@1662
   302
        mul esi add edx, ecx jb L6 cmp edx, dword ptr[esp + 14 h]
slouken@1662
   303
        ja L6 jb L7 cmp eax, dword ptr[esp + 10 h]
slouken@1662
   304
        jbe L7 L6:dec esi sub eax, dword ptr[esp + 18 h]
slouken@1662
   305
        sbb edx, dword ptr[esp + 1 Ch]
slouken@1662
   306
          L7:xor ebx, ebx L4:sub eax, dword ptr[esp + 10 h]
slouken@1662
   307
        sbb edx, dword ptr[esp + 14 h]
slouken@1662
   308
    dec ebp
slouken@1662
   309
            jns L9
slouken@1662
   310
            neg edx
slouken@1662
   311
            neg eax
slouken@1662
   312
            sbb edx, 0
slouken@1662
   313
            L9:mov ecx, edx
slouken@1662
   314
            mov edx, ebx
slouken@1662
   315
            mov ebx, ecx
slouken@1662
   316
            mov ecx, eax
slouken@1662
   317
            mov eax, esi
slouken@1662
   318
            dec edi
slouken@1662
   319
            jne L8
slouken@1662
   320
            neg edx neg eax sbb edx, 0 L8:pop ebp pop esi pop edi ret 10 h}
slouken@1330
   321
}
slouken@1662
   322
void
slouken@1662
   323
__declspec (naked)
slouken@1662
   324
_aulldvrm ()
slouken@1330
   325
{
slouken@1662
   326
    __asm {
slouken@1662
   327
        push esi mov eax, dword ptr[esp + 14 h]
slouken@1662
   328
        or eax, eax jne L1 mov ecx, dword ptr[esp + 10 h]
slouken@1662
   329
        mov eax, dword ptr[esp + 0 Ch]
slouken@1662
   330
        xor edx, edx div ecx mov ebx, eax mov eax, dword ptr[esp + 8]
slouken@1662
   331
        div ecx mov esi, eax mov eax, ebx mul dword ptr[esp + 10 h]
slouken@1662
   332
        mov ecx, eax mov eax, esi mul dword ptr[esp + 10 h]
slouken@1662
   333
        add edx, ecx jmp L2 L1:mov ecx, eax mov ebx, dword ptr[esp + 10 h]
slouken@1662
   334
        mov edx, dword ptr[esp + 0 Ch]
slouken@1662
   335
        mov eax, dword ptr[esp + 8]
slouken@1662
   336
slouken@1662
   337
slouken@1662
   338
slouken@1662
   339
slouken@1662
   340
slouken@1662
   341
slouken@1662
   342
         
slouken@1662
   343
            L3:shr ecx, 1
slouken@1662
   344
            rcr ebx, 1
slouken@1662
   345
            shr edx, 1
slouken@1662
   346
            rcr eax, 1
slouken@1662
   347
            or ecx, ecx jne L3 div ebx mov esi, eax mul dword ptr[esp + 14 h]
slouken@1662
   348
        mov ecx, eax mov eax, dword ptr[esp + 10 h]
slouken@1662
   349
        mul esi add edx, ecx jb L4 cmp edx, dword ptr[esp + 0 Ch]
slouken@1662
   350
        ja L4 jb L5 cmp eax, dword ptr[esp + 8]
slouken@1662
   351
        jbe L5 L4:dec esi sub eax, dword ptr[esp + 10 h]
slouken@1662
   352
        sbb edx, dword ptr[esp + 14 h]
slouken@1662
   353
          L5:xor ebx, ebx L2:sub eax, dword ptr[esp + 8]
slouken@1662
   354
        sbb edx, dword ptr[esp + 0 Ch]
slouken@1662
   355
    neg edx
slouken@1662
   356
            neg eax
slouken@1662
   357
            sbb edx, 0
slouken@1662
   358
            mov ecx, edx
slouken@1662
   359
            mov edx, ebx
slouken@1662
   360
            mov ebx, ecx mov ecx, eax mov eax, esi pop esi ret 10 h}
slouken@1330
   361
}
slouken@1662
   362
void
slouken@1662
   363
__declspec (naked)
slouken@1662
   364
_allshl ()
slouken@1330
   365
{
slouken@1662
   366
    __asm {
slouken@1662
   367
    cmp cl, 40 h
slouken@1662
   368
            jae RETZERO
slouken@1662
   369
            cmp cl, 20 h
slouken@1662
   370
            jae MORE32
slouken@1662
   371
            shld edx, eax, cl
slouken@1662
   372
            shl eax, cl
slouken@1662
   373
            ret
slouken@1662
   374
            MORE32:mov edx, eax
slouken@1662
   375
            xor eax, eax
slouken@1662
   376
            and cl, 1F h
slouken@1662
   377
            shl edx, cl ret RETZERO:xor eax, eax xor edx, edx ret}
slouken@1330
   378
}
slouken@1662
   379
void
slouken@1662
   380
__declspec (naked)
slouken@1662
   381
_aullshr ()
slouken@1330
   382
{
slouken@1662
   383
    __asm {
slouken@1662
   384
    cmp cl, 40 h
slouken@1662
   385
            jae RETZERO
slouken@1662
   386
            cmp cl, 20 h
slouken@1662
   387
            jae MORE32
slouken@1662
   388
            shrd eax, edx, cl
slouken@1662
   389
            shr edx, cl
slouken@1662
   390
            ret
slouken@1662
   391
            MORE32:mov eax, edx
slouken@1662
   392
            xor edx, edx
slouken@1662
   393
            and cl, 1F h
slouken@1662
   394
            shr eax, cl ret RETZERO:xor eax, eax xor edx, edx ret}
slouken@1330
   395
}
slouken@1330
   396
slouken@1662
   397
#endif                          /* MSC_VER */
slouken@1330
   398
slouken@1662
   399
#endif                          /* !HAVE_LIBC */
slouken@1662
   400
/* vi: set ts=4 sw=4 expandtab: */