VirtualBox

source: vbox/trunk/include/iprt/asm-watcom-x86-32.h@ 76507

最後變更 在這個檔案從76507是 76507,由 vboxsync 提交於 6 年 前

/include: scm --fix-header-guards. bugref:9344

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 17.0 KB
 
1/** @file
2 * IPRT - Assembly Functions, x86 32-bit Watcom C/C++ pragma aux.
3 */
4
5/*
6 * Copyright (C) 2006-2017 Oracle Corporation
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.alldomusa.eu.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * The contents of this file may alternatively be used under the terms
17 * of the Common Development and Distribution License Version 1.0
18 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
19 * VirtualBox OSE distribution, in which case the provisions of the
20 * CDDL are applicable instead of those of the GPL.
21 *
22 * You may elect to license modified versions of this file under the
23 * terms and conditions of either the GPL or the CDDL or both.
24 */
25
26#ifndef ___iprt_asm_watcom_x86_32_h
27#define ___iprt_asm_watcom_x86_32_h
28#ifndef RT_WITHOUT_PRAGMA_ONCE
29# pragma once
30#endif
31
32#ifndef ___iprt_asm_h
33# error "Don't include this header directly."
34#endif
35
36#ifndef __FLAT__
37# error "Only works with flat pointers! (-mf)"
38#endif
39
40/*
41 * Note! The #undef that preceds the #pragma aux statements is for undoing
42 * the mangling, because the symbol in #pragma aux [symbol] statements
43 * doesn't get subjected to preprocessing. This is also why we include
44 * the watcom header at both the top and the bottom of asm.h file.
45 */
46
47#undef ASMCompilerBarrier
48#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
49# if 0 /* overkill version. */
50# pragma aux ASMCompilerBarrier = \
51 "nop" \
52 parm [] \
53 modify exact [eax ebx ecx edx es ds fs gs];
54# else
55# pragma aux ASMCompilerBarrier = \
56 "" \
57 parm [] \
58 modify exact [];
59# endif
60#endif
61
62#undef ASMNopPause
63#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
64#pragma aux ASMNopPause = \
65 ".686p" \
66 ".xmm2" \
67 "pause" \
68 parm [] nomemory \
69 modify exact [] nomemory;
70#endif
71
72#undef ASMAtomicXchgU8
73#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
74#pragma aux ASMAtomicXchgU8 = \
75 "xchg [ecx], al" \
76 parm [ecx] [al] \
77 value [al] \
78 modify exact [al];
79#endif
80
81#undef ASMAtomicXchgU16
82#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
83#pragma aux ASMAtomicXchgU16 = \
84 "xchg [ecx], ax" \
85 parm [ecx] [ax] \
86 value [ax] \
87 modify exact [ax];
88#endif
89
90#undef ASMAtomicXchgU32
91#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
92#pragma aux ASMAtomicXchgU32 = \
93 "xchg [ecx], eax" \
94 parm [ecx] [eax] \
95 value [eax] \
96 modify exact [eax];
97#endif
98
99#undef ASMAtomicXchgU64
100#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
101#pragma aux ASMAtomicXchgU64 = \
102 ".586" \
103 "try_again:" \
104 "lock cmpxchg8b [esi]" \
105 "jnz try_again" \
106 parm [esi] [ebx ecx] \
107 value [eax edx] \
108 modify exact [edx ecx ebx eax];
109#endif
110
111#undef ASMAtomicCmpXchgU8
112#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
113#pragma aux ASMAtomicCmpXchgU8 = \
114 ".486" \
115 "lock cmpxchg [edx], cl" \
116 "setz al" \
117 parm [edx] [cl] [al] \
118 value [al] \
119 modify exact [al];
120#endif
121
122#undef ASMAtomicCmpXchgU16
123#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
124#pragma aux ASMAtomicCmpXchgU16 = \
125 ".486" \
126 "lock cmpxchg [edx], cx" \
127 "setz al" \
128 parm [edx] [cx] [ax] \
129 value [al] \
130 modify exact [ax];
131#endif
132
133#undef ASMAtomicCmpXchgU32
134#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
135#pragma aux ASMAtomicCmpXchgU32 = \
136 ".486" \
137 "lock cmpxchg [edx], ecx" \
138 "setz al" \
139 parm [edx] [ecx] [eax] \
140 value [al] \
141 modify exact [eax];
142#endif
143
144#undef ASMAtomicCmpXchgU64
145#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
146#pragma aux ASMAtomicCmpXchgU64 = \
147 ".586" \
148 "lock cmpxchg8b [edi]" \
149 "setz al" \
150 parm [edi] [ebx ecx] [eax edx] \
151 value [al] \
152 modify exact [eax edx];
153#endif
154
155#undef ASMAtomicCmpXchgExU32
156#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
157#pragma aux ASMAtomicCmpXchgExU32 = \
158 ".586" \
159 "lock cmpxchg [edx], ecx" \
160 "mov [edi], eax" \
161 "setz al" \
162 parm [edx] [ecx] [eax] [edi] \
163 value [al] \
164 modify exact [eax];
165#endif
166
167#undef ASMAtomicCmpXchgExU64
168#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
169#pragma aux ASMAtomicCmpXchgExU64 = \
170 ".586" \
171 "lock cmpxchg8b [edi]" \
172 "mov [esi], eax" \
173 "mov [esi + 4], edx" \
174 "setz al" \
175 parm [edi] [ebx ecx] [eax edx] [esi] \
176 value [al] \
177 modify exact [eax edx];
178#endif
179
180#undef ASMSerializeInstructionCpuId
181#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
182#pragma aux ASMSerializeInstructionCpuId = \
183 ".586" \
184 "xor eax, eax" \
185 "cpuid" \
186 parm [] \
187 modify exact [eax ebx ecx edx];
188#endif
189
190#undef ASMSerializeInstructionIRet
191#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
192#pragma aux ASMSerializeInstructionIRet = \
193 "pushf" \
194 "push cs" \
195 "call foo" /* 'push offset done' doesn't work */ \
196 "jmp done" \
197 "foo:" \
198 "iret" \
199 "done:" \
200 parm [] \
201 modify exact [];
202#endif
203
204#undef ASMSerializeInstructionRdTscp
205#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
206#pragma aux ASMSerializeInstructionRdTscp = \
207 0x0f 0x01 0xf9 \
208 parm [] \
209 modify exact [eax edx ecx];
210#endif
211
212#undef ASMAtomicReadU64
213#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
214#pragma aux ASMAtomicReadU64 = \
215 ".586" \
216 "xor eax, eax" \
217 "mov edx, eax" \
218 "mov ebx, eax" \
219 "mov ecx, eax" \
220 "lock cmpxchg8b [edi]" \
221 parm [edi] \
222 value [eax edx] \
223 modify exact [eax ebx ecx edx];
224#endif
225
226#undef ASMAtomicUoReadU64
227#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
228#pragma aux ASMAtomicUoReadU64 = \
229 ".586" \
230 "xor eax, eax" \
231 "mov edx, eax" \
232 "mov ebx, eax" \
233 "mov ecx, eax" \
234 "lock cmpxchg8b [edi]" \
235 parm [edi] \
236 value [eax edx] \
237 modify exact [eax ebx ecx edx];
238#endif
239
240#undef ASMAtomicAddU16
241#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
242#pragma aux ASMAtomicAddU16 = \
243 ".486" \
244 "lock xadd [ecx], ax" \
245 parm [ecx] [ax] \
246 value [ax] \
247 modify exact [ax];
248#endif
249
250#undef ASMAtomicAddU32
251#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
252#pragma aux ASMAtomicAddU32 = \
253 ".486" \
254 "lock xadd [ecx], eax" \
255 parm [ecx] [eax] \
256 value [eax] \
257 modify exact [eax];
258#endif
259
260#undef ASMAtomicIncU16
261#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
262#pragma aux ASMAtomicIncU16 = \
263 ".486" \
264 "mov ax, 1" \
265 "lock xadd [ecx], ax" \
266 "inc ax" \
267 parm [ecx] \
268 value [ax] \
269 modify exact [ax];
270#endif
271
272#undef ASMAtomicIncU32
273#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
274#pragma aux ASMAtomicIncU32 = \
275 ".486" \
276 "mov eax, 1" \
277 "lock xadd [ecx], eax" \
278 "inc eax" \
279 parm [ecx] \
280 value [eax] \
281 modify exact [eax];
282#endif
283
284/* ASMAtomicIncU64: Should be done by C inline or in external file. */
285
286#undef ASMAtomicDecU16
287#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
288#pragma aux ASMAtomicDecU16 = \
289 ".486" \
290 "mov ax, 0ffffh" \
291 "lock xadd [ecx], ax" \
292 "dec ax" \
293 parm [ecx] \
294 value [ax] \
295 modify exact [ax];
296#endif
297
298#undef ASMAtomicDecU32
299#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
300#pragma aux ASMAtomicDecU32 = \
301 ".486" \
302 "mov eax, 0ffffffffh" \
303 "lock xadd [ecx], eax" \
304 "dec eax" \
305 parm [ecx] \
306 value [eax] \
307 modify exact [eax];
308#endif
309
310/* ASMAtomicDecU64: Should be done by C inline or in external file. */
311
312#undef ASMAtomicOrU32
313#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
314#pragma aux ASMAtomicOrU32 = \
315 "lock or [ecx], eax" \
316 parm [ecx] [eax] \
317 modify exact [];
318#endif
319
320/* ASMAtomicOrU64: Should be done by C inline or in external file. */
321
322#undef ASMAtomicAndU32
323#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
324#pragma aux ASMAtomicAndU32 = \
325 "lock and [ecx], eax" \
326 parm [ecx] [eax] \
327 modify exact [];
328#endif
329
330/* ASMAtomicAndU64: Should be done by C inline or in external file. */
331
332#undef ASMAtomicUoOrU32
333#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
334#pragma aux ASMAtomicUoOrU32 = \
335 "or [ecx], eax" \
336 parm [ecx] [eax] \
337 modify exact [];
338#endif
339
340/* ASMAtomicUoOrU64: Should be done by C inline or in external file. */
341
342#undef ASMAtomicUoAndU32
343#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
344#pragma aux ASMAtomicUoAndU32 = \
345 "and [ecx], eax" \
346 parm [ecx] [eax] \
347 modify exact [];
348#endif
349
350/* ASMAtomicUoAndU64: Should be done by C inline or in external file. */
351
352#undef ASMAtomicUoIncU32
353#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
354#pragma aux ASMAtomicUoIncU32 = \
355 ".486" \
356 "xadd [ecx], eax" \
357 "inc eax" \
358 parm [ecx] \
359 value [eax] \
360 modify exact [eax];
361#endif
362
363#undef ASMAtomicUoDecU32
364#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
365#pragma aux ASMAtomicUoDecU32 = \
366 ".486" \
367 "mov eax, 0ffffffffh" \
368 "xadd [ecx], eax" \
369 "dec eax" \
370 parm [ecx] \
371 value [eax] \
372 modify exact [eax];
373#endif
374
375#undef ASMMemZeroPage
376#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
377#pragma aux ASMMemZeroPage = \
378 "mov ecx, 1024" \
379 "xor eax, eax" \
380 "rep stosd" \
381 parm [edi] \
382 modify exact [eax ecx edi];
383#endif
384
385#undef ASMMemZero32
386#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
387#pragma aux ASMMemZero32 = \
388 "shr ecx, 2" \
389 "xor eax, eax" \
390 "rep stosd" \
391 parm [edi] [ecx] \
392 modify exact [eax ecx edi];
393#endif
394
395#undef ASMMemFill32
396#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
397#pragma aux ASMMemFill32 = \
398 "shr ecx, 2" \
399 "rep stosd" \
400 parm [edi] [ecx] [eax]\
401 modify exact [ecx edi];
402#endif
403
404#undef ASMProbeReadByte
405#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
406#pragma aux ASMProbeReadByte = \
407 "mov al, [ecx]" \
408 parm [ecx] \
409 value [al] \
410 modify exact [al];
411#endif
412
413#undef ASMBitSet
414#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
415#pragma aux ASMBitSet = \
416 "bts [ecx], eax" \
417 parm [ecx] [eax] \
418 modify exact [];
419#endif
420
421#undef ASMAtomicBitSet
422#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
423#pragma aux ASMAtomicBitSet = \
424 "lock bts [ecx], eax" \
425 parm [ecx] [eax] \
426 modify exact [];
427#endif
428
429#undef ASMBitClear
430#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
431#pragma aux ASMBitClear = \
432 "btr [ecx], eax" \
433 parm [ecx] [eax] \
434 modify exact [];
435#endif
436
437#undef ASMAtomicBitClear
438#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
439#pragma aux ASMAtomicBitClear = \
440 "lock btr [ecx], eax" \
441 parm [ecx] [eax] \
442 modify exact [];
443#endif
444
445#undef ASMBitToggle
446#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
447#pragma aux ASMBitToggle = \
448 "btc [ecx], eax" \
449 parm [ecx] [eax] \
450 modify exact [];
451#endif
452
453#undef ASMAtomicBitToggle
454#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
455#pragma aux ASMAtomicBitToggle = \
456 "lock btc [ecx], eax" \
457 parm [ecx] [eax] \
458 modify exact [];
459#endif
460
461
462#undef ASMBitTestAndSet
463#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
464#pragma aux ASMBitTestAndSet = \
465 "bts [ecx], eax" \
466 "setc al" \
467 parm [ecx] [eax] \
468 value [al] \
469 modify exact [eax];
470#endif
471
472#undef ASMAtomicBitTestAndSet
473#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
474#pragma aux ASMAtomicBitTestAndSet = \
475 "lock bts [ecx], eax" \
476 "setc al" \
477 parm [ecx] [eax] \
478 value [al] \
479 modify exact [eax];
480#endif
481
482#undef ASMBitTestAndClear
483#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
484#pragma aux ASMBitTestAndClear = \
485 "btr [ecx], eax" \
486 "setc al" \
487 parm [ecx] [eax] \
488 value [al] \
489 modify exact [eax];
490#endif
491
492#undef ASMAtomicBitTestAndClear
493#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
494#pragma aux ASMAtomicBitTestAndClear = \
495 "lock btr [ecx], eax" \
496 "setc al" \
497 parm [ecx] [eax] \
498 value [al] \
499 modify exact [eax];
500#endif
501
502#undef ASMBitTestAndToggle
503#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
504#pragma aux ASMBitTestAndToggle = \
505 "btc [ecx], eax" \
506 "setc al" \
507 parm [ecx] [eax] \
508 value [al] \
509 modify exact [eax];
510#endif
511
512#undef ASMAtomicBitTestAndToggle
513#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
514#pragma aux ASMAtomicBitTestAndToggle = \
515 "lock btc [ecx], eax" \
516 "setc al" \
517 parm [ecx] [eax] \
518 value [al] \
519 modify exact [eax];
520#endif
521
522#undef ASMBitTest
523#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
524#pragma aux ASMBitTest = \
525 "bt [ecx], eax" \
526 "setc al" \
527 parm [ecx] [eax] nomemory \
528 value [al] \
529 modify exact [eax] nomemory;
530#endif
531
532#if 0
533/** @todo this is way to much inline assembly, better off in an external function. */
534#undef ASMBitFirstClear
535#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
536#pragma aux ASMBitFirstClear = \
537 "mov edx, edi" /* save start of bitmap for later */ \
538 "add ecx, 31" \
539 "shr ecx, 5" /* cDWord = RT_ALIGN_32(cBits, 32) / 32; */ \
540 "mov eax, 0ffffffffh" \
541 "repe scasd" \
542 "je done" \
543 "lea edi, [edi - 4]" /* rewind edi */ \
544 "xor eax, [edi]" /* load inverted bits */ \
545 "sub edi, edx" /* calc byte offset */ \
546 "shl edi, 3" /* convert byte to bit offset */ \
547 "mov edx, eax" \
548 "bsf eax, edx" \
549 "add eax, edi" \
550 "done:" \
551 parm [edi] [ecx] \
552 value [eax] \
553 modify exact [eax ecx edx edi];
554#endif
555
556/* ASMBitNextClear: Too much work, do when needed. */
557
558/** @todo this is way to much inline assembly, better off in an external function. */
559#undef ASMBitFirstSet
560#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
561#pragma aux ASMBitFirstSet = \
562 "mov edx, edi" /* save start of bitmap for later */ \
563 "add ecx, 31" \
564 "shr ecx, 5" /* cDWord = RT_ALIGN_32(cBits, 32) / 32; */ \
565 "mov eax, 0ffffffffh" \
566 "repe scasd" \
567 "je done" \
568 "lea edi, [edi - 4]" /* rewind edi */ \
569 "mov eax, [edi]" /* reload previous dword */ \
570 "sub edi, edx" /* calc byte offset */ \
571 "shl edi, 3" /* convert byte to bit offset */ \
572 "mov edx, eax" \
573 "bsf eax, edx" \
574 "add eax, edi" \
575 "done:" \
576 parm [edi] [ecx] \
577 value [eax] \
578 modify exact [eax ecx edx edi];
579#endif
580
581/* ASMBitNextSet: Too much work, do when needed. */
582#else
583/* ASMBitFirstClear: External file. */
584/* ASMBitNextClear: External file. */
585/* ASMBitFirstSet: External file. */
586/* ASMBitNextSet: External file. */
587#endif
588
589#undef ASMBitFirstSetU32
590#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
591#pragma aux ASMBitFirstSetU32 = \
592 "bsf eax, eax" \
593 "jz not_found" \
594 "inc eax" \
595 "jmp done" \
596 "not_found:" \
597 "xor eax, eax" \
598 "done:" \
599 parm [eax] nomemory \
600 value [eax] \
601 modify exact [eax] nomemory;
602#endif
603
604#undef ASMBitFirstSetU64
605#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
606#pragma aux ASMBitFirstSetU64 = \
607 "bsf eax, eax" \
608 "jz not_found_low" \
609 "inc eax" \
610 "jmp done" \
611 \
612 "not_found_low:" \
613 "bsf eax, edx" \
614 "jz not_found_high" \
615 "add eax, 33" \
616 "jmp done" \
617 \
618 "not_found_high:" \
619 "xor eax, eax" \
620 "done:" \
621 parm [eax edx] nomemory \
622 value [eax] \
623 modify exact [eax] nomemory;
624#endif
625
626#undef ASMBitFirstSetU16
627#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
628#pragma aux ASMBitFirstSetU16 = \
629 "movzx eax, ax" \
630 "bsf eax, eax" \
631 "jz not_found" \
632 "inc eax" \
633 "jmp done" \
634 "not_found:" \
635 "xor eax, eax" \
636 "done:" \
637 parm [ax] nomemory \
638 value [eax] \
639 modify exact [eax] nomemory;
640#endif
641
642#undef ASMBitLastSetU32
643#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
644#pragma aux ASMBitLastSetU32 = \
645 "bsr eax, eax" \
646 "jz not_found" \
647 "inc eax" \
648 "jmp done" \
649 "not_found:" \
650 "xor eax, eax" \
651 "done:" \
652 parm [eax] nomemory \
653 value [eax] \
654 modify exact [eax] nomemory;
655#endif
656
657#undef ASMBitLastSetU64
658#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
659#pragma aux ASMBitLastSetU64 = \
660 "bsf eax, eax" \
661 "jz not_found_low" \
662 "inc eax" \
663 "jmp done" \
664 \
665 "not_found_low:" \
666 "bsf eax, edx" \
667 "jz not_found_high" \
668 "add eax, 33" \
669 "jmp done" \
670 \
671 "not_found_high:" \
672 "xor eax, eax" \
673 "done:" \
674 parm [eax edx] nomemory \
675 value [eax] \
676 modify exact [eax] nomemory;
677#endif
678
679#undef ASMBitLastSetU16
680#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
681#pragma aux ASMBitLastSetU16 = \
682 "movzx eax, ax" \
683 "bsr eax, eax" \
684 "jz not_found" \
685 "inc eax" \
686 "jmp done" \
687 "not_found:" \
688 "xor eax, eax" \
689 "done:" \
690 parm [ax] nomemory \
691 value [eax] \
692 modify exact [eax] nomemory;
693#endif
694
695#undef ASMByteSwapU16
696#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
697#pragma aux ASMByteSwapU16 = \
698 "ror ax, 8" \
699 parm [ax] nomemory \
700 value [ax] \
701 modify exact [ax] nomemory;
702#endif
703
704#undef ASMByteSwapU32
705#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
706#pragma aux ASMByteSwapU32 = \
707 "bswap eax" \
708 parm [eax] nomemory \
709 value [eax] \
710 modify exact [eax] nomemory;
711#endif
712
713#undef ASMRotateLeftU32
714#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
715#pragma aux ASMRotateLeftU32 = \
716 "rol eax, cl" \
717 parm [eax] [ecx] nomemory \
718 value [eax] \
719 modify exact [eax] nomemory;
720#endif
721
722#undef ASMRotateRightU32
723#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
724#pragma aux ASMRotateRightU32 = \
725 "ror eax, cl" \
726 parm [eax] [ecx] nomemory \
727 value [eax] \
728 modify exact [eax] nomemory;
729#endif
730
731#endif
732
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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