Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 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 | |
Nicolas Capens | d022e41 | 2016-09-26 13:30:14 -0400 | [diff] [blame] | 15 | #ifndef sw_x86_hpp |
| 16 | #define sw_x86_hpp |
| 17 | |
| 18 | #include "Reactor.hpp" |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 19 | |
| 20 | namespace sw |
| 21 | { |
| 22 | namespace x86 |
| 23 | { |
| 24 | RValue<Int> cvtss2si(RValue<Float> val); |
| 25 | RValue<Int2> cvtps2pi(RValue<Float4> val); |
| 26 | RValue<Int2> cvttps2pi(RValue<Float4> val); |
| 27 | RValue<Int4> cvtps2dq(RValue<Float4> val); |
| 28 | |
| 29 | RValue<Float> rcpss(RValue<Float> val); |
| 30 | RValue<Float> sqrtss(RValue<Float> val); |
| 31 | RValue<Float> rsqrtss(RValue<Float> val); |
| 32 | |
| 33 | RValue<Float4> rcpps(RValue<Float4> val); |
| 34 | RValue<Float4> sqrtps(RValue<Float4> val); |
| 35 | RValue<Float4> rsqrtps(RValue<Float4> val); |
| 36 | RValue<Float4> maxps(RValue<Float4> x, RValue<Float4> y); |
| 37 | RValue<Float4> minps(RValue<Float4> x, RValue<Float4> y); |
| 38 | |
| 39 | RValue<Float> roundss(RValue<Float> val, unsigned char imm); |
| 40 | RValue<Float> floorss(RValue<Float> val); |
| 41 | RValue<Float> ceilss(RValue<Float> val); |
| 42 | |
| 43 | RValue<Float4> roundps(RValue<Float4> val, unsigned char imm); |
| 44 | RValue<Float4> floorps(RValue<Float4> val); |
| 45 | RValue<Float4> ceilps(RValue<Float4> val); |
| 46 | |
| 47 | RValue<Float4> cmpps(RValue<Float4> x, RValue<Float4> y, unsigned char imm); |
| 48 | RValue<Float4> cmpeqps(RValue<Float4> x, RValue<Float4> y); |
| 49 | RValue<Float4> cmpltps(RValue<Float4> x, RValue<Float4> y); |
| 50 | RValue<Float4> cmpleps(RValue<Float4> x, RValue<Float4> y); |
| 51 | RValue<Float4> cmpunordps(RValue<Float4> x, RValue<Float4> y); |
| 52 | RValue<Float4> cmpneqps(RValue<Float4> x, RValue<Float4> y); |
| 53 | RValue<Float4> cmpnltps(RValue<Float4> x, RValue<Float4> y); |
| 54 | RValue<Float4> cmpnleps(RValue<Float4> x, RValue<Float4> y); |
| 55 | RValue<Float4> cmpordps(RValue<Float4> x, RValue<Float4> y); |
| 56 | |
| 57 | RValue<Float> cmpss(RValue<Float> x, RValue<Float> y, unsigned char imm); |
| 58 | RValue<Float> cmpeqss(RValue<Float> x, RValue<Float> y); |
| 59 | RValue<Float> cmpltss(RValue<Float> x, RValue<Float> y); |
| 60 | RValue<Float> cmpless(RValue<Float> x, RValue<Float> y); |
| 61 | RValue<Float> cmpunordss(RValue<Float> x, RValue<Float> y); |
| 62 | RValue<Float> cmpneqss(RValue<Float> x, RValue<Float> y); |
| 63 | RValue<Float> cmpnltss(RValue<Float> x, RValue<Float> y); |
| 64 | RValue<Float> cmpnless(RValue<Float> x, RValue<Float> y); |
| 65 | RValue<Float> cmpordss(RValue<Float> x, RValue<Float> y); |
| 66 | |
| 67 | RValue<Int4> pabsd(RValue<Int4> x); |
| 68 | |
| 69 | RValue<Short4> paddsw(RValue<Short4> x, RValue<Short4> y); |
| 70 | RValue<Short4> psubsw(RValue<Short4> x, RValue<Short4> y); |
| 71 | RValue<UShort4> paddusw(RValue<UShort4> x, RValue<UShort4> y); |
| 72 | RValue<UShort4> psubusw(RValue<UShort4> x, RValue<UShort4> y); |
| 73 | RValue<SByte8> paddsb(RValue<SByte8> x, RValue<SByte8> y); |
| 74 | RValue<SByte8> psubsb(RValue<SByte8> x, RValue<SByte8> y); |
| 75 | RValue<Byte8> paddusb(RValue<Byte8> x, RValue<Byte8> y); |
| 76 | RValue<Byte8> psubusb(RValue<Byte8> x, RValue<Byte8> y); |
| 77 | |
| 78 | RValue<Short4> paddw(RValue<Short4> x, RValue<Short4> y); |
| 79 | RValue<Short4> psubw(RValue<Short4> x, RValue<Short4> y); |
| 80 | RValue<Short4> pmullw(RValue<Short4> x, RValue<Short4> y); |
| 81 | RValue<Short4> pand(RValue<Short4> x, RValue<Short4> y); |
| 82 | RValue<Short4> por(RValue<Short4> x, RValue<Short4> y); |
| 83 | RValue<Short4> pxor(RValue<Short4> x, RValue<Short4> y); |
| 84 | RValue<Short4> pshufw(RValue<Short4> x, unsigned char y); |
| 85 | RValue<Int2> punpcklwd(RValue<Short4> x, RValue<Short4> y); |
| 86 | RValue<Int2> punpckhwd(RValue<Short4> x, RValue<Short4> y); |
| 87 | RValue<Short4> pinsrw(RValue<Short4> x, RValue<Int> y, unsigned int i); |
| 88 | RValue<Int> pextrw(RValue<Short4> x, unsigned int i); |
| 89 | RValue<Long1> punpckldq(RValue<Int2> x, RValue<Int2> y); |
| 90 | RValue<Long1> punpckhdq(RValue<Int2> x, RValue<Int2> y); |
| 91 | RValue<Short4> punpcklbw(RValue<Byte8> x, RValue<Byte8> y); |
| 92 | RValue<Short4> punpckhbw(RValue<Byte8> x, RValue<Byte8> y); |
| 93 | RValue<Byte8> paddb(RValue<Byte8> x, RValue<Byte8> y); |
| 94 | RValue<Byte8> psubb(RValue<Byte8> x, RValue<Byte8> y); |
| 95 | RValue<Int2> paddd(RValue<Int2> x, RValue<Int2> y); |
| 96 | RValue<Int2> psubd(RValue<Int2> x, RValue<Int2> y); |
| 97 | |
| 98 | RValue<UShort4> pavgw(RValue<UShort4> x, RValue<UShort4> y); |
| 99 | |
| 100 | RValue<Short4> pmaxsw(RValue<Short4> x, RValue<Short4> y); |
| 101 | RValue<Short4> pminsw(RValue<Short4> x, RValue<Short4> y); |
| 102 | |
| 103 | RValue<Short4> pcmpgtw(RValue<Short4> x, RValue<Short4> y); |
| 104 | RValue<Short4> pcmpeqw(RValue<Short4> x, RValue<Short4> y); |
| 105 | RValue<Byte8> pcmpgtb(RValue<SByte8> x, RValue<SByte8> y); |
| 106 | RValue<Byte8> pcmpeqb(RValue<Byte8> x, RValue<Byte8> y); |
| 107 | |
| 108 | RValue<Short4> packssdw(RValue<Int2> x, RValue<Int2> y); |
| 109 | RValue<Short8> packssdw(RValue<Int4> x, RValue<Int4> y); |
| 110 | RValue<SByte8> packsswb(RValue<Short4> x, RValue<Short4> y); |
| 111 | RValue<Byte8> packuswb(RValue<UShort4> x, RValue<UShort4> y); |
| 112 | |
| 113 | RValue<UShort8> packusdw(RValue<UInt4> x, RValue<UInt4> y); |
| 114 | |
| 115 | RValue<UShort4> psrlw(RValue<UShort4> x, unsigned char y); |
| 116 | RValue<UShort8> psrlw(RValue<UShort8> x, unsigned char y); |
| 117 | RValue<Short4> psraw(RValue<Short4> x, unsigned char y); |
| 118 | RValue<Short8> psraw(RValue<Short8> x, unsigned char y); |
| 119 | RValue<Short4> psllw(RValue<Short4> x, unsigned char y); |
| 120 | RValue<Short8> psllw(RValue<Short8> x, unsigned char y); |
| 121 | RValue<Int2> pslld(RValue<Int2> x, unsigned char y); |
| 122 | RValue<Int4> pslld(RValue<Int4> x, unsigned char y); |
| 123 | RValue<Int2> psrad(RValue<Int2> x, unsigned char y); |
| 124 | RValue<Int4> psrad(RValue<Int4> x, unsigned char y); |
| 125 | RValue<UInt2> psrld(RValue<UInt2> x, unsigned char y); |
| 126 | RValue<UInt4> psrld(RValue<UInt4> x, unsigned char y); |
| 127 | |
| 128 | RValue<UShort4> psrlw(RValue<UShort4> x, RValue<Long1> y); |
| 129 | RValue<Short4> psraw(RValue<Short4> x, RValue<Long1> y); |
| 130 | RValue<Short4> psllw(RValue<Short4> x, RValue<Long1> y); |
| 131 | RValue<Int2> pslld(RValue<Int2> x, RValue<Long1> y); |
| 132 | RValue<UInt2> psrld(RValue<UInt2> x, RValue<Long1> y); |
| 133 | RValue<Int2> psrad(RValue<Int2> x, RValue<Long1> y); |
| 134 | |
| 135 | RValue<Int4> pmaxsd(RValue<Int4> x, RValue<Int4> y); |
| 136 | RValue<Int4> pminsd(RValue<Int4> x, RValue<Int4> y); |
| 137 | RValue<UInt4> pmaxud(RValue<UInt4> x, RValue<UInt4> y); |
| 138 | RValue<UInt4> pminud(RValue<UInt4> x, RValue<UInt4> y); |
| 139 | |
| 140 | RValue<Short4> pmulhw(RValue<Short4> x, RValue<Short4> y); |
| 141 | RValue<UShort4> pmulhuw(RValue<UShort4> x, RValue<UShort4> y); |
| 142 | RValue<Int2> pmaddwd(RValue<Short4> x, RValue<Short4> y); |
| 143 | |
| 144 | RValue<Short8> pmulhw(RValue<Short8> x, RValue<Short8> y); |
| 145 | RValue<UShort8> pmulhuw(RValue<UShort8> x, RValue<UShort8> y); |
| 146 | RValue<Int4> pmaddwd(RValue<Short8> x, RValue<Short8> y); |
| 147 | |
| 148 | RValue<Int> movmskps(RValue<Float4> x); |
| 149 | RValue<Int> pmovmskb(RValue<Byte8> x); |
| 150 | |
| 151 | RValue<Int4> pmovzxbd(RValue<Int4> x); |
| 152 | RValue<Int4> pmovsxbd(RValue<Int4> x); |
| 153 | RValue<Int4> pmovzxwd(RValue<Int4> x); |
| 154 | RValue<Int4> pmovsxwd(RValue<Int4> x); |
| 155 | |
| 156 | void emms(); |
| 157 | } |
| 158 | } |
Nicolas Capens | d022e41 | 2016-09-26 13:30:14 -0400 | [diff] [blame] | 159 | |
| 160 | #endif // sw_x86_hpp |