llvmpipe: Fix MSVC build.
[mesa.git] / src / gallium / drivers / llvmpipe / lp_debug_intrin.h
1 /**************************************************************************
2 *
3 * Copyright 2010 VMware, Inc.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
18 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 * USE OR OTHER DEALINGS IN THE SOFTWARE.
21 *
22 * The above copyright notice and this permission notice (including the
23 * next paragraph) shall be included in all copies or substantial portions
24 * of the Software.
25 *
26 **************************************************************************/
27
28 #ifndef _LP_DEBUG_INTRIN_H_
29 #define _LP_DEBUG_INTRIN_H_
30
31 #include "pipe/p_config.h"
32
33 #if defined(PIPE_ARCH_SSE)
34
35 #include <emmintrin.h>
36
37 static INLINE void print_epi8(const char *name, __m128i r)
38 {
39 union { __m128i m; ubyte ub[16]; } u;
40 u.m = r;
41
42 debug_printf("%s: "
43 "%02x/"
44 "%02x/"
45 "%02x/"
46 "%02x/"
47 "%02x/"
48 "%02x/"
49 "%02x/"
50 "%02x/"
51 "%02x/"
52 "%02x/"
53 "%02x/"
54 "%02x/"
55 "%02x/"
56 "%02x/"
57 "%02x/"
58 "%02x\n",
59 name,
60 u.ub[0], u.ub[1], u.ub[2], u.ub[3],
61 u.ub[4], u.ub[5], u.ub[6], u.ub[7],
62 u.ub[8], u.ub[9], u.ub[10], u.ub[11],
63 u.ub[12], u.ub[13], u.ub[14], u.ub[15]);
64 }
65
66 static INLINE void print_epi16(const char *name, __m128i r)
67 {
68 union { __m128i m; ushort us[8]; } u;
69 u.m = r;
70
71 debug_printf("%s: "
72 "%04x/"
73 "%04x/"
74 "%04x/"
75 "%04x/"
76 "%04x/"
77 "%04x/"
78 "%04x/"
79 "%04x\n",
80 name,
81 u.us[0], u.us[1], u.us[2], u.us[3],
82 u.us[4], u.us[5], u.us[6], u.us[7]);
83 }
84
85 static INLINE void print_epi32(const char *name, __m128i r)
86 {
87 union { __m128i m; uint ui[4]; } u;
88 u.m = r;
89
90 debug_printf("%s: "
91 "%08x/"
92 "%08x/"
93 "%08x/"
94 "%08x\n",
95 name,
96 u.ui[0], u.ui[1], u.ui[2], u.ui[3]);
97 }
98
99 static INLINE void print_ps(const char *name, __m128 r)
100 {
101 union { __m128 m; float f[4]; } u;
102 u.m = r;
103
104 debug_printf("%s: "
105 "%f/"
106 "%f/"
107 "%f/"
108 "%f\n",
109 name,
110 u.f[0], u.f[1], u.f[2], u.f[3]);
111 }
112
113
114 #endif
115 #endif