• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 The SwiftShader Authors. All Rights Reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //    http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef sw_x86_hpp
16 #define sw_x86_hpp
17 
18 #include "Reactor.hpp"
19 
20 namespace sw
21 {
22 	namespace x86
23 	{
24 		RValue<Int> cvtss2si(RValue<Float> val);
25 		RValue<Int4> cvtps2dq(RValue<Float4> val);
26 
27 		RValue<Float> rcpss(RValue<Float> val);
28 		RValue<Float> sqrtss(RValue<Float> val);
29 		RValue<Float> rsqrtss(RValue<Float> val);
30 
31 		RValue<Float4> rcpps(RValue<Float4> val);
32 		RValue<Float4> sqrtps(RValue<Float4> val);
33 		RValue<Float4> rsqrtps(RValue<Float4> val);
34 		RValue<Float4> maxps(RValue<Float4> x, RValue<Float4> y);
35 		RValue<Float4> minps(RValue<Float4> x, RValue<Float4> y);
36 
37 		RValue<Float> roundss(RValue<Float> val, unsigned char imm);
38 		RValue<Float> floorss(RValue<Float> val);
39 		RValue<Float> ceilss(RValue<Float> val);
40 
41 		RValue<Float4> roundps(RValue<Float4> val, unsigned char imm);
42 		RValue<Float4> floorps(RValue<Float4> val);
43 		RValue<Float4> ceilps(RValue<Float4> val);
44 
45 		RValue<Int4> pabsd(RValue<Int4> x);
46 
47 		RValue<Short4> paddsw(RValue<Short4> x, RValue<Short4> y);
48 		RValue<Short4> psubsw(RValue<Short4> x, RValue<Short4> y);
49 		RValue<UShort4> paddusw(RValue<UShort4> x, RValue<UShort4> y);
50 		RValue<UShort4> psubusw(RValue<UShort4> x, RValue<UShort4> y);
51 		RValue<SByte8> paddsb(RValue<SByte8> x, RValue<SByte8> y);
52 		RValue<SByte8> psubsb(RValue<SByte8> x, RValue<SByte8> y);
53 		RValue<Byte8> paddusb(RValue<Byte8> x, RValue<Byte8> y);
54 		RValue<Byte8> psubusb(RValue<Byte8> x, RValue<Byte8> y);
55 
56 		RValue<UShort4> pavgw(RValue<UShort4> x, RValue<UShort4> y);
57 
58 		RValue<Short4> pmaxsw(RValue<Short4> x, RValue<Short4> y);
59 		RValue<Short4> pminsw(RValue<Short4> x, RValue<Short4> y);
60 
61 		RValue<Short4> pcmpgtw(RValue<Short4> x, RValue<Short4> y);
62 		RValue<Short4> pcmpeqw(RValue<Short4> x, RValue<Short4> y);
63 		RValue<Byte8> pcmpgtb(RValue<SByte8> x, RValue<SByte8> y);
64 		RValue<Byte8> pcmpeqb(RValue<Byte8> x, RValue<Byte8> y);
65 
66 		RValue<Short4> packssdw(RValue<Int2> x, RValue<Int2> y);
67 		RValue<Short8> packssdw(RValue<Int4> x, RValue<Int4> y);
68 		RValue<SByte8> packsswb(RValue<Short4> x, RValue<Short4> y);
69 		RValue<Byte8> packuswb(RValue<Short4> x, RValue<Short4> y);
70 
71 		RValue<UShort8> packusdw(RValue<Int4> x, RValue<Int4> y);
72 
73 		RValue<UShort4> psrlw(RValue<UShort4> x, unsigned char y);
74 		RValue<UShort8> psrlw(RValue<UShort8> x, unsigned char y);
75 		RValue<Short4> psraw(RValue<Short4> x, unsigned char y);
76 		RValue<Short8> psraw(RValue<Short8> x, unsigned char y);
77 		RValue<Short4> psllw(RValue<Short4> x, unsigned char y);
78 		RValue<Short8> psllw(RValue<Short8> x, unsigned char y);
79 		RValue<Int2> pslld(RValue<Int2> x, unsigned char y);
80 		RValue<Int4> pslld(RValue<Int4> x, unsigned char y);
81 		RValue<Int2> psrad(RValue<Int2> x, unsigned char y);
82 		RValue<Int4> psrad(RValue<Int4> x, unsigned char y);
83 		RValue<UInt2> psrld(RValue<UInt2> x, unsigned char y);
84 		RValue<UInt4> psrld(RValue<UInt4> x, unsigned char y);
85 
86 		RValue<Int4> pmaxsd(RValue<Int4> x, RValue<Int4> y);
87 		RValue<Int4> pminsd(RValue<Int4> x, RValue<Int4> y);
88 		RValue<UInt4> pmaxud(RValue<UInt4> x, RValue<UInt4> y);
89 		RValue<UInt4> pminud(RValue<UInt4> x, RValue<UInt4> y);
90 
91 		RValue<Short4> pmulhw(RValue<Short4> x, RValue<Short4> y);
92 		RValue<UShort4> pmulhuw(RValue<UShort4> x, RValue<UShort4> y);
93 		RValue<Int2> pmaddwd(RValue<Short4> x, RValue<Short4> y);
94 
95 		RValue<Short8> pmulhw(RValue<Short8> x, RValue<Short8> y);
96 		RValue<UShort8> pmulhuw(RValue<UShort8> x, RValue<UShort8> y);
97 		RValue<Int4> pmaddwd(RValue<Short8> x, RValue<Short8> y);
98 
99 		RValue<Int> movmskps(RValue<Float4> x);
100 		RValue<Int> pmovmskb(RValue<Byte8> x);
101 
102 		RValue<Int4> pmovzxbd(RValue<Byte16> x);
103 		RValue<Int4> pmovsxbd(RValue<SByte16> x);
104 		RValue<Int4> pmovzxwd(RValue<UShort8> x);
105 		RValue<Int4> pmovsxwd(RValue<Short8> x);
106 	}
107 }
108 
109 #endif   // sw_x86_hpp