~ubuntu-branches/ubuntu/maverick/blender/maverick

« back to all changes in this revision

Viewing changes to extern/fftw/genfft-k7/vSimdIndexing.ml

  • Committer: Bazaar Package Importer
  • Author(s): Khashayar Naderehvandi, Khashayar Naderehvandi, Alessio Treglia
  • Date: 2009-01-22 16:53:59 UTC
  • mfrom: (14.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090122165359-v0996tn7fbit64ni
Tags: 2.48a+dfsg-1ubuntu1
[ Khashayar Naderehvandi ]
* Merge from debian experimental (LP: #320045), Ubuntu remaining changes:
  - Add patch correcting header file locations.
  - Add libvorbis-dev and libgsm1-dev to Build-Depends.
  - Use avcodec_decode_audio2() in source/blender/src/hddaudio.c

[ Alessio Treglia ]
* Add missing previous changelog entries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(*
 
2
 * Copyright (c) 2000-2001 Stefan Kral
 
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 this program; if not, write to the Free Software
 
16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
17
 *
 
18
 *)
 
19
 
 
20
(* This module contains code for hashing vsimdinstrs.  This feature is
 
21
 * used extensively in the code optimizer (VK7Optimization) to speedup
 
22
 * the code-optimization process.                                       
 
23
 *)
 
24
 
 
25
open VSimdBasics
 
26
 
 
27
(* for hashing purposes *)
 
28
type vsimdinstrcategory = 
 
29
  | VSIC_Load
 
30
  | VSIC_Store
 
31
  | VSIC_UnaryMulConst
 
32
  | VSIC_UnaryCopy
 
33
  | VSIC_UnarySwap
 
34
  | VSIC_UnaryChsLo
 
35
  | VSIC_UnaryChsHi
 
36
  | VSIC_UnaryChsLoHi
 
37
  | VSIC_BinAdd
 
38
  | VSIC_BinSub
 
39
  | VSIC_BinMul
 
40
  | VSIC_BinPPAcc
 
41
  | VSIC_BinNNAcc
 
42
  | VSIC_BinNPAcc
 
43
  | VSIC_BinUnpckLo
 
44
  | VSIC_BinUnpckHi
 
45
 
 
46
(* vsimdinstr category map *)
 
47
module VSICMap = Map.Make(struct 
 
48
                            type t = vsimdinstrcategory
 
49
                            let compare = compare
 
50
                          end)
 
51
 
 
52
let vsicmap_findE k m = try VSICMap.find k m with Not_found -> []
 
53
let vsicmap_addE k v m = VSICMap.add k (v::(vsicmap_findE k m)) m
 
54
 
 
55
(****************************************************************************)
 
56
 
 
57
let vsimdunaryopcategories_chs = 
 
58
  [
 
59
   VSIC_UnaryChsLo;
 
60
   VSIC_UnaryChsHi;
 
61
   VSIC_UnaryChsLoHi;
 
62
  ]
 
63
 
 
64
let vsimdunaryopcategories_nocopy = 
 
65
  VSIC_UnarySwap::VSIC_UnaryMulConst::vsimdunaryopcategories_chs
 
66
 
 
67
let vsimdunaryopcategories_all = 
 
68
  VSIC_UnaryCopy::vsimdunaryopcategories_nocopy
 
69
 
 
70
let vsimdbinopcategories_par = [VSIC_BinAdd; VSIC_BinSub; VSIC_BinMul]
 
71
 
 
72
let vsimdbinopcategories_all =
 
73
  vsimdbinopcategories_par @
 
74
  [
 
75
   VSIC_BinPPAcc;
 
76
   VSIC_BinNNAcc;
 
77
   VSIC_BinNPAcc;
 
78
   VSIC_BinUnpckLo;
 
79
   VSIC_BinUnpckHi;
 
80
  ]
 
81
 
 
82
let vsimdallcategories = 
 
83
  [VSIC_Load; VSIC_Store] @ 
 
84
  vsimdunaryopcategories_all @ 
 
85
  vsimdbinopcategories_all
 
86
 
 
87
(****************************************************************************)
 
88
 
 
89
let vsimdunaryopToCategory = function
 
90
  | V_Id         -> VSIC_UnaryCopy
 
91
  | V_Swap       -> VSIC_UnarySwap
 
92
  | V_Chs V_Lo   -> VSIC_UnaryChsLo
 
93
  | V_Chs V_Hi   -> VSIC_UnaryChsHi
 
94
  | V_Chs V_LoHi -> VSIC_UnaryChsLoHi
 
95
  | V_MulConst _ -> VSIC_UnaryMulConst
 
96
 
 
97
let vsimdbinopToCategory = function
 
98
  | V_PPAcc   -> VSIC_BinPPAcc
 
99
  | V_NNAcc   -> VSIC_BinNNAcc
 
100
  | V_NPAcc   -> VSIC_BinNPAcc
 
101
  | V_UnpckLo -> VSIC_BinUnpckLo
 
102
  | V_UnpckHi -> VSIC_BinUnpckHi
 
103
  | V_Sub     -> VSIC_BinSub
 
104
  | V_SubR    -> VSIC_BinSub
 
105
  | V_Add     -> VSIC_BinAdd
 
106
  | V_Mul     -> VSIC_BinMul
 
107
 
 
108
let vsimdinstrToCategory = function
 
109
  | V_SimdLoadD _         -> VSIC_Load
 
110
  | V_SimdLoadQ _         -> VSIC_Load
 
111
  | V_SimdStoreD _        -> VSIC_Store
 
112
  | V_SimdStoreQ _        -> VSIC_Store
 
113
  | V_SimdUnaryOp(op,_,_) -> vsimdunaryopToCategory op
 
114
  | V_SimdBinOp(op,_,_,_) -> vsimdbinopToCategory op
 
115
 
 
116
let vsimdinstrToCategories i = [vsimdinstrToCategory i]
 
117
 
 
118
 
 
119