Changeset 58749 in vbox for trunk/include/iprt/asm-watcom-x86-32.h
- Timestamp:
- Nov 18, 2015 7:46:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/asm-watcom-x86-32.h
r58709 r58749 35 35 36 36 /* 37 * Turns out we cannot use 'ds' for segment stuff here because the compiler 38 * seems to insists on loading the DGROUP segment into 'ds' before calling 39 * stuff when using -ecc. Using 'es' instead as this seems to work fine. 37 * Note! The #undef that preceds the #pragma aux statements is for undoing 38 * the mangling, because the symbol in #pragma aux [symbol] statements 39 * doesn't get subjected to preprocessing. This is also why we include 40 * the watcom header at the top rather than at the bottom of the 41 * asm-amd64-x86.h file. 40 42 */ 41 43 44 #undef ASMCompilerBarrier 42 45 #if 0 /* overkill version. */ 43 46 # pragma aux ASMCompilerBarrier = \ … … 52 55 #endif 53 56 57 #undef ASMNopPause 54 58 #pragma aux ASMNopPause = \ 55 59 ".686p" \ … … 59 63 modify exact [] nomemory; 60 64 65 #undef ASMAtomicXchgU8 61 66 #pragma aux ASMAtomicXchgU8 = \ 62 67 "xchg [ecx], al" \ … … 65 70 modify exact [al]; 66 71 72 #undef ASMAtomicXchgU16 67 73 #pragma aux ASMAtomicXchgU16 = \ 68 74 "xchg [ecx], ax" \ … … 71 77 modify exact [ax]; 72 78 79 #undef ASMAtomicXchgU32 73 80 #pragma aux ASMAtomicXchgU32 = \ 74 81 "xchg [ecx], eax" \ … … 77 84 modify exact [eax]; 78 85 86 #undef ASMAtomicXchgU64 79 87 #pragma aux ASMAtomicXchgU64 = \ 80 88 ".586" \ … … 86 94 modify exact [edx ecx ebx eax]; 87 95 96 #undef ASMAtomicCmpXchgU8 88 97 #pragma aux ASMAtomicCmpXchgU8 = \ 89 98 ".486" \ … … 94 103 modify exact [al]; 95 104 105 #undef ASMAtomicCmpXchgU16 96 106 #pragma aux ASMAtomicCmpXchgU16 = \ 97 107 ".486" \ … … 102 112 modify exact [ax]; 103 113 114 #undef ASMAtomicCmpXchgU32 104 115 #pragma aux ASMAtomicCmpXchgU32 = \ 105 116 ".486" \ … … 110 121 modify exact [eax]; 111 122 123 #undef ASMAtomicCmpXchgU64 112 124 #pragma aux ASMAtomicCmpXchgU64 = \ 113 125 ".586" \ … … 118 130 modify exact [eax edx]; 119 131 132 #undef ASMAtomicCmpXchgExU32 120 133 #pragma aux ASMAtomicCmpXchgExU32 = \ 121 134 ".586" \ … … 127 140 modify exact [eax]; 128 141 142 #undef ASMAtomicCmpXchgExU64 129 143 #pragma aux ASMAtomicCmpXchgExU64 = \ 130 144 ".586" \ … … 137 151 modify exact [eax edx]; 138 152 153 #undef ASMSerializeInstruction 139 154 #pragma aux ASMSerializeInstruction = \ 140 155 ".586" \ … … 144 159 modify exact [eax ebx ecx edx]; 145 160 161 #undef ASMAtomicReadU64 146 162 #pragma aux ASMAtomicReadU64 = \ 147 163 ".586" \ … … 155 171 modify exact [eax ebx ecx edx]; 156 172 173 #undef ASMAtomicUoReadU64 157 174 #pragma aux ASMAtomicUoReadU64 = \ 158 175 ".586" \ … … 166 183 modify exact [eax ebx ecx edx]; 167 184 185 #undef ASMAtomicAddU16 168 186 #pragma aux ASMAtomicAddU16 = \ 169 187 ".486" \ … … 173 191 modify exact [ax]; 174 192 193 #undef ASMAtomicAddU32 175 194 #pragma aux ASMAtomicAddU32 = \ 176 195 ".486" \ … … 180 199 modify exact [eax]; 181 200 201 #undef ASMAtomicIncU16 182 202 #pragma aux ASMAtomicIncU16 = \ 183 203 ".486" \ … … 189 209 modify exact [ax]; 190 210 211 #undef ASMAtomicIncU32 191 212 #pragma aux ASMAtomicIncU32 = \ 192 213 ".486" \ … … 200 221 /* ASMAtomicIncU64: Should be done by C inline or in external file. */ 201 222 223 #undef ASMAtomicDecU16 202 224 #pragma aux ASMAtomicDecU16 = \ 203 225 ".486" \ … … 209 231 modify exact [ax]; 210 232 233 #undef ASMAtomicDecU32 211 234 #pragma aux ASMAtomicDecU32 = \ 212 235 ".486" \ … … 220 243 /* ASMAtomicDecU64: Should be done by C inline or in external file. */ 221 244 245 #undef ASMAtomicOrU32 222 246 #pragma aux ASMAtomicOrU32 = \ 223 247 "lock or [ecx], eax" \ … … 227 251 /* ASMAtomicOrU64: Should be done by C inline or in external file. */ 228 252 253 #undef ASMAtomicAndU32 229 254 #pragma aux ASMAtomicAndU32 = \ 230 255 "lock and [ecx], eax" \ … … 234 259 /* ASMAtomicAndU64: Should be done by C inline or in external file. */ 235 260 261 #undef ASMAtomicUoOrU32 236 262 #pragma aux ASMAtomicUoOrU32 = \ 237 263 "or [ecx], eax" \ … … 241 267 /* ASMAtomicUoOrU64: Should be done by C inline or in external file. */ 242 268 269 #undef ASMAtomicUoAndU32 243 270 #pragma aux ASMAtomicUoAndU32 = \ 244 271 "and [ecx], eax" \ … … 248 275 /* ASMAtomicUoAndU64: Should be done by C inline or in external file. */ 249 276 277 #undef ASMAtomicUoIncU32 250 278 #pragma aux ASMAtomicUoIncU32 = \ 251 279 ".486" \ … … 256 284 modify exact [eax]; 257 285 286 #undef ASMAtomicUoDecU32 258 287 #pragma aux ASMAtomicUoDecU32 = \ 259 288 ".486" \ … … 265 294 modify exact [eax]; 266 295 296 #undef ASMMemZeroPage 267 297 #pragma aux ASMMemZeroPage = \ 268 298 "mov ecx, 1024" \ … … 272 302 modify exact [eax ecx edi]; 273 303 304 #undef ASMMemZero32 274 305 #pragma aux ASMMemZero32 = \ 275 306 "shr ecx, 2" \ … … 279 310 modify exact [eax ecx edi]; 280 311 312 #undef ASMMemZero32 281 313 #pragma aux ASMMemZero32 = \ 282 314 "shr ecx, 2" \ … … 285 317 modify exact [ecx edi]; 286 318 319 #undef ASMProbeReadByte 287 320 #pragma aux ASMProbeReadByte = \ 288 321 "mov al, [ecx]" \ … … 291 324 modify exact [al]; 292 325 326 #undef ASMBitSet 293 327 #pragma aux ASMBitSet = \ 294 328 "bts [ecx], eax" \ … … 296 330 modify exact []; 297 331 332 #undef ASMAtomicBitSet 298 333 #pragma aux ASMAtomicBitSet = \ 299 334 "lock bts [ecx], eax" \ … … 301 336 modify exact []; 302 337 338 #undef ASMBitClear 303 339 #pragma aux ASMBitClear = \ 304 340 "btr [ecx], eax" \ … … 306 342 modify exact []; 307 343 344 #undef ASMAtomicBitClear 308 345 #pragma aux ASMAtomicBitClear = \ 309 346 "lock btr [ecx], eax" \ … … 311 348 modify exact []; 312 349 350 #undef ASMBitToggle 313 351 #pragma aux ASMBitToggle = \ 314 352 "btc [ecx], eax" \ … … 316 354 modify exact []; 317 355 356 #undef ASMAtomicBitToggle 318 357 #pragma aux ASMAtomicBitToggle = \ 319 358 "lock btc [ecx], eax" \ … … 322 361 323 362 363 #undef ASMBitTestAndSet 324 364 #pragma aux ASMBitTestAndSet = \ 325 365 "bts [ecx], eax" \ … … 329 369 modify exact [eax]; 330 370 371 #undef ASMAtomicBitTestAndSet 331 372 #pragma aux ASMAtomicBitTestAndSet = \ 332 373 "lock bts [ecx], eax" \ … … 336 377 modify exact [eax]; 337 378 379 #undef ASMBitTestAndClear 338 380 #pragma aux ASMBitTestAndClear = \ 339 381 "btr [ecx], eax" \ … … 343 385 modify exact [eax]; 344 386 387 #undef ASMAtomicBitTestAndClear 345 388 #pragma aux ASMAtomicBitTestAndClear = \ 346 389 "lock btr [ecx], eax" \ … … 350 393 modify exact [eax]; 351 394 395 #undef ASMBitTestAndToggle 352 396 #pragma aux ASMBitTestAndToggle = \ 353 397 "btc [ecx], eax" \ … … 357 401 modify exact [eax]; 358 402 403 #undef ASMAtomicBitTestAndToggle 359 404 #pragma aux ASMAtomicBitTestAndToggle = \ 360 405 "lock btc [ecx], eax" \ … … 365 410 366 411 /** @todo this is way to much inline assembly, better off in an external function. */ 412 #undef ASMBitFirstClear 367 413 #pragma aux ASMBitFirstClear = \ 368 414 "mov edx, edi" /* save start of bitmap for later */ \ … … 387 433 388 434 /** @todo this is way to much inline assembly, better off in an external function. */ 435 #undef ASMBitFirstSet 389 436 #pragma aux ASMBitFirstSet = \ 390 437 "mov edx, edi" /* save start of bitmap for later */ \ … … 408 455 /* ASMBitNextSet: Too much work, do when needed. */ 409 456 457 #undef ASMBitFirstSetU32 410 458 #pragma aux ASMBitFirstSetU32 = \ 411 459 "bsf eax, eax" \ … … 420 468 modify exact [eax] nomemory; 421 469 470 #undef ASMBitLastSetU32 422 471 #pragma aux ASMBitLastSetU32 = \ 423 472 "bsr eax, eax" \ … … 432 481 modify exact [eax] nomemory; 433 482 483 #undef ASMByteSwapU16 434 484 #pragma aux ASMByteSwapU16 = \ 435 485 "ror ax, 8" \ … … 438 488 modify exact [ax] nomemory; 439 489 490 #undef ASMByteSwapU32 440 491 #pragma aux ASMByteSwapU32 = \ 441 492 "bswap eax" \ … … 444 495 modify exact [eax] nomemory; 445 496 497 #undef ASMRotateLeftU32 446 498 #pragma aux ASMRotateLeftU32 = \ 447 499 "rol eax, cl" \ … … 450 502 modify exact [eax] nomemory; 451 503 504 #undef ASMRotateRightU32 452 505 #pragma aux ASMRotateRightU32 = \ 453 506 "ror eax, cl" \
Note:
See TracChangeset
for help on using the changeset viewer.