ReactOS 0.4.15-dev-5664-g3bf4ef6
tools.cpp
Go to the documentation of this file.
1
2// Copyright (C) Alexander Telyatnikov, Ivan Keliukh, Yegor Anchishkin, SKIF Software, 1999-2013. Kiev, Ukraine
3// All rights reserved
4// This file was released under the GPLv2 on June 2015.
6/*
7Module Name:
8
9 tools.cpp
10
11Abstract:
12
13 This module contains some useful functions for data manipulation.
14
15Environment:
16
17 */
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24//----------------
25
26#include "tools.h"
27
28//----------------
29
30#ifdef _X86_
31
32__declspec (naked)
33void
36 void* a, // ECX
37 void* b // EDX
38 )
39{
40 _asm {
41 mov eax,[edx]
42 bswap eax
43 mov [ecx],eax
44 ret
45 }
46}
47
48__declspec (naked)
49void
52 void* a, // ECX
53 void* b // EDX
54 )
55{
56 _asm {
57 mov ax,[edx]
58 rol ax,8
59 mov [ecx],ax
60 ret
61 }
62}
63
64__declspec (naked)
65void
68 void* a // ECX
69 )
70{
71 _asm {
72 mov eax,[ecx]
73 bswap eax
74 mov [ecx],eax
75 ret
76 }
77}
78
79__declspec (naked)
80void
83 void* a // ECX
84 )
85{
86 _asm {
87 mov ax,[ecx]
88 rol ax,8
89 mov [ecx],ax
90 ret
91 }
92}
93
94__declspec (naked)
95void
98 void* a, // ECX
99 void* b // EDX
100 )
101{
102 _asm {
103 mov ax,[edx]
104 rol ax,8
105 mov [ecx+2],ax
106 mov [ecx],0
107 ret
108 }
109}
110
111__declspec (naked)
112void
115 void* a, // ECX
116 void* b // EDX
117 )
118{
119 _asm {
120 mov eax,[edx]
121 mov [ecx],ax
122 shr eax,16
123 mov [ecx+2],al
124 ret
125 }
126}
127
128__declspec (naked)
129void
132 void* a, // ECX
133 void* b // EDX
134 )
135{
136 _asm {
137 mov eax,[edx]
138 mov [ecx+2],al
139 bswap eax
140 shr eax,8
141 mov [ecx],ax
142 ret
143 }
144}
145
146__declspec (naked)
147void
150 void* a, // ECX
151 void* b // EDX
152 )
153{
154 _asm {
155 mov eax,[edx]
156 xchg eax,[ecx]
157 mov [edx],eax
158 ret
159 }
160}
161
162#endif _X86_
163
164#ifdef __cplusplus
165};
166#endif
ptrREVERSE_DD _REVERSE_DD
Definition: misc.h:83
ptrMOV_DD_SWP _MOV_DD_SWP
Definition: misc.h:20
void __fastcall _REVERSE_DW(void *a)
void __fastcall _MOV_DW_SWP(void *a, void *b)
void __fastcall _MOV_MSF(void *a, void *b)
ptrMOV_MSF_SWP _MOV_MSF_SWP
Definition: misc.h:151
void __fastcall _MOV_DW2DD_SWP(void *a, void *b)
void __fastcall _XCHG_DD(void *a, void *b)
__declspec(noinline) int TestFunc(int
Definition: ehthrow.cxx:232
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
#define __fastcall
Definition: sync.c:38
#define rol(value, bits)
Definition: sha1.c:24
ecx edi movl ebx edx edi decl ecx esi eax jecxz decl eax andl eax esi movl edx movl TEMP incl eax andl eax ecx incl ebx testl eax jnz xchgl ecx incl TEMP esp ecx subl ebx pushl ecx ecx edx ecx shrl ecx mm0 mm4 mm0 mm4 mm1 mm5 mm1 mm5 mm2 mm6 mm2 mm6 mm3 mm7 mm3 mm7 paddd mm0 paddd mm4 paddd mm0 paddd mm4 paddd mm0 paddd mm4 movq mm1 movq mm5 psrlq mm1 psrlq mm5 paddd mm0 paddd mm4 psrad mm0 psrad mm4 packssdw mm0 packssdw mm4 mm1 punpckldq mm0 pand mm1 pand mm0 por mm1 movq edi esi edx edi decl ecx jnz popl ecx andl ecx jecxz mm0 mm0 mm1 mm1 mm2 mm2 mm3 mm3 paddd mm0 paddd mm0 paddd mm0 movq mm1 psrlq mm1 paddd mm0 psrad mm0 packssdw mm0 movd eax movw ax
Definition: synth_sse3d.h:180
ecx edi movl ebx edx edi decl ecx esi eax jecxz decl eax andl eax esi movl eax
Definition: synth_sse3d.h:85
ecx edi movl ebx edx edi decl ecx esi eax jecxz decl eax andl eax esi movl edx
Definition: synth_sse3d.h:87
int ret