LALPulsar 7.1.1.1-eeff03c
hough_x87.i
Go to the documentation of this file.
1/*
2 * Copyright (C) 2008 Bernd Machenschalk
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with with program; see the file COPYING. If not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
17 * MA 02111-1307 USA
18 *
19 */
20
21
22#ifndef _OPT_HOUGH_I686_X87_H
23#define _OPT_HOUGH_I686_X87_H
24
25
26#ifdef __APPLE__
27#define AD_FLOAT ".single "
28#define AD_ASCII ".ascii "
29#define AD_ALIGN16 ".align 4"
30#define AD_ALIGN32 ".align 5"
31#define AD_ALIGN64 ".align 6"
32#else /* x86 gas */
33#define AD_FLOAT ".float "
34#define AD_ASCII ".string "
35#define AD_ALIGN16 ".align 16"
36#define AD_ALIGN32 ".align 32"
37#define AD_ALIGN64 ".align 64"
38#endif
39
40
41#define ADDPHMD2HD_WLR_LOOP(_XPIXEL,_YLOWER,_YUPPER,_XSIDEP1,_MAP,_WEIGHT)\
42__asm __volatile ( \
43 "push %%ebx \n\t" \
44 "mov %[xPixel], %%eax \n\t" \
45 "mov %[yLower], %%ebx \n\t" \
46 "lea (%%eax,%%ebx,0x2), %%esi \n\t" \
47 "mov %[xSideP1], %%edx \n\t" \
48 "mov %[yUpper] , %%edi \n\t" \
49 "lea -0x2(%%eax,%%edi,0x2),%%eax \n\t" \
50 "mov %[map] , %%edi \n\t" \
51 "mov %%ebx,%%ecx \n\t" \
52 "imul %%edx, %%ecx \n\t" \
53 "lea (%%edi, %%ecx, 0x8), %%edi \n\t" \
54 "fldl %[w] \n\t" \
55 "cmp %%eax,%%esi \n\t" \
56 "jmp 2f \n\t" \
57 AD_ALIGN32 "\n" \
58 "1: \n\t" \
59 "movzwl (%%esi),%%ebx \n\t" \
60 "movzwl 2(%%esi),%%ecx \n\t" \
61 \
62 "lea (%%edi, %%ebx, 0x8) , %%ebx \n\t" \
63 "fldl (%%ebx) \n\t" \
64 "lea (%%edi,%%edx,0x8) , %%edi \n\t" \
65 "lea (%%edi,%%ecx,0x8) , %%ecx \n\t" \
66 "fldl (%%ecx) \n\t" \
67 \
68 "fxch %%st(1) \n\t" \
69 "fadd %%st(2),%%st \n\t" \
70 "fstpl (%%ebx) \n\t" \
71 "fadd %%st(1),%%st \n\t" \
72 "fstpl (%%ecx) \n\t" \
73 "lea (%%edi,%%edx,0x8), %%edi \n\t" \
74 \
75 "lea 4(%%esi) , %%esi \n\t" \
76 "cmp %%eax,%%esi \n" \
77 \
78 "2: \n\t" \
79 "jbe 1b \n\t" \
80 "add $0x2,%%eax \n\t" \
81 "cmp %%eax,%%esi \n\t" \
82 "jne 3f \n\t" \
83 \
84 "movzwl (%%esi) , %%ebx \n\t" \
85 "lea (%%edi, %%ebx, 0x8) , %%ebx \n\t" \
86 "fldl (%%ebx) \n\t" \
87 "fadd %%st(1),%%st \n\t" \
88 "fstpl (%%ebx) \n\t" \
89 \
90 "3: \n\t" \
91 "fstp %%st \n\t" \
92 "pop %%ebx \n\t" \
93 \
94 : \
95 : \
96 [xPixel] "m" (_XPIXEL) , \
97 [yLower] "m" (_YLOWER) , \
98 [yUpper] "m" (_YUPPER), \
99 [xSideP1] "m" (_XSIDEP1) , \
100 [map] "m" (_MAP) , \
101 [w] "m" (_WEIGHT) \
102 : \
103 "memory","eax", "ecx", "edx", "esi", "edi", "cc", \
104 "st","st(1)", "st(2)", "st(3)", "st(4)", "st(5)", "st(6)", "st(7)" \
105 )
106
107#endif