SPV testing: Add missing test case.
authorJohn Kessenich <cepheus@frii.com>
Mon, 16 Nov 2015 16:31:26 +0000 (09:31 -0700)
committerJohn Kessenich <cepheus@frii.com>
Mon, 16 Nov 2015 16:31:26 +0000 (09:31 -0700)
Test/baseResults/spv.intOps.vert.out [new file with mode: 0644]
Test/spv.intOps.vert [new file with mode: 0644]
glslang/Include/revision.h

diff --git a/Test/baseResults/spv.intOps.vert.out b/Test/baseResults/spv.intOps.vert.out
new file mode 100644 (file)
index 0000000..7a57ac4
--- /dev/null
@@ -0,0 +1,359 @@
+spv.intOps.vert\r
+Warning, version 310 is not yet complete; most version-specific features are present, but some are missing.\r
+\r
+\r
+Linked vertex stage:\r
+\r
+\r
+// Module Version 10000\r
+// Generated by (magic number): 80001\r
+// Id's are bound by 270\r
+\r
+                              Capability Shader\r
+               1:             ExtInstImport  "GLSL.std.450"\r
+                              MemoryModel Logical GLSL450\r
+                              EntryPoint Vertex 4  "main" 47 26 173 67 121 142 100 247 156 146 182 83 15 9 21 268 269\r
+                              Source ESSL 310\r
+                              Name 4  "main"\r
+                              Name 9  "iout"\r
+                              Name 15  "uout"\r
+                              Name 21  "fout"\r
+                              Name 26  "u2"\r
+                              Name 30  "u2out"\r
+                              Name 31  "ResType"\r
+                              Name 47  "u1"\r
+                              Name 51  "u1out"\r
+                              Name 52  "ResType"\r
+                              Name 67  "u4"\r
+                              Name 71  "u4outHi"\r
+                              Name 72  "u4outLow"\r
+                              Name 73  "ResType"\r
+                              Name 83  "i4"\r
+                              Name 87  "i4outHi"\r
+                              Name 88  "i4outLow"\r
+                              Name 89  "ResType"\r
+                              Name 100  "v3"\r
+                              Name 104  "i3out"\r
+                              Name 105  "ResType"\r
+                              Name 121  "v1"\r
+                              Name 124  "i1out"\r
+                              Name 125  "ResType"\r
+                              Name 142  "v2"\r
+                              Name 146  "i2"\r
+                              Name 156  "i1"\r
+                              Name 173  "u3"\r
+                              Name 182  "i3"\r
+                              Name 247  "v4"\r
+                              Name 268  "gl_VertexID"\r
+                              Name 269  "gl_InstanceID"\r
+                              Decorate 268(gl_VertexID) BuiltIn VertexId\r
+                              Decorate 269(gl_InstanceID) BuiltIn InstanceId\r
+               2:             TypeVoid\r
+               3:             TypeFunction 2\r
+               6:             TypeInt 32 1\r
+               7:             TypeVector 6(int) 4\r
+               8:             TypePointer Output 7(ivec4)\r
+         9(iout):      8(ptr) Variable Output\r
+              10:      6(int) Constant 0\r
+              11:    7(ivec4) ConstantComposite 10 10 10 10\r
+              12:             TypeInt 32 0\r
+              13:             TypeVector 12(int) 4\r
+              14:             TypePointer Output 13(ivec4)\r
+        15(uout):     14(ptr) Variable Output\r
+              16:     12(int) Constant 0\r
+              17:   13(ivec4) ConstantComposite 16 16 16 16\r
+              18:             TypeFloat 32\r
+              19:             TypeVector 18(float) 4\r
+              20:             TypePointer Output 19(fvec4)\r
+        21(fout):     20(ptr) Variable Output\r
+              22:   18(float) Constant 0\r
+              23:   19(fvec4) ConstantComposite 22 22 22 22\r
+              24:             TypeVector 12(int) 2\r
+              25:             TypePointer Input 24(ivec2)\r
+          26(u2):     25(ptr) Variable Input\r
+              29:             TypePointer Function 24(ivec2)\r
+     31(ResType):             TypeStruct 24(ivec2) 24(ivec2)\r
+              46:             TypePointer Input 12(int)\r
+          47(u1):     46(ptr) Variable Input\r
+              50:             TypePointer Function 12(int)\r
+     52(ResType):             TypeStruct 12(int) 12(int)\r
+              56:             TypePointer Output 12(int)\r
+              66:             TypePointer Input 13(ivec4)\r
+          67(u4):     66(ptr) Variable Input\r
+              70:             TypePointer Function 13(ivec4)\r
+     73(ResType):             TypeStruct 13(ivec4) 13(ivec4)\r
+              82:             TypePointer Input 7(ivec4)\r
+          83(i4):     82(ptr) Variable Input\r
+              86:             TypePointer Function 7(ivec4)\r
+     89(ResType):             TypeStruct 7(ivec4) 7(ivec4)\r
+              98:             TypeVector 18(float) 3\r
+              99:             TypePointer Input 98(fvec3)\r
+         100(v3):     99(ptr) Variable Input\r
+             102:             TypeVector 6(int) 3\r
+             103:             TypePointer Function 102(ivec3)\r
+    105(ResType):             TypeStruct 98(fvec3) 102(ivec3)\r
+             120:             TypePointer Input 18(float)\r
+         121(v1):    120(ptr) Variable Input\r
+             123:             TypePointer Function 6(int)\r
+    125(ResType):             TypeStruct 18(float) 6(int)\r
+             129:             TypePointer Output 18(float)\r
+             135:             TypePointer Output 6(int)\r
+             140:             TypeVector 18(float) 2\r
+             141:             TypePointer Input 140(fvec2)\r
+         142(v2):    141(ptr) Variable Input\r
+             144:             TypeVector 6(int) 2\r
+             145:             TypePointer Input 144(ivec2)\r
+         146(i2):    145(ptr) Variable Input\r
+             155:             TypePointer Input 6(int)\r
+         156(i1):    155(ptr) Variable Input\r
+             164:      6(int) Constant 4\r
+             165:      6(int) Constant 5\r
+             171:             TypeVector 12(int) 3\r
+             172:             TypePointer Input 171(ivec3)\r
+         173(u3):    172(ptr) Variable Input\r
+             181:             TypePointer Input 102(ivec3)\r
+         182(i3):    181(ptr) Variable Input\r
+             246:             TypePointer Input 19(fvec4)\r
+         247(v4):    246(ptr) Variable Input\r
+268(gl_VertexID):    155(ptr) Variable Input\r
+269(gl_InstanceID):    155(ptr) Variable Input\r
+         4(main):           2 Function None 3\r
+               5:             Label\r
+       30(u2out):     29(ptr) Variable Function\r
+       51(u1out):     50(ptr) Variable Function\r
+     71(u4outHi):     70(ptr) Variable Function\r
+    72(u4outLow):     70(ptr) Variable Function\r
+     87(i4outHi):     86(ptr) Variable Function\r
+    88(i4outLow):     86(ptr) Variable Function\r
+      104(i3out):    103(ptr) Variable Function\r
+      124(i1out):    123(ptr) Variable Function\r
+                              Store 9(iout) 11\r
+                              Store 15(uout) 17\r
+                              Store 21(fout) 23\r
+              27:   24(ivec2) Load 26(u2)\r
+              28:   24(ivec2) Load 26(u2)\r
+              32: 31(ResType) IAddCarry 27 28\r
+              33:   24(ivec2) CompositeExtract 32 1\r
+                              Store 30(u2out) 33\r
+              34:   24(ivec2) CompositeExtract 32 0\r
+              35:   13(ivec4) Load 15(uout)\r
+              36:   24(ivec2) VectorShuffle 35 35 0 1\r
+              37:   24(ivec2) IAdd 36 34\r
+              38:   13(ivec4) Load 15(uout)\r
+              39:   13(ivec4) VectorShuffle 38 37 4 5 2 3\r
+                              Store 15(uout) 39\r
+              40:   24(ivec2) Load 30(u2out)\r
+              41:   13(ivec4) Load 15(uout)\r
+              42:   24(ivec2) VectorShuffle 41 41 0 1\r
+              43:   24(ivec2) IAdd 42 40\r
+              44:   13(ivec4) Load 15(uout)\r
+              45:   13(ivec4) VectorShuffle 44 43 4 5 2 3\r
+                              Store 15(uout) 45\r
+              48:     12(int) Load 47(u1)\r
+              49:     12(int) Load 47(u1)\r
+              53: 52(ResType) ISubBorrow 48 49\r
+              54:     12(int) CompositeExtract 53 1\r
+                              Store 51(u1out) 54\r
+              55:     12(int) CompositeExtract 53 0\r
+              57:     56(ptr) AccessChain 15(uout) 16\r
+              58:     12(int) Load 57\r
+              59:     12(int) IAdd 58 55\r
+              60:     56(ptr) AccessChain 15(uout) 16\r
+                              Store 60 59\r
+              61:     12(int) Load 51(u1out)\r
+              62:     56(ptr) AccessChain 15(uout) 16\r
+              63:     12(int) Load 62\r
+              64:     12(int) IAdd 63 61\r
+              65:     56(ptr) AccessChain 15(uout) 16\r
+                              Store 65 64\r
+              68:   13(ivec4) Load 67(u4)\r
+              69:   13(ivec4) Load 67(u4)\r
+              74: 73(ResType) UMulExtended 68 69\r
+              75:   13(ivec4) CompositeExtract 74 0\r
+                              Store 72(u4outLow) 75\r
+              76:   13(ivec4) CompositeExtract 74 1\r
+                              Store 71(u4outHi) 76\r
+              77:   13(ivec4) Load 71(u4outHi)\r
+              78:   13(ivec4) Load 72(u4outLow)\r
+              79:   13(ivec4) IAdd 77 78\r
+              80:   13(ivec4) Load 15(uout)\r
+              81:   13(ivec4) IAdd 80 79\r
+                              Store 15(uout) 81\r
+              84:    7(ivec4) Load 83(i4)\r
+              85:    7(ivec4) Load 83(i4)\r
+              90: 89(ResType) SMulExtended 84 85\r
+              91:    7(ivec4) CompositeExtract 90 0\r
+                              Store 88(i4outLow) 91\r
+              92:    7(ivec4) CompositeExtract 90 1\r
+                              Store 87(i4outHi) 92\r
+              93:    7(ivec4) Load 88(i4outLow)\r
+              94:    7(ivec4) Load 87(i4outHi)\r
+              95:    7(ivec4) IAdd 93 94\r
+              96:    7(ivec4) Load 9(iout)\r
+              97:    7(ivec4) IAdd 96 95\r
+                              Store 9(iout) 97\r
+             101:   98(fvec3) Load 100(v3)\r
+             106:105(ResType) ExtInst 1(GLSL.std.450) 52(FrexpStruct) 101 104(i3out)\r
+             107:  102(ivec3) CompositeExtract 106 1\r
+                              Store 104(i3out) 107\r
+             108:   98(fvec3) CompositeExtract 106 0\r
+             109:   19(fvec4) Load 21(fout)\r
+             110:   98(fvec3) VectorShuffle 109 109 0 1 2\r
+             111:   98(fvec3) FAdd 110 108\r
+             112:   19(fvec4) Load 21(fout)\r
+             113:   19(fvec4) VectorShuffle 112 111 4 5 6 3\r
+                              Store 21(fout) 113\r
+             114:  102(ivec3) Load 104(i3out)\r
+             115:    7(ivec4) Load 9(iout)\r
+             116:  102(ivec3) VectorShuffle 115 115 0 1 2\r
+             117:  102(ivec3) IAdd 116 114\r
+             118:    7(ivec4) Load 9(iout)\r
+             119:    7(ivec4) VectorShuffle 118 117 4 5 6 3\r
+                              Store 9(iout) 119\r
+             122:   18(float) Load 121(v1)\r
+             126:125(ResType) ExtInst 1(GLSL.std.450) 52(FrexpStruct) 122 124(i1out)\r
+             127:      6(int) CompositeExtract 126 1\r
+                              Store 124(i1out) 127\r
+             128:   18(float) CompositeExtract 126 0\r
+             130:    129(ptr) AccessChain 21(fout) 16\r
+             131:   18(float) Load 130\r
+             132:   18(float) FAdd 131 128\r
+             133:    129(ptr) AccessChain 21(fout) 16\r
+                              Store 133 132\r
+             134:      6(int) Load 124(i1out)\r
+             136:    135(ptr) AccessChain 9(iout) 16\r
+             137:      6(int) Load 136\r
+             138:      6(int) IAdd 137 134\r
+             139:    135(ptr) AccessChain 9(iout) 16\r
+                              Store 139 138\r
+             143:  140(fvec2) Load 142(v2)\r
+             147:  144(ivec2) Load 146(i2)\r
+             148:  140(fvec2) ExtInst 1(GLSL.std.450) 53(Ldexp) 143 147\r
+             149:   19(fvec4) Load 21(fout)\r
+             150:  140(fvec2) VectorShuffle 149 149 0 1\r
+             151:  140(fvec2) FAdd 150 148\r
+             152:   19(fvec4) Load 21(fout)\r
+             153:   19(fvec4) VectorShuffle 152 151 4 5 2 3\r
+                              Store 21(fout) 153\r
+             154:   18(float) Load 121(v1)\r
+             157:      6(int) Load 156(i1)\r
+             158:   18(float) ExtInst 1(GLSL.std.450) 53(Ldexp) 154 157\r
+             159:    129(ptr) AccessChain 21(fout) 16\r
+             160:   18(float) Load 159\r
+             161:   18(float) FAdd 160 158\r
+             162:    129(ptr) AccessChain 21(fout) 16\r
+                              Store 162 161\r
+             163:      6(int) Load 156(i1)\r
+             166:      6(int) BitFieldSExtract 163 164 165\r
+             167:    135(ptr) AccessChain 9(iout) 16\r
+             168:      6(int) Load 167\r
+             169:      6(int) IAdd 168 166\r
+             170:    135(ptr) AccessChain 9(iout) 16\r
+                              Store 170 169\r
+             174:  171(ivec3) Load 173(u3)\r
+             175:  171(ivec3) BitFieldUExtract 174 164 165\r
+             176:   13(ivec4) Load 15(uout)\r
+             177:  171(ivec3) VectorShuffle 176 176 0 1 2\r
+             178:  171(ivec3) IAdd 177 175\r
+             179:   13(ivec4) Load 15(uout)\r
+             180:   13(ivec4) VectorShuffle 179 178 4 5 6 3\r
+                              Store 15(uout) 180\r
+             183:  102(ivec3) Load 182(i3)\r
+             184:  102(ivec3) Load 182(i3)\r
+             185:  102(ivec3) BitFieldInsert 183 184 164 165\r
+             186:    7(ivec4) Load 9(iout)\r
+             187:  102(ivec3) VectorShuffle 186 186 0 1 2\r
+             188:  102(ivec3) IAdd 187 185\r
+             189:    7(ivec4) Load 9(iout)\r
+             190:    7(ivec4) VectorShuffle 189 188 4 5 6 3\r
+                              Store 9(iout) 190\r
+             191:     12(int) Load 47(u1)\r
+             192:     12(int) Load 47(u1)\r
+             193:     12(int) BitFieldInsert 191 192 164 165\r
+             194:     56(ptr) AccessChain 15(uout) 16\r
+             195:     12(int) Load 194\r
+             196:     12(int) IAdd 195 193\r
+             197:     56(ptr) AccessChain 15(uout) 16\r
+                              Store 197 196\r
+             198:  144(ivec2) Load 146(i2)\r
+             199:  144(ivec2) BitReverse 198\r
+             200:    7(ivec4) Load 9(iout)\r
+             201:  144(ivec2) VectorShuffle 200 200 0 1\r
+             202:  144(ivec2) IAdd 201 199\r
+             203:    7(ivec4) Load 9(iout)\r
+             204:    7(ivec4) VectorShuffle 203 202 4 5 2 3\r
+                              Store 9(iout) 204\r
+             205:   13(ivec4) Load 67(u4)\r
+             206:   13(ivec4) BitReverse 205\r
+             207:   13(ivec4) Load 15(uout)\r
+             208:   13(ivec4) IAdd 207 206\r
+                              Store 15(uout) 208\r
+             209:      6(int) Load 156(i1)\r
+             210:      6(int) BitCount 209\r
+             211:    135(ptr) AccessChain 9(iout) 16\r
+             212:      6(int) Load 211\r
+             213:      6(int) IAdd 212 210\r
+             214:    135(ptr) AccessChain 9(iout) 16\r
+                              Store 214 213\r
+             215:  171(ivec3) Load 173(u3)\r
+             216:  102(ivec3) BitCount 215\r
+             217:    7(ivec4) Load 9(iout)\r
+             218:  102(ivec3) VectorShuffle 217 217 0 1 2\r
+             219:  102(ivec3) IAdd 218 216\r
+             220:    7(ivec4) Load 9(iout)\r
+             221:    7(ivec4) VectorShuffle 220 219 4 5 6 3\r
+                              Store 9(iout) 221\r
+             222:  144(ivec2) Load 146(i2)\r
+             223:  144(ivec2) ExtInst 1(GLSL.std.450) 73(FindILsb) 222\r
+             224:    7(ivec4) Load 9(iout)\r
+             225:  144(ivec2) VectorShuffle 224 224 0 1\r
+             226:  144(ivec2) IAdd 225 223\r
+             227:    7(ivec4) Load 9(iout)\r
+             228:    7(ivec4) VectorShuffle 227 226 4 5 2 3\r
+                              Store 9(iout) 228\r
+             229:   13(ivec4) Load 67(u4)\r
+             230:    7(ivec4) ExtInst 1(GLSL.std.450) 73(FindILsb) 229\r
+             231:    7(ivec4) Load 9(iout)\r
+             232:    7(ivec4) IAdd 231 230\r
+                              Store 9(iout) 232\r
+             233:      6(int) Load 156(i1)\r
+             234:      6(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 233\r
+             235:    135(ptr) AccessChain 9(iout) 16\r
+             236:      6(int) Load 235\r
+             237:      6(int) IAdd 236 234\r
+             238:    135(ptr) AccessChain 9(iout) 16\r
+                              Store 238 237\r
+             239:   24(ivec2) Load 26(u2)\r
+             240:  144(ivec2) ExtInst 1(GLSL.std.450) 75(FindUMsb) 239\r
+             241:    7(ivec4) Load 9(iout)\r
+             242:  144(ivec2) VectorShuffle 241 241 0 1\r
+             243:  144(ivec2) IAdd 242 240\r
+             244:    7(ivec4) Load 9(iout)\r
+             245:    7(ivec4) VectorShuffle 244 243 4 5 2 3\r
+                              Store 9(iout) 245\r
+             248:   19(fvec4) Load 247(v4)\r
+             249:     12(int) ExtInst 1(GLSL.std.450) 55(PackUnorm4x8) 248\r
+             250:     56(ptr) AccessChain 15(uout) 16\r
+             251:     12(int) Load 250\r
+             252:     12(int) IAdd 251 249\r
+             253:     56(ptr) AccessChain 15(uout) 16\r
+                              Store 253 252\r
+             254:   19(fvec4) Load 247(v4)\r
+             255:     12(int) ExtInst 1(GLSL.std.450) 54(PackSnorm4x8) 254\r
+             256:     56(ptr) AccessChain 15(uout) 16\r
+             257:     12(int) Load 256\r
+             258:     12(int) IAdd 257 255\r
+             259:     56(ptr) AccessChain 15(uout) 16\r
+                              Store 259 258\r
+             260:     12(int) Load 47(u1)\r
+             261:   19(fvec4) ExtInst 1(GLSL.std.450) 64(UnpackUnorm4x8) 260\r
+             262:   19(fvec4) Load 21(fout)\r
+             263:   19(fvec4) FAdd 262 261\r
+                              Store 21(fout) 263\r
+             264:     12(int) Load 47(u1)\r
+             265:   19(fvec4) ExtInst 1(GLSL.std.450) 63(UnpackSnorm4x8) 264\r
+             266:   19(fvec4) Load 21(fout)\r
+             267:   19(fvec4) FAdd 266 265\r
+                              Store 21(fout) 267\r
+                              Return\r
+                              FunctionEnd\r
diff --git a/Test/spv.intOps.vert b/Test/spv.intOps.vert
new file mode 100644 (file)
index 0000000..b7d749b
--- /dev/null
@@ -0,0 +1,72 @@
+#version 310 es\r
+\r
+in uint u1;\r
+in uvec2 u2;\r
+in uvec3 u3;\r
+in uvec4 u4;\r
+\r
+in float v1;\r
+in vec2 v2;\r
+in vec3 v3;\r
+in vec4 v4;\r
+\r
+in int i1;\r
+in ivec2 i2;\r
+in ivec3 i3;\r
+in ivec4 i4;\r
+\r
+out uvec4 uout;\r
+out ivec4 iout;\r
+out vec4 fout;\r
+\r
+void main()\r
+{\r
+    iout = ivec4(0);\r
+    uout = uvec4(0);\r
+    fout = vec4(0.0);\r
+\r
+    uvec2 u2out;\r
+    uout.xy += uaddCarry(u2, u2, u2out);\r
+    uout.xy += u2out;\r
+\r
+    uint u1out;\r
+    uout.x += usubBorrow(u1, u1, u1out);\r
+    uout.x += u1out;\r
+\r
+    uvec4 u4outHi, u4outLow;\r
+    umulExtended(u4, u4, u4outHi, u4outLow);\r
+    uout += u4outHi + u4outLow;\r
+\r
+    ivec4 i4outHi, i4outLow;\r
+    imulExtended(i4, i4, i4outHi, i4outLow);\r
+    iout += i4outLow + i4outHi;\r
+\r
+    ivec3 i3out;\r
+    fout.xyz += frexp(v3, i3out);\r
+    iout.xyz += i3out;\r
+    int i1out;\r
+    fout.x += frexp(v1, i1out);\r
+    iout.x += i1out;\r
+\r
+    fout.xy += ldexp(v2, i2);\r
+    fout.x += ldexp(v1, i1);\r
+\r
+    iout.x += bitfieldExtract(i1, 4, 5);\r
+    uout.xyz += bitfieldExtract(u3, 4, 5);\r
+    iout.xyz += bitfieldInsert(i3, i3, 4, 5);\r
+    uout.x += bitfieldInsert(u1, u1, 4, 5);\r
+    iout.xy += bitfieldReverse(i2);\r
+    uout += bitfieldReverse(u4);\r
+    iout.x += bitCount(i1);\r
+    iout.xyz += bitCount(u3);\r
+\r
+    iout.xy += findLSB(i2);\r
+    iout += findLSB(u4);\r
+    iout.x += findMSB(i1);\r
+    iout.xy += findMSB(u2);\r
+\r
+    uout.x += packUnorm4x8(v4);\r
+    uout.x += packSnorm4x8(v4);\r
+    fout += unpackUnorm4x8(u1);\r
+    fout += unpackSnorm4x8(u1);\r
+}\r
index a995181..0a7786d 100644 (file)
@@ -2,5 +2,5 @@
 // For the version, it uses the latest git tag followed by the number of commits.
 // For the date, it uses the current date (when then script is run).
 
-#define GLSLANG_REVISION "3.0.798"
-#define GLSLANG_DATE "15-Nov-2015"
+#define GLSLANG_REVISION "SPIRV99.798"
+#define GLSLANG_DATE "16-Nov-2015"