1;******************************************************************************
2;* add_bitmaps.asm: SSE2 and x86 add_bitmaps
3;******************************************************************************
4;* Copyright (C) 2013 rcombs <rcombs@rcombs.me>
5;*
6;* This file is part of libass.
7;*
8;* Permission to use, copy, modify, and distribute this software for any
9;* purpose with or without fee is hereby granted, provided that the above
10;* copyright notice and this permission notice appear in all copies.
11;*
12;* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13;* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14;* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15;* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16;* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17;* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18;* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19;******************************************************************************
20
21%include "x86/x86inc.asm"
22
23SECTION .text
24
25;------------------------------------------------------------------------------
26; void get_cpuid( uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx);
27;------------------------------------------------------------------------------
28
29INIT_XMM
30cglobal get_cpuid, 4, 5, 0
31    push rbx
32    push r3
33    push r2
34    push r1
35    push r0
36    mov eax, [r0]
37    xor ecx, ecx
38    cpuid
39    pop r4
40    mov [r4], eax
41    pop r4
42    mov [r4], ebx
43    pop r4
44    mov [r4], ecx
45    pop r4
46    mov [r4], edx
47    pop rbx
48    RET
49
50;-----------------------------------------------------------------------------
51; void get_xgetbv( uint32_t op, uint32_t *eax, uint32_t *edx )
52;-----------------------------------------------------------------------------
53
54INIT_XMM
55cglobal get_xgetbv, 3, 7, 0
56    push  r2
57    push  r1
58    mov  ecx, r0d
59    xgetbv
60    pop   r4
61    mov [r4], eax
62    pop   r4
63    mov [r4], edx
64    RET
65