X86 SSE1 SIMD load intrinsics (movhps, movlps, and movups).
[oota-llvm.git] / include / llvm / Intrinsics.td
1 //===- Intrinsics.td - Defines all LLVM intrinsics ---------*- tablegen -*-===//
2 // 
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by Chris Lattner and is distributed under the
6 // University of Illinois Open Source License. See LICENSE.TXT for details.
7 // 
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines properties of all LLVM intrinsics.
11 //
12 //===----------------------------------------------------------------------===//
13
14 include "llvm/CodeGen/ValueTypes.td"
15
16 //===----------------------------------------------------------------------===//
17 //  Properties we keep track of for intrinsics.
18 //===----------------------------------------------------------------------===//
19
20 class IntrinsicProperty;
21
22 // Intr*Mem - Memory properties.  An intrinsic is allowed to have exactly one of
23 // these properties set.  They are listed from the most aggressive (best to use
24 // if correct) to the least aggressive.  If no property is set, the worst case 
25 // is assumed (IntrWriteMem).
26
27 // InstrNoMem - The intrinsic does not access memory or have any other side
28 // effects.  It may be CSE'd deleted if dead, etc.
29 def InstrNoMem : IntrinsicProperty;
30
31 // InstrReadArgMem - This intrinsic reads only from memory that one of its
32 // arguments points to, but may read an unspecified amount.
33 def InstrReadArgMem : IntrinsicProperty;
34
35 // IntrReadMem - This intrinsic reads from unspecified memory, so it cannot be
36 // moved across stores.  However, it can be reordered otherwise and can be
37 // deleted if dead.
38 def IntrReadMem : IntrinsicProperty;
39
40 // InstrWriteArgMem - This intrinsic reads and writes only from memory that one
41 // of its arguments points to, but may access an unspecified amount.  It has no
42 // other side effects.  This may only be used if the intrinsic doesn't "capture"
43 // the argument pointer (e.g. storing it someplace).
44 def InstrWriteArgMem : IntrinsicProperty;
45
46 // IntrWriteMem - This intrinsic may read or modify unspecified memory or has 
47 // other side effects.  It cannot be modified by the optimizer.  This is the
48 // default if the intrinsic has no other Intr*Mem property.
49 def IntrWriteMem : IntrinsicProperty;
50
51 //===----------------------------------------------------------------------===//
52 // Types used by intrinsics.
53 //===----------------------------------------------------------------------===//
54
55 class LLVMType<ValueType vt, string typeval> {
56   ValueType VT = vt;
57   string TypeVal = typeval;
58 }
59
60 class LLVMPackedType<ValueType VT, int numelts, LLVMType elty>
61   : LLVMType<VT, "Type::PackedTyID">{
62   int NumElts = numelts;
63   LLVMType ElTy = elty;
64
65
66 def llvm_void_ty       : LLVMType<isVoid, "Type::VoidTyID">;
67 def llvm_bool_ty       : LLVMType<i1 , "Type::BoolTyID">;
68 def llvm_sbyte_ty      : LLVMType<i8 , "Type::SByteTyID">;
69 def llvm_short_ty      : LLVMType<i16, "Type::ShortTyID">;
70 def llvm_int_ty        : LLVMType<i32, "Type::IntTyID">;
71 def llvm_long_ty       : LLVMType<i64, "Type::LongTyID">;
72 def llvm_ubyte_ty      : LLVMType<i8,  "Type::UByteTyID">;
73 def llvm_ushort_ty     : LLVMType<i16, "Type::UShortTyID">;
74 def llvm_uint_ty       : LLVMType<i32, "Type::UIntTyID">;
75 def llvm_ulong_ty      : LLVMType<i64, "Type::ULongTyID">;
76 def llvm_float_ty      : LLVMType<f32, "Type::FloatTyID">;
77 def llvm_double_ty     : LLVMType<f64, "Type::DoubleTyID">;
78 def llvm_ptr_ty        : LLVMType<OtherVT, "Type::PointerTyID">;     // sbyte*
79 def llvm_ptrptr_ty     : LLVMType<OtherVT, "Type::PointerTyID">;     // sbyte**
80 def llvm_descriptor_ty : LLVMType<OtherVT, "Type::PointerTyID">;     // global*
81
82 def llvm_v2i32_ty      : LLVMPackedType<v2i32, 2, llvm_int_ty>;    // 2 x int
83 def llvm_v4i32_ty      : LLVMPackedType<v4i32, 4, llvm_int_ty>;    // 4 x int
84 def llvm_v4f32_ty      : LLVMPackedType<v4f32, 4, llvm_float_ty>;  // 4 x float
85 def llvm_v2f64_ty      : LLVMPackedType<v2f64, 2, llvm_double_ty>; // 2 x double
86
87 //===----------------------------------------------------------------------===//
88 // Intrinsic Definitions.
89 //===----------------------------------------------------------------------===//
90
91 // Intrinsic class - This is used to define one LLVM intrinsic.  The name of the
92 // intrinsic definition should start with "int_", then match the LLVM intrinsic
93 // name with the "llvm." prefix removed, and all "."s turned into "_"s.  For
94 // example, llvm.bswap.i16 -> int_bswap_i16.
95 //
96 //  * Types is a list containing the return type and the argument types
97 //    expected for the intrinsic.
98 //  * Properties can be set to describe the behavior of the intrinsic.
99 //
100 class Intrinsic<list<LLVMType> types,
101                 list<IntrinsicProperty> properties = [],
102                 string name = ""> {
103   string LLVMName = name;
104   string TargetPrefix = "";   // Set to a prefix for target-specific intrinsics.
105   list<LLVMType> Types = types;
106   list<IntrinsicProperty> Properties = properties;
107 }
108
109 /// GCCBuiltin - If this intrinsic exactly corresponds to a GCC builtin, this
110 /// specifies the name of the builtin.  This provides automatic CBE and CFE
111 /// support.
112 class GCCBuiltin<string name> {
113   string GCCBuiltinName = name;
114 }
115
116
117 //===--------------- Variable Argument Handling Intrinsics ----------------===//
118 //  
119
120 def int_vastart : Intrinsic<[llvm_void_ty, llvm_ptrptr_ty], [], "llvm.va_start">;
121 def int_vacopy  : Intrinsic<[llvm_void_ty, llvm_ptrptr_ty, llvm_ptrptr_ty], [],
122                             "llvm.va_copy">;
123 def int_vaend   : Intrinsic<[llvm_void_ty, llvm_ptrptr_ty], [], "llvm.va_end">;
124
125 //===------------------- Garbage Collection Intrinsics --------------------===//
126 //  
127 def int_gcroot  : Intrinsic<[llvm_void_ty, llvm_ptrptr_ty, llvm_ptr_ty]>;
128 def int_gcread  : Intrinsic<[llvm_ptr_ty, llvm_ptr_ty, llvm_ptrptr_ty],
129                             [InstrReadArgMem]>;
130 def int_gcwrite : Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_ptr_ty,
131                              llvm_ptrptr_ty], [InstrWriteArgMem]>;
132
133 //===--------------------- Code Generator Intrinsics ----------------------===//
134 //  
135 def int_returnaddress : Intrinsic<[llvm_ptr_ty, llvm_uint_ty], [InstrNoMem]>;
136 def int_frameaddress  : Intrinsic<[llvm_ptr_ty, llvm_uint_ty], [InstrNoMem]>;
137 def int_stacksave     : Intrinsic<[llvm_ptr_ty], [IntrReadMem]>;
138 def int_stackrestore  : Intrinsic<[llvm_void_ty, llvm_ptr_ty]>;
139 def int_prefetch      : Intrinsic<[llvm_void_ty, llvm_ptr_ty, 
140                                    llvm_uint_ty, llvm_uint_ty]>;
141 def int_pcmarker      : Intrinsic<[llvm_void_ty, llvm_uint_ty]>;
142
143 def int_readcyclecounter : Intrinsic<[llvm_ulong_ty]>;
144
145 //===------------------- Standard C Library Intrinsics --------------------===//
146 //
147
148 let Properties = [InstrWriteArgMem] in {
149   def int_memcpy_i32  : Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_ptr_ty,
150                                    llvm_uint_ty, llvm_uint_ty]>;
151   def int_memcpy_i64  : Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_ptr_ty,
152                                    llvm_ulong_ty, llvm_uint_ty]>;
153   def int_memmove_i32 : Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_ptr_ty,
154                                    llvm_uint_ty, llvm_uint_ty]>;
155   def int_memmove_i64 : Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_ptr_ty,
156                                    llvm_ulong_ty, llvm_uint_ty]>;
157   def int_memset_i32  : Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_ubyte_ty,
158                                    llvm_uint_ty, llvm_uint_ty]>;
159   def int_memset_i64  : Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_ubyte_ty,
160                                    llvm_ulong_ty, llvm_uint_ty]>;
161 }
162
163 let Properties = [InstrNoMem] in {
164   def int_isunordered_f32 : Intrinsic<[llvm_bool_ty, 
165                                        llvm_float_ty,  llvm_float_ty]>;
166   def int_isunordered_f64 : Intrinsic<[llvm_bool_ty, 
167                                        llvm_double_ty, llvm_double_ty]>;
168   def int_sqrt_f32 : Intrinsic<[llvm_float_ty , llvm_float_ty]>;
169   def int_sqrt_f64 : Intrinsic<[llvm_double_ty, llvm_double_ty]>;
170 }
171
172 // NOTE: these are internal interfaces.
173 def int_setjmp     : Intrinsic<[llvm_int_ty , llvm_ptr_ty]>;
174 def int_longjmp    : Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_int_ty]>;
175 def int_sigsetjmp  : Intrinsic<[llvm_int_ty , llvm_ptr_ty]>;
176 def int_siglongjmp : Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_int_ty]>;
177
178 //===-------------------- Bit Manipulation Intrinsics ---------------------===//
179 //
180
181 // None of these intrinsics accesses memory at all.
182 let Properties = [InstrNoMem] in {
183   def int_bswap_i16 : Intrinsic<[llvm_ushort_ty, llvm_ushort_ty]>;
184   def int_bswap_i32 : Intrinsic<[llvm_uint_ty,   llvm_uint_ty]>;
185   def int_bswap_i64 : Intrinsic<[llvm_ulong_ty,  llvm_ulong_ty]>;
186
187   def int_ctpop_i8  : Intrinsic<[llvm_ubyte_ty,  llvm_ubyte_ty]>;
188   def int_ctpop_i16 : Intrinsic<[llvm_ushort_ty, llvm_ushort_ty]>;
189   def int_ctpop_i32 : Intrinsic<[llvm_uint_ty,   llvm_uint_ty]>;
190   def int_ctpop_i64 : Intrinsic<[llvm_ulong_ty,  llvm_ulong_ty]>;
191   
192   def int_ctlz_i8  : Intrinsic<[llvm_ubyte_ty,  llvm_ubyte_ty]>;
193   def int_ctlz_i16 : Intrinsic<[llvm_ushort_ty, llvm_ushort_ty]>;
194   def int_ctlz_i32 : Intrinsic<[llvm_uint_ty,   llvm_uint_ty]>;
195   def int_ctlz_i64 : Intrinsic<[llvm_ulong_ty,  llvm_ulong_ty]>;
196
197   def int_cttz_i8  : Intrinsic<[llvm_ubyte_ty,  llvm_ubyte_ty]>;
198   def int_cttz_i16 : Intrinsic<[llvm_ushort_ty, llvm_ushort_ty]>;
199   def int_cttz_i32 : Intrinsic<[llvm_uint_ty,   llvm_uint_ty]>;
200   def int_cttz_i64 : Intrinsic<[llvm_ulong_ty,  llvm_ulong_ty]>;
201
202
203 //===------------------------ Debugger Intrinsics -------------------------===//
204 //
205
206 def int_dbg_stoppoint    : Intrinsic<[llvm_void_ty,
207                                       llvm_uint_ty, llvm_uint_ty, 
208                                       llvm_descriptor_ty]>;
209 def int_dbg_region_start : Intrinsic<[llvm_void_ty, llvm_descriptor_ty]>;
210 def int_dbg_region_end   : Intrinsic<[llvm_void_ty, llvm_descriptor_ty]>;
211 def int_dbg_func_start   : Intrinsic<[llvm_void_ty, llvm_descriptor_ty]>;
212 def int_dbg_declare      : Intrinsic<[llvm_void_ty, llvm_ptr_ty,
213                                                     llvm_descriptor_ty]>;
214
215 //===----------------------------------------------------------------------===//
216 // Target-specific intrinsics
217 //===----------------------------------------------------------------------===//
218
219 //===----------------------------------------------------------------------===//
220 // PowerPC Intrinsics
221 //
222 let TargetPrefix = "ppc" in {  // All intrinsics start with "llvm.ppc.".
223   def int_ppc_altivec_lvx : GCCBuiltin<"__builtin_altivec_lvx">,
224               Intrinsic<[llvm_v4i32_ty, llvm_int_ty, llvm_ptr_ty],
225                         [IntrReadMem]>;
226   def int_ppc_altivec_stvx : GCCBuiltin<"__builtin_altivec_stvx">,
227               Intrinsic<[llvm_void_ty, llvm_v4i32_ty, llvm_int_ty, llvm_ptr_ty],
228                         [IntrWriteMem]>;
229                             
230   def int_ppc_altivec_vmaddfp : GCCBuiltin<"__builtin_altivec_vmaddfp">,
231               Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
232                          llvm_v4f32_ty, llvm_v4f32_ty], [InstrNoMem]>;
233   def int_ppc_altivec_vadduwm : GCCBuiltin<"__builtin_altivec_vadduwm">,
234               Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
235                         [InstrNoMem]>;
236   
237 }
238
239
240 //===----------------------------------------------------------------------===//
241 // X86 Intrinsics
242 //
243 // SSE1
244
245 // Arithmetic ops
246 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
247   def int_x86_sse_addss : GCCBuiltin<"__builtin_ia32_addss">,
248               Intrinsic<[llvm_float_ty, llvm_float_ty,
249                          llvm_float_ty], [InstrNoMem]>;
250 }
251
252 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
253   def int_x86_sse_addps : GCCBuiltin<"__builtin_ia32_addps">,
254               Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
255                          llvm_v4f32_ty], [InstrNoMem]>;
256 }
257
258 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
259   def int_x86_sse_subss : GCCBuiltin<"__builtin_ia32_subss">,
260               Intrinsic<[llvm_float_ty, llvm_float_ty,
261                          llvm_float_ty], [InstrNoMem]>;
262 }
263
264 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
265   def int_x86_sse_subps : GCCBuiltin<"__builtin_ia32_subps">,
266               Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
267                          llvm_v4f32_ty], [InstrNoMem]>;
268 }
269
270 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
271   def int_x86_sse_mulss : GCCBuiltin<"__builtin_ia32_mulss">,
272               Intrinsic<[llvm_float_ty, llvm_float_ty,
273                          llvm_float_ty], [InstrNoMem]>;
274 }
275
276 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
277   def int_x86_sse_mulps : GCCBuiltin<"__builtin_ia32_mulps">,
278               Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
279                          llvm_v4f32_ty], [InstrNoMem]>;
280 }
281
282 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
283   def int_x86_sse_divss : GCCBuiltin<"__builtin_ia32_divss">,
284               Intrinsic<[llvm_float_ty, llvm_float_ty,
285                          llvm_float_ty], [InstrNoMem]>;
286 }
287
288 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
289   def int_x86_sse_divps : GCCBuiltin<"__builtin_ia32_divps">,
290               Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
291                          llvm_v4f32_ty], [InstrNoMem]>;
292 }
293
294 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
295   def int_x86_sse_sqrtss : GCCBuiltin<"__builtin_ia32_sqrtss">,
296               Intrinsic<[llvm_float_ty, llvm_float_ty,
297                          llvm_float_ty], [InstrNoMem]>;
298 }
299
300 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
301   def int_x86_sse_sqrtps : GCCBuiltin<"__builtin_ia32_sqrtps">,
302               Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
303                          llvm_v4f32_ty], [InstrNoMem]>;
304 }
305
306 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
307   def int_x86_sse_rcpss : GCCBuiltin<"__builtin_ia32_rcpss">,
308               Intrinsic<[llvm_float_ty, llvm_float_ty,
309                          llvm_float_ty], [InstrNoMem]>;
310 }
311
312 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
313   def int_x86_sse_rcpps : GCCBuiltin<"__builtin_ia32_rcpps">,
314               Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
315                          llvm_v4f32_ty], [InstrNoMem]>;
316 }
317
318 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
319   def int_x86_sse_rsqrtss : GCCBuiltin<"__builtin_ia32_rsqrtss">,
320               Intrinsic<[llvm_float_ty, llvm_float_ty,
321                          llvm_float_ty], [InstrNoMem]>;
322 }
323
324 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
325   def int_x86_sse_rsqrtps : GCCBuiltin<"__builtin_ia32_rsqrtps">,
326               Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
327                          llvm_v4f32_ty], [InstrNoMem]>;
328 }
329
330 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
331   def int_x86_sse_minss : GCCBuiltin<"__builtin_ia32_minss">,
332               Intrinsic<[llvm_float_ty, llvm_float_ty,
333                          llvm_float_ty], [InstrNoMem]>;
334 }
335
336 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
337   def int_x86_sse_minps : GCCBuiltin<"__builtin_ia32_minps">,
338               Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
339                          llvm_v4f32_ty], [InstrNoMem]>;
340 }
341
342 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
343   def int_x86_sse_maxss : GCCBuiltin<"__builtin_ia32_maxss">,
344               Intrinsic<[llvm_float_ty, llvm_float_ty,
345                          llvm_float_ty], [InstrNoMem]>;
346 }
347
348 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
349   def int_x86_sse_maxps : GCCBuiltin<"__builtin_ia32_maxps">,
350               Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
351                          llvm_v4f32_ty], [InstrNoMem]>;
352 }
353
354 // Logical ops
355 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
356   def int_x86_sse_andps : GCCBuiltin<"__builtin_ia32_andps">,
357               Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
358                          llvm_v4f32_ty], [InstrNoMem]>;
359 }
360
361 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
362   def int_x86_sse_andnotps : GCCBuiltin<"__builtin_ia32_andnotps">,
363               Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
364                          llvm_v4f32_ty], [InstrNoMem]>;
365 }
366
367 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
368   def int_x86_sse_orps : GCCBuiltin<"__builtin_ia32_orps">,
369               Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
370                          llvm_v4f32_ty], [InstrNoMem]>;
371 }
372
373 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
374   def int_x86_sse_xorps : GCCBuiltin<"__builtin_ia32_xorps">,
375               Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
376                          llvm_v4f32_ty], [InstrNoMem]>;
377 }
378
379 // Comparison ops
380 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
381   def int_x86_sse_cmpeqss : GCCBuiltin<"__builtin_ia32_cmpeqss">,
382               Intrinsic<[llvm_float_ty, llvm_float_ty,
383                          llvm_float_ty], [InstrNoMem]>;
384 }
385
386 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
387   def int_x86_sse_cmpeqps : GCCBuiltin<"__builtin_ia32_cmpeqps">,
388               Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
389                          llvm_v4f32_ty], [InstrNoMem]>;
390 }
391
392 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
393   def int_x86_sse_cmpltss : GCCBuiltin<"__builtin_ia32_cmpltss">,
394               Intrinsic<[llvm_float_ty, llvm_float_ty,
395                          llvm_float_ty], [InstrNoMem]>;
396 }
397
398 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
399   def int_x86_sse_cmpltps : GCCBuiltin<"__builtin_ia32_cmpltps">,
400               Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
401                          llvm_v4f32_ty], [InstrNoMem]>;
402 }
403
404 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
405   def int_x86_sse_cmpless : GCCBuiltin<"__builtin_ia32_cmpless">,
406               Intrinsic<[llvm_float_ty, llvm_float_ty,
407                          llvm_float_ty], [InstrNoMem]>;
408 }
409
410 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
411   def int_x86_sse_cmpleps : GCCBuiltin<"__builtin_ia32_cmpleps">,
412               Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
413                          llvm_v4f32_ty], [InstrNoMem]>;
414 }
415
416 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
417   def int_x86_sse_cmpgtss : GCCBuiltin<"__builtin_ia32_cmpgtss">,
418               Intrinsic<[llvm_float_ty, llvm_float_ty,
419                          llvm_float_ty], [InstrNoMem]>;
420 }
421
422 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
423   def int_x86_sse_cmpgtps : GCCBuiltin<"__builtin_ia32_cmpgtps">,
424               Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
425                          llvm_v4f32_ty], [InstrNoMem]>;
426 }
427
428 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
429   def int_x86_sse_cmpgess : GCCBuiltin<"__builtin_ia32_cmpgess">,
430               Intrinsic<[llvm_float_ty, llvm_float_ty,
431                          llvm_float_ty], [InstrNoMem]>;
432 }
433
434 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
435   def int_x86_sse_cmpgeps : GCCBuiltin<"__builtin_ia32_cmpgeps">,
436               Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
437                          llvm_v4f32_ty], [InstrNoMem]>;
438 }
439
440 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
441   def int_x86_sse_cmpneqss : GCCBuiltin<"__builtin_ia32_cmpneqss">,
442               Intrinsic<[llvm_float_ty, llvm_float_ty,
443                          llvm_float_ty], [InstrNoMem]>;
444 }
445
446 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
447   def int_x86_sse_cmpneqps : GCCBuiltin<"__builtin_ia32_cmpneqps">,
448               Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
449                          llvm_v4f32_ty], [InstrNoMem]>;
450 }
451
452 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
453   def int_x86_sse_cmpnltss : GCCBuiltin<"__builtin_ia32_cmpnltss">,
454               Intrinsic<[llvm_float_ty, llvm_float_ty,
455                          llvm_float_ty], [InstrNoMem]>;
456 }
457
458 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
459   def int_x86_sse_cmpnltps : GCCBuiltin<"__builtin_ia32_cmpnltps">,
460               Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
461                          llvm_v4f32_ty], [InstrNoMem]>;
462 }
463
464 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
465   def int_x86_sse_cmpnless : GCCBuiltin<"__builtin_ia32_cmpnless">,
466               Intrinsic<[llvm_float_ty, llvm_float_ty,
467                          llvm_float_ty], [InstrNoMem]>;
468 }
469
470 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
471   def int_x86_sse_cmpnleps : GCCBuiltin<"__builtin_ia32_cmpnleps">,
472               Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
473                          llvm_v4f32_ty], [InstrNoMem]>;
474 }
475
476 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
477   def int_x86_sse_cmpngtss : GCCBuiltin<"__builtin_ia32_cmpngtss">,
478               Intrinsic<[llvm_float_ty, llvm_float_ty,
479                          llvm_float_ty], [InstrNoMem]>;
480 }
481
482 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
483   def int_x86_sse_cmpngtps : GCCBuiltin<"__builtin_ia32_cmpngtps">,
484               Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
485                          llvm_v4f32_ty], [InstrNoMem]>;
486 }
487
488 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
489   def int_x86_sse_cmpngess : GCCBuiltin<"__builtin_ia32_cmpngess">,
490               Intrinsic<[llvm_float_ty, llvm_float_ty,
491                          llvm_float_ty], [InstrNoMem]>;
492 }
493
494 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
495   def int_x86_sse_cmpngeps : GCCBuiltin<"__builtin_ia32_cmpngeps">,
496               Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
497                          llvm_v4f32_ty], [InstrNoMem]>;
498 }
499
500 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
501   def int_x86_sse_cmpordss : GCCBuiltin<"__builtin_ia32_cmpordss">,
502               Intrinsic<[llvm_float_ty, llvm_float_ty,
503                          llvm_float_ty], [InstrNoMem]>;
504 }
505
506 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
507   def int_x86_sse_cmpordps : GCCBuiltin<"__builtin_ia32_cmpordps">,
508               Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
509                          llvm_v4f32_ty], [InstrNoMem]>;
510 }
511
512 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
513   def int_x86_sse_cmpunordss : GCCBuiltin<"__builtin_ia32_cmpunordss">,
514               Intrinsic<[llvm_float_ty, llvm_float_ty,
515                          llvm_float_ty], [InstrNoMem]>;
516 }
517
518 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
519   def int_x86_sse_cmpunordps : GCCBuiltin<"__builtin_ia32_cmpunordps">,
520               Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty,
521                          llvm_v4f32_ty], [InstrNoMem]>;
522 }
523
524 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
525   def int_x86_sse_comieqss : GCCBuiltin<"__builtin_ia32_comieq">,
526               Intrinsic<[llvm_int_ty, llvm_float_ty,
527                          llvm_float_ty], [InstrNoMem]>;
528 }
529
530 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
531   def int_x86_sse_comiltss : GCCBuiltin<"__builtin_ia32_comilt">,
532               Intrinsic<[llvm_int_ty, llvm_float_ty,
533                          llvm_float_ty], [InstrNoMem]>;
534 }
535
536 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
537   def int_x86_sse_comiless : GCCBuiltin<"__Builtin_ia32_comile">,
538               Intrinsic<[llvm_int_ty, llvm_float_ty,
539                          llvm_float_ty], [InstrNoMem]>;
540 }
541
542 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
543   def int_x86_sse_comigtss : GCCBuiltin<"__builtin_ia32_comigt">,
544               Intrinsic<[llvm_int_ty, llvm_float_ty,
545                          llvm_float_ty], [InstrNoMem]>;
546 }
547
548 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
549   def int_x86_sse_comigess : GCCBuiltin<"__builtin_ia32_comige">,
550               Intrinsic<[llvm_int_ty, llvm_float_ty,
551                          llvm_float_ty], [InstrNoMem]>;
552 }
553
554 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
555   def int_x86_sse_comineqss : GCCBuiltin<"__builtin_ia32_comineq">,
556               Intrinsic<[llvm_int_ty, llvm_float_ty,
557                          llvm_float_ty], [InstrNoMem]>;
558 }
559
560 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
561   def int_x86_sse_ucomieqss : GCCBuiltin<"__builtin_ia32_ucomieq">,
562               Intrinsic<[llvm_int_ty, llvm_float_ty,
563                          llvm_float_ty], [InstrNoMem]>;
564 }
565
566 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
567   def int_x86_sse_ucomiltss : GCCBuiltin<"__builtin_ia32_ucomilt">,
568               Intrinsic<[llvm_int_ty, llvm_float_ty,
569                          llvm_float_ty], [InstrNoMem]>;
570 }
571
572 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
573   def int_x86_sse_ucomiless : GCCBuiltin<"__Builtin_ia32_ucomile">,
574               Intrinsic<[llvm_int_ty, llvm_float_ty,
575                          llvm_float_ty], [InstrNoMem]>;
576 }
577
578 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
579   def int_x86_sse_ucomigtss : GCCBuiltin<"__builtin_ia32_ucomigt">,
580               Intrinsic<[llvm_int_ty, llvm_float_ty,
581                          llvm_float_ty], [InstrNoMem]>;
582 }
583
584 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
585   def int_x86_sse_ucomigess : GCCBuiltin<"__builtin_ia32_ucomige">,
586               Intrinsic<[llvm_int_ty, llvm_float_ty,
587                          llvm_float_ty], [InstrNoMem]>;
588 }
589
590 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
591   def int_x86_sse_ucomineqss : GCCBuiltin<"__builtin_ia32_ucomineq">,
592               Intrinsic<[llvm_int_ty, llvm_float_ty,
593                          llvm_float_ty], [InstrNoMem]>;
594 }
595
596
597 // Conversion ops
598 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
599   def int_x86_sse_cvtss2si : GCCBuiltin<"__builtin_ia32_cvtss2si">,
600               Intrinsic<[llvm_int_ty, llvm_float_ty], [InstrNoMem]>;
601 }
602
603 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
604   def int_x86_sse_cvtps2pi : GCCBuiltin<"__builtin_ia32_cvtps2pi">,
605               Intrinsic<[llvm_v2i32_ty, llvm_v4i32_ty], [InstrNoMem]>;
606 }
607
608 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
609   def int_x86_sse_cvttss2si : GCCBuiltin<"__builtin_ia32_cvttss2si">,
610               Intrinsic<[llvm_int_ty, llvm_float_ty], [InstrNoMem]>;
611 }
612
613 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
614   def int_x86_sse_cvttps2pi : GCCBuiltin<"__builtin_ia32_cvttps2pi">,
615               Intrinsic<[llvm_v2i32_ty, llvm_v4i32_ty], [InstrNoMem]>;
616 }
617
618 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
619   def int_x86_sse_cvtsi2ss : GCCBuiltin<"__builtin_ia32_cvtsi2ss">,
620               Intrinsic<[llvm_float_ty, llvm_int_ty], [InstrNoMem]>;
621 }
622
623 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
624   def int_x86_sse_cvtpi2ps : GCCBuiltin<"__builtin_ia32_cvtpi2ps">,
625               Intrinsic<[llvm_v4f32_ty, llvm_v2i32_ty], [InstrNoMem]>;
626 }
627
628 // SIMD load ops
629
630 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
631   def int_x86_sse_loadhps : GCCBuiltin<"__builtin_ia32_loadhps">,
632               Intrinsic<[llvm_v4f32_ty, llvm_ptr_ty], [IntrReadMem]>;
633 }
634
635 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
636   def int_x86_sse_loadlps : GCCBuiltin<"__builtin_ia32_loadlps">,
637               Intrinsic<[llvm_v4f32_ty, llvm_ptr_ty], [IntrReadMem]>;
638 }
639
640 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
641   def int_x86_sse_loadups : GCCBuiltin<"__builtin_ia32_loadups">,
642               Intrinsic<[llvm_v4f32_ty, llvm_ptr_ty], [IntrReadMem]>;
643 }
644
645 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
646   def int_x86_sse_movmskps : GCCBuiltin<"__builtin_ia32_movmskps">,
647               Intrinsic<[llvm_int_ty, llvm_v4f32_ty], [InstrNoMem]>;
648 }
649
650 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
651   def int_x86_sse_ldmxcsr : GCCBuiltin<"__builtin_ia32_ldmxcsr">,
652               Intrinsic<[llvm_void_ty, llvm_ptr_ty], [IntrWriteMem]>;
653 }
654
655 // SSE2
656 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
657   def int_x86_sse2_movmskpd : GCCBuiltin<"__builtin_ia32_movmskpd">,
658               Intrinsic<[llvm_int_ty, llvm_v2f64_ty], [InstrNoMem]>;
659 }