~ubuntu-branches/ubuntu/precise/openarena/precise

« back to all changes in this revision

Viewing changes to code/asm/snapvectora.s

  • Committer: Bazaar Package Importer
  • Author(s): Ansgar Burchardt
  • Date: 2008-09-05 21:14:51 UTC
  • mfrom: (1.2.1 upstream) (2.1.5 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080905211451-243bmbl6l6gdav7l
* Remove non-free code/tools/lcc (Closes: #496346)
  + Remove hunk from patch 10_fix_build_and_binary_on_alpha
  + debian/rules: Add BUILD_GAME_QVM=0 to $(MAKE) call
    (thanks to Peter De Wachter)
* Remove code/libs containing binary libraries for Mac OS X and Win32
* debian/copyright: Explain which parts of upstream's sources were removed
* debian/rules: replace ${source:Upstream-Version} by 0.7.7
  because the variable also contains the `+dfsg1' part
* Add -fsigned-char to compiler options (Closes: #487970)
  (thanks to Peter De Wachter)
* Add myself to Uploaders
* debian/control: Remove article from beginning of short description,
  don't start short description with a capital letter
* debian/openarena.6: Escape minus signs
  + fixes lintian warnings: hyphen-used-as-minus-sign

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
===========================================================================
 
3
Copyright (C) 1999-2005 Id Software, Inc.
 
4
 
 
5
This file is part of Quake III Arena source code.
 
6
 
 
7
Quake III Arena source code is free software; you can redistribute it
 
8
and/or modify it under the terms of the GNU General Public License as
 
9
published by the Free Software Foundation; either version 2 of the License,
 
10
or (at your option) any later version.
 
11
 
 
12
Quake III Arena source code is distributed in the hope that it will be
 
13
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
GNU General Public License for more details.
 
16
 
 
17
You should have received a copy of the GNU General Public License
 
18
along with Foobar; if not, write to the Free Software
 
19
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
20
===========================================================================
 
21
*/
 
22
 
 
23
//
 
24
// Sys_SnapVector NASM code (Andrew Henderson)
 
25
// See win32/win_shared.c for the Win32 equivalent
 
26
// This code is provided to ensure that the
 
27
//  rounding behavior (and, if necessary, the
 
28
//  precision) of DLL and QVM code are identical
 
29
//  e.g. for network-visible operations.
 
30
// See ftol.nasm for operations on a single float,
 
31
//  as used in compiled VM and DLL code that does
 
32
//  not use this system trap.
 
33
//
 
34
 
 
35
// 23/09/05 Ported to gas by intel2gas, best supporting actor Tim Angus
 
36
// <tim@ngus.net>
 
37
 
 
38
#include "qasm.h"
 
39
 
 
40
#if id386
 
41
.data
 
42
 
 
43
fpucw:  .long   0
 
44
cw037F: .long   0x037F
 
45
 
 
46
.text
 
47
 
 
48
// void Sys_SnapVector( float *v )
 
49
.globl C(Sys_SnapVector)
 
50
C(Sys_SnapVector):
 
51
        pushl   %eax
 
52
        pushl   %ebp
 
53
        movl    %esp,%ebp
 
54
 
 
55
        fnstcw  fpucw
 
56
        movl    12(%ebp),%eax
 
57
        fldcw   cw037F
 
58
        flds    (%eax)
 
59
        fistpl  (%eax)
 
60
        fildl   (%eax)
 
61
        fstps   (%eax)
 
62
        flds    4(%eax)
 
63
        fistpl  4(%eax)
 
64
        fildl   4(%eax)
 
65
        fstps   4(%eax)
 
66
        flds    8(%eax)
 
67
        fistpl  8(%eax)
 
68
        fildl   8(%eax)
 
69
        fstps   8(%eax)
 
70
        fldcw   fpucw
 
71
 
 
72
        popl %ebp
 
73
        popl %eax
 
74
        ret
 
75
 
 
76
// void Sys_SnapVectorCW( float *v, unsigned short int cw )
 
77
.globl C(Sys_SnapVectorCW)
 
78
C(Sys_SnapVectorCW):
 
79
        pushl   %eax
 
80
        pushl   %ebp
 
81
        movl    %esp,%ebp
 
82
 
 
83
        fnstcw  fpucw
 
84
        movl    12(%ebp),%eax
 
85
        fldcw   16(%ebp)
 
86
        flds    (%eax)
 
87
        fistpl  (%eax)
 
88
        fildl   (%eax)
 
89
        fstps   (%eax)
 
90
        flds    4(%eax)
 
91
        fistpl  4(%eax)
 
92
        fildl   4(%eax)
 
93
        fstps   4(%eax)
 
94
        flds    8(%eax)
 
95
        fistpl  8(%eax)
 
96
        fildl   8(%eax)
 
97
        fstps   8(%eax)
 
98
        fldcw   fpucw
 
99
 
 
100
        popl %ebp
 
101
        popl %eax
 
102
        ret
 
103
#endif