1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
|
/*-------------------------------------------------------------------------
* drawElements Quality Program OpenGL ES 3.1 Module
* -------------------------------------------------
*
* Copyright 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*//*!
* \file
* \brief Integer built-in function tests.
*//*--------------------------------------------------------------------*/
#include "es31fShaderIntegerFunctionTests.hpp"
#include "glsShaderExecUtil.hpp"
#include "tcuTestLog.hpp"
#include "tcuFormatUtil.hpp"
#include "tcuFloat.hpp"
#include "deRandom.hpp"
#include "deMath.h"
#include "deString.h"
#include "deInt32.h"
namespace deqp
{
namespace gles31
{
namespace Functional
{
using std::vector;
using std::string;
using tcu::TestLog;
using namespace gls::ShaderExecUtil;
using tcu::IVec2;
using tcu::IVec3;
using tcu::IVec4;
using tcu::UVec2;
using tcu::UVec3;
using tcu::UVec4;
// Utilities
namespace
{
struct HexFloat
{
const float value;
HexFloat (const float value_) : value(value_) {}
};
std::ostream& operator<< (std::ostream& str, const HexFloat& v)
{
return str << v.value << " / " << tcu::toHex(tcu::Float32(v.value).bits());
}
struct VarValue
{
const glu::VarType& type;
const void* value;
VarValue (const glu::VarType& type_, const void* value_) : type(type_), value(value_) {}
};
std::ostream& operator<< (std::ostream& str, const VarValue& varValue)
{
DE_ASSERT(varValue.type.isBasicType());
const glu::DataType basicType = varValue.type.getBasicType();
const glu::DataType scalarType = glu::getDataTypeScalarType(basicType);
const int numComponents = glu::getDataTypeScalarSize(basicType);
if (numComponents > 1)
str << glu::getDataTypeName(basicType) << "(";
for (int compNdx = 0; compNdx < numComponents; compNdx++)
{
if (compNdx != 0)
str << ", ";
switch (scalarType)
{
case glu::TYPE_FLOAT: str << HexFloat(((const float*)varValue.value)[compNdx]); break;
case glu::TYPE_INT: str << ((const deInt32*)varValue.value)[compNdx]; break;
case glu::TYPE_UINT: str << tcu::toHex(((const deUint32*)varValue.value)[compNdx]); break;
case glu::TYPE_BOOL: str << (((const deUint32*)varValue.value)[compNdx] != 0 ? "true" : "false"); break;
default:
DE_ASSERT(false);
}
}
if (numComponents > 1)
str << ")";
return str;
}
inline int getShaderUintBitCount (glu::ShaderType shaderType, glu::Precision precision)
{
// \todo [2013-10-31 pyry] Query from GL for vertex and fragment shaders.
DE_UNREF(shaderType);
const int bitCounts[] = { 8, 16, 32 };
DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(bitCounts) == glu::PRECISION_LAST);
return bitCounts[precision];
}
} // anonymous
// IntegerFunctionCase
class IntegerFunctionCase : public TestCase
{
public:
IntegerFunctionCase (Context& context, const char* name, const char* description, glu::ShaderType shaderType);
~IntegerFunctionCase (void);
void init (void);
void deinit (void);
IterateResult iterate (void);
protected:
IntegerFunctionCase (const IntegerFunctionCase& other);
IntegerFunctionCase& operator= (const IntegerFunctionCase& other);
virtual void getInputValues (int numValues, void* const* values) const = 0;
virtual bool compare (const void* const* inputs, const void* const* outputs) = 0;
glu::ShaderType m_shaderType;
ShaderSpec m_spec;
int m_numValues;
std::ostringstream m_failMsg; //!< Comparison failure help message.
private:
ShaderExecutor* m_executor;
};
IntegerFunctionCase::IntegerFunctionCase (Context& context, const char* name, const char* description, glu::ShaderType shaderType)
: TestCase (context, name, description)
, m_shaderType (shaderType)
, m_numValues (100)
, m_executor (DE_NULL)
{
m_spec.version = glu::GLSL_VERSION_310_ES;
}
IntegerFunctionCase::~IntegerFunctionCase (void)
{
IntegerFunctionCase::deinit();
}
void IntegerFunctionCase::init (void)
{
DE_ASSERT(!m_executor);
m_executor = createExecutor(m_context.getRenderContext(), m_shaderType, m_spec);
m_testCtx.getLog() << m_executor;
if (!m_executor->isOk())
throw tcu::TestError("Compile failed");
}
void IntegerFunctionCase::deinit (void)
{
delete m_executor;
m_executor = DE_NULL;
}
static vector<int> getScalarSizes (const vector<Symbol>& symbols)
{
vector<int> sizes(symbols.size());
for (int ndx = 0; ndx < (int)symbols.size(); ++ndx)
sizes[ndx] = symbols[ndx].varType.getScalarSize();
return sizes;
}
static int computeTotalScalarSize (const vector<Symbol>& symbols)
{
int totalSize = 0;
for (vector<Symbol>::const_iterator sym = symbols.begin(); sym != symbols.end(); ++sym)
totalSize += sym->varType.getScalarSize();
return totalSize;
}
static vector<void*> getInputOutputPointers (const vector<Symbol>& symbols, vector<deUint32>& data, const int numValues)
{
vector<void*> pointers (symbols.size());
int curScalarOffset = 0;
for (int varNdx = 0; varNdx < (int)symbols.size(); ++varNdx)
{
const Symbol& var = symbols[varNdx];
const int scalarSize = var.varType.getScalarSize();
// Uses planar layout as input/output specs do not support strides.
pointers[varNdx] = &data[curScalarOffset];
curScalarOffset += scalarSize*numValues;
}
DE_ASSERT(curScalarOffset == (int)data.size());
return pointers;
}
IntegerFunctionCase::IterateResult IntegerFunctionCase::iterate (void)
{
const int numInputScalars = computeTotalScalarSize(m_spec.inputs);
const int numOutputScalars = computeTotalScalarSize(m_spec.outputs);
vector<deUint32> inputData (numInputScalars * m_numValues);
vector<deUint32> outputData (numOutputScalars * m_numValues);
const vector<void*> inputPointers = getInputOutputPointers(m_spec.inputs, inputData, m_numValues);
const vector<void*> outputPointers = getInputOutputPointers(m_spec.outputs, outputData, m_numValues);
// Initialize input data.
getInputValues(m_numValues, &inputPointers[0]);
// Execute shader.
m_executor->useProgram();
m_executor->execute(m_numValues, &inputPointers[0], &outputPointers[0]);
// Compare results.
{
const vector<int> inScalarSizes = getScalarSizes(m_spec.inputs);
const vector<int> outScalarSizes = getScalarSizes(m_spec.outputs);
vector<void*> curInputPtr (inputPointers.size());
vector<void*> curOutputPtr (outputPointers.size());
int numFailed = 0;
for (int valNdx = 0; valNdx < m_numValues; valNdx++)
{
// Set up pointers for comparison.
for (int inNdx = 0; inNdx < (int)curInputPtr.size(); ++inNdx)
curInputPtr[inNdx] = (deUint32*)inputPointers[inNdx] + inScalarSizes[inNdx]*valNdx;
for (int outNdx = 0; outNdx < (int)curOutputPtr.size(); ++outNdx)
curOutputPtr[outNdx] = (deUint32*)outputPointers[outNdx] + outScalarSizes[outNdx]*valNdx;
if (!compare(&curInputPtr[0], &curOutputPtr[0]))
{
// \todo [2013-08-08 pyry] We probably want to log reference value as well?
m_testCtx.getLog() << TestLog::Message << "ERROR: comparison failed for value " << valNdx << ":\n " << m_failMsg.str() << TestLog::EndMessage;
m_testCtx.getLog() << TestLog::Message << " inputs:" << TestLog::EndMessage;
for (int inNdx = 0; inNdx < (int)curInputPtr.size(); inNdx++)
m_testCtx.getLog() << TestLog::Message << " " << m_spec.inputs[inNdx].name << " = "
<< VarValue(m_spec.inputs[inNdx].varType, curInputPtr[inNdx])
<< TestLog::EndMessage;
m_testCtx.getLog() << TestLog::Message << " outputs:" << TestLog::EndMessage;
for (int outNdx = 0; outNdx < (int)curOutputPtr.size(); outNdx++)
m_testCtx.getLog() << TestLog::Message << " " << m_spec.outputs[outNdx].name << " = "
<< VarValue(m_spec.outputs[outNdx].varType, curOutputPtr[outNdx])
<< TestLog::EndMessage;
m_failMsg.str("");
m_failMsg.clear();
numFailed += 1;
}
}
m_testCtx.getLog() << TestLog::Message << (m_numValues - numFailed) << " / " << m_numValues << " values passed" << TestLog::EndMessage;
m_testCtx.setTestResult(numFailed == 0 ? QP_TEST_RESULT_PASS : QP_TEST_RESULT_FAIL,
numFailed == 0 ? "Pass" : "Result comparison failed");
}
return STOP;
}
static const char* getPrecisionPostfix (glu::Precision precision)
{
static const char* s_postfix[] =
{
"_lowp",
"_mediump",
"_highp"
};
DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_postfix) == glu::PRECISION_LAST);
DE_ASSERT(de::inBounds<int>(precision, 0, DE_LENGTH_OF_ARRAY(s_postfix)));
return s_postfix[precision];
}
static const char* getShaderTypePostfix (glu::ShaderType shaderType)
{
static const char* s_postfix[] =
{
"_vertex",
"_fragment",
"_geometry",
"_tess_control",
"_tess_eval",
"_compute"
};
DE_ASSERT(de::inBounds<int>(shaderType, 0, DE_LENGTH_OF_ARRAY(s_postfix)));
return s_postfix[shaderType];
}
static std::string getIntegerFuncCaseName (glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
{
return string(glu::getDataTypeName(baseType)) + getPrecisionPostfix(precision) + getShaderTypePostfix(shaderType);
}
class UaddCarryCase : public IntegerFunctionCase
{
public:
UaddCarryCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
: IntegerFunctionCase(context, getIntegerFuncCaseName(baseType, precision, shaderType).c_str(), "uaddCarry", shaderType)
{
m_spec.inputs.push_back(Symbol("x", glu::VarType(baseType, precision)));
m_spec.inputs.push_back(Symbol("y", glu::VarType(baseType, precision)));
m_spec.outputs.push_back(Symbol("sum", glu::VarType(baseType, precision)));
m_spec.outputs.push_back(Symbol("carry", glu::VarType(baseType, glu::PRECISION_LOWP)));
m_spec.source = "sum = uaddCarry(x, y, carry);";
}
void getInputValues (int numValues, void* const* values) const
{
de::Random rnd (deStringHash(getName()) ^ 0x235facu);
const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
// const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
const int scalarSize = glu::getDataTypeScalarSize(type);
deUint32* in0 = (deUint32*)values[0];
deUint32* in1 = (deUint32*)values[1];
int valueNdx = 0;
const struct
{
deUint32 x;
deUint32 y;
} easyCases[] =
{
{ 0x00000000u, 0x00000000u },
{ 0xfffffffeu, 0x00000001u },
{ 0x00000001u, 0xfffffffeu },
{ 0xffffffffu, 0x00000001u },
{ 0x00000001u, 0xffffffffu },
{ 0xfffffffeu, 0x00000002u },
{ 0x00000002u, 0xfffffffeu },
{ 0xffffffffu, 0xffffffffu }
};
for (int easyCaseNdx = 0; easyCaseNdx < DE_LENGTH_OF_ARRAY(easyCases); easyCaseNdx++)
{
for (int compNdx = 0; compNdx < scalarSize; compNdx++)
{
in0[valueNdx*scalarSize + compNdx] = easyCases[easyCaseNdx].x;
in1[valueNdx*scalarSize + compNdx] = easyCases[easyCaseNdx].y;
}
valueNdx += 1;
}
while (valueNdx < numValues)
{
for (int compNdx = 0; compNdx < scalarSize; compNdx++)
{
in0[valueNdx*scalarSize + compNdx] = rnd.getUint32();
in1[valueNdx*scalarSize + compNdx] = rnd.getUint32();
}
valueNdx += 1;
}
}
bool compare (const void* const* inputs, const void* const* outputs)
{
const deUint32 cmpMasks0[] = { 0xffu, 0xffffu, 0xffffffffu };
const deUint32 cmpMasks1[] = { 0xfffffff0u, 0xfffffff0u, 0xffffffffu };
const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
const int scalarSize = glu::getDataTypeScalarSize(type);
const deUint32 mask0 = cmpMasks0[precision];
const deUint32 mask1 = cmpMasks1[precision];
for (int compNdx = 0; compNdx < scalarSize; compNdx++)
{
const deUint32 in0 = ((const deUint32*)inputs[0])[compNdx];
const deUint32 in1 = ((const deUint32*)inputs[1])[compNdx];
const deUint32 out0 = ((const deUint32*)outputs[0])[compNdx];
const deUint32 out1 = ((const deUint32*)outputs[1])[compNdx];
const deUint32 ref0 = in0+in1;
const deUint32 ref1 = (deUint64(in0)+deUint64(in1)) > 0xffffffffu ? 1u : 0u;
if (((out0&mask0) != (ref0&mask0)) || ((out1&mask1) != (ref1&mask1)))
{
m_failMsg << "Expected [" << compNdx << "] = " << tcu::toHex(ref0) << ", " << tcu::toHex(ref1);
return false;
}
}
return true;
}
};
class UsubBorrowCase : public IntegerFunctionCase
{
public:
UsubBorrowCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
: IntegerFunctionCase(context, getIntegerFuncCaseName(baseType, precision, shaderType).c_str(), "usubBorrow", shaderType)
{
m_spec.inputs.push_back(Symbol("x", glu::VarType(baseType, precision)));
m_spec.inputs.push_back(Symbol("y", glu::VarType(baseType, precision)));
m_spec.outputs.push_back(Symbol("diff", glu::VarType(baseType, precision)));
m_spec.outputs.push_back(Symbol("carry", glu::VarType(baseType, glu::PRECISION_LOWP)));
m_spec.source = "diff = usubBorrow(x, y, carry);";
}
void getInputValues (int numValues, void* const* values) const
{
de::Random rnd (deStringHash(getName()) ^ 0x235facu);
const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
// const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
const int scalarSize = glu::getDataTypeScalarSize(type);
deUint32* in0 = (deUint32*)values[0];
deUint32* in1 = (deUint32*)values[1];
int valueNdx = 0;
const struct
{
deUint32 x;
deUint32 y;
} easyCases[] =
{
{ 0x00000000u, 0x00000000u },
{ 0x00000001u, 0x00000001u },
{ 0x00000001u, 0x00000002u },
{ 0x00000001u, 0xffffffffu },
{ 0xfffffffeu, 0xffffffffu },
{ 0xffffffffu, 0xffffffffu },
};
for (int easyCaseNdx = 0; easyCaseNdx < DE_LENGTH_OF_ARRAY(easyCases); easyCaseNdx++)
{
for (int compNdx = 0; compNdx < scalarSize; compNdx++)
{
in0[valueNdx*scalarSize + compNdx] = easyCases[easyCaseNdx].x;
in1[valueNdx*scalarSize + compNdx] = easyCases[easyCaseNdx].y;
}
valueNdx += 1;
}
while (valueNdx < numValues)
{
for (int compNdx = 0; compNdx < scalarSize; compNdx++)
{
in0[valueNdx*scalarSize + compNdx] = rnd.getUint32();
in1[valueNdx*scalarSize + compNdx] = rnd.getUint32();
}
valueNdx += 1;
}
}
bool compare (const void* const* inputs, const void* const* outputs)
{
const deUint32 cmpMasks0[] = { 0xffu, 0xffffu, 0xffffffffu };
const deUint32 cmpMasks1[] = { 0xfffffff0u, 0xfffffff0u, 0xffffffffu };
const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
const int scalarSize = glu::getDataTypeScalarSize(type);
const deUint32 mask0 = cmpMasks0[precision];
const deUint32 mask1 = cmpMasks1[precision];
for (int compNdx = 0; compNdx < scalarSize; compNdx++)
{
const deUint32 in0 = ((const deUint32*)inputs[0])[compNdx];
const deUint32 in1 = ((const deUint32*)inputs[1])[compNdx];
const deUint32 out0 = ((const deUint32*)outputs[0])[compNdx];
const deUint32 out1 = ((const deUint32*)outputs[1])[compNdx];
const deUint32 ref0 = in0-in1;
const deUint32 ref1 = in0 >= in1 ? 0u : 1u;
if (((out0&mask0) != (ref0&mask0)) || ((out1&mask1) != (ref1&mask1)))
{
m_failMsg << "Expected [" << compNdx << "] = " << tcu::toHex(ref0) << ", " << tcu::toHex(ref1);
return false;
}
}
return true;
}
};
class UmulExtendedCase : public IntegerFunctionCase
{
public:
UmulExtendedCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
: IntegerFunctionCase(context, getIntegerFuncCaseName(baseType, precision, shaderType).c_str(), "umulExtended", shaderType)
{
m_spec.inputs.push_back(Symbol("x", glu::VarType(baseType, precision)));
m_spec.inputs.push_back(Symbol("y", glu::VarType(baseType, precision)));
m_spec.outputs.push_back(Symbol("msb", glu::VarType(baseType, precision)));
m_spec.outputs.push_back(Symbol("lsb", glu::VarType(baseType, precision)));
m_spec.source = "umulExtended(x, y, msb, lsb);";
}
void getInputValues (int numValues, void* const* values) const
{
de::Random rnd (deStringHash(getName()) ^ 0x235facu);
const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
// const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
const int scalarSize = glu::getDataTypeScalarSize(type);
deUint32* in0 = (deUint32*)values[0];
deUint32* in1 = (deUint32*)values[1];
int valueNdx = 0;
const struct
{
deUint32 x;
deUint32 y;
} easyCases[] =
{
{ 0x00000000u, 0x00000000u },
{ 0xffffffffu, 0x00000001u },
{ 0xffffffffu, 0x00000002u },
{ 0x00000001u, 0xffffffffu },
{ 0x00000002u, 0xffffffffu },
{ 0xffffffffu, 0xffffffffu },
};
for (int easyCaseNdx = 0; easyCaseNdx < DE_LENGTH_OF_ARRAY(easyCases); easyCaseNdx++)
{
for (int compNdx = 0; compNdx < scalarSize; compNdx++)
{
in0[valueNdx*scalarSize + compNdx] = easyCases[easyCaseNdx].x;
in1[valueNdx*scalarSize + compNdx] = easyCases[easyCaseNdx].y;
}
valueNdx += 1;
}
while (valueNdx < numValues)
{
for (int compNdx = 0; compNdx < scalarSize; compNdx++)
{
const deUint32 base0 = rnd.getUint32();
const deUint32 base1 = rnd.getUint32();
const int adj0 = rnd.getInt(0, 20);
const int adj1 = rnd.getInt(0, 20);
in0[valueNdx*scalarSize + compNdx] = base0 >> adj0;
in1[valueNdx*scalarSize + compNdx] = base1 >> adj1;
}
valueNdx += 1;
}
}
bool compare (const void* const* inputs, const void* const* outputs)
{
const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
const int scalarSize = glu::getDataTypeScalarSize(type);
for (int compNdx = 0; compNdx < scalarSize; compNdx++)
{
const deUint32 in0 = ((const deUint32*)inputs[0])[compNdx];
const deUint32 in1 = ((const deUint32*)inputs[1])[compNdx];
const deUint32 out0 = ((const deUint32*)outputs[0])[compNdx];
const deUint32 out1 = ((const deUint32*)outputs[1])[compNdx];
const deUint64 mul64 = deUint64(in0)*deUint64(in1);
const deUint32 ref0 = deUint32(mul64 >> 32);
const deUint32 ref1 = deUint32(mul64 & 0xffffffffu);
if (out0 != ref0 || out1 != ref1)
{
m_failMsg << "Expected [" << compNdx << "] = " << tcu::toHex(ref0) << ", " << tcu::toHex(ref1);
return false;
}
}
return true;
}
};
class ImulExtendedCase : public IntegerFunctionCase
{
public:
ImulExtendedCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
: IntegerFunctionCase(context, getIntegerFuncCaseName(baseType, precision, shaderType).c_str(), "imulExtended", shaderType)
{
m_spec.inputs.push_back(Symbol("x", glu::VarType(baseType, precision)));
m_spec.inputs.push_back(Symbol("y", glu::VarType(baseType, precision)));
m_spec.outputs.push_back(Symbol("msb", glu::VarType(baseType, precision)));
m_spec.outputs.push_back(Symbol("lsb", glu::VarType(baseType, precision)));
m_spec.source = "imulExtended(x, y, msb, lsb);";
}
void getInputValues (int numValues, void* const* values) const
{
de::Random rnd (deStringHash(getName()) ^ 0x224fa1u);
const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
// const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
const int scalarSize = glu::getDataTypeScalarSize(type);
deUint32* in0 = (deUint32*)values[0];
deUint32* in1 = (deUint32*)values[1];
int valueNdx = 0;
const struct
{
deUint32 x;
deUint32 y;
} easyCases[] =
{
{ 0x00000000u, 0x00000000u },
{ 0xffffffffu, 0x00000002u },
{ 0x7fffffffu, 0x00000001u },
{ 0x7fffffffu, 0x00000002u },
{ 0x7fffffffu, 0x7fffffffu },
{ 0xffffffffu, 0xffffffffu },
{ 0x7fffffffu, 0xfffffffeu },
};
for (int easyCaseNdx = 0; easyCaseNdx < DE_LENGTH_OF_ARRAY(easyCases); easyCaseNdx++)
{
for (int compNdx = 0; compNdx < scalarSize; compNdx++)
{
in0[valueNdx*scalarSize + compNdx] = (deInt32)easyCases[easyCaseNdx].x;
in1[valueNdx*scalarSize + compNdx] = (deInt32)easyCases[easyCaseNdx].y;
}
valueNdx += 1;
}
while (valueNdx < numValues)
{
for (int compNdx = 0; compNdx < scalarSize; compNdx++)
{
const deInt32 base0 = (deInt32)rnd.getUint32();
const deInt32 base1 = (deInt32)rnd.getUint32();
const int adj0 = rnd.getInt(0, 20);
const int adj1 = rnd.getInt(0, 20);
in0[valueNdx*scalarSize + compNdx] = base0 >> adj0;
in1[valueNdx*scalarSize + compNdx] = base1 >> adj1;
}
valueNdx += 1;
}
}
bool compare (const void* const* inputs, const void* const* outputs)
{
const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
const int scalarSize = glu::getDataTypeScalarSize(type);
for (int compNdx = 0; compNdx < scalarSize; compNdx++)
{
const deInt32 in0 = ((const deInt32*)inputs[0])[compNdx];
const deInt32 in1 = ((const deInt32*)inputs[1])[compNdx];
const deInt32 out0 = ((const deInt32*)outputs[0])[compNdx];
const deInt32 out1 = ((const deInt32*)outputs[1])[compNdx];
const deInt64 mul64 = deInt64(in0)*deInt64(in1);
const deInt32 ref0 = deInt32(mul64 >> 32);
const deInt32 ref1 = deInt32(mul64 & 0xffffffffu);
if (out0 != ref0 || out1 != ref1)
{
m_failMsg << "Expected [" << compNdx << "] = " << tcu::toHex(ref0) << ", " << tcu::toHex(ref1);
return false;
}
}
return true;
}
};
class BitfieldExtractCase : public IntegerFunctionCase
{
public:
BitfieldExtractCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
: IntegerFunctionCase(context, getIntegerFuncCaseName(baseType, precision, shaderType).c_str(), "bitfieldExtract", shaderType)
{
m_spec.inputs.push_back(Symbol("value", glu::VarType(baseType, precision)));
m_spec.inputs.push_back(Symbol("offset", glu::VarType(glu::TYPE_INT, precision)));
m_spec.inputs.push_back(Symbol("bits", glu::VarType(glu::TYPE_INT, precision)));
m_spec.outputs.push_back(Symbol("extracted", glu::VarType(baseType, precision)));
m_spec.source = "extracted = bitfieldExtract(value, offset, bits);";
}
void getInputValues (int numValues, void* const* values) const
{
de::Random rnd (deStringHash(getName()) ^ 0xa113fca2u);
const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
const int scalarSize = glu::getDataTypeScalarSize(type);
const bool ignoreSign = precision != glu::PRECISION_HIGHP && glu::isDataTypeIntOrIVec(type);
const int numBits = getShaderUintBitCount(m_shaderType, precision) - (ignoreSign ? 1 : 0);
deUint32* inValue = (deUint32*)values[0];
int* inOffset = (int*)values[1];
int* inBits = (int*)values[2];
int valueNdx = 0;
while (valueNdx < numValues)
{
const int bits = rnd.getInt(0, numBits);
const int offset = rnd.getInt(0, numBits-bits);
inOffset[valueNdx] = offset;
inBits[valueNdx] = bits;
for (int compNdx = 0; compNdx < scalarSize; compNdx++)
inValue[valueNdx*scalarSize + compNdx] = rnd.getUint32();
valueNdx += 1;
}
}
bool compare (const void* const* inputs, const void* const* outputs)
{
const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
const bool isSigned = glu::isDataTypeIntOrIVec(type);
const int scalarSize = glu::getDataTypeScalarSize(type);
const int offset = *((const int*)inputs[1]);
const int bits = *((const int*)inputs[2]);
for (int compNdx = 0; compNdx < scalarSize; compNdx++)
{
const deUint32 value = ((const deUint32*)inputs[0])[compNdx];
const deUint32 out = ((const deUint32*)outputs[0])[compNdx];
const deUint32 valMask = (bits == 32 ? ~0u : ((1u<<bits)-1u));
const deUint32 baseVal = (value >> offset) & valMask;
const deUint32 ref = baseVal | ((isSigned && (baseVal & (1<<(bits-1)))) ? ~valMask : 0u);
if (out != ref)
{
m_failMsg << "Expected [" << compNdx << "] = " << tcu::toHex(ref);
return false;
}
}
return true;
}
};
class BitfieldInsertCase : public IntegerFunctionCase
{
public:
BitfieldInsertCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
: IntegerFunctionCase(context, getIntegerFuncCaseName(baseType, precision, shaderType).c_str(), "bitfieldInsert", shaderType)
{
m_spec.inputs.push_back(Symbol("base", glu::VarType(baseType, precision)));
m_spec.inputs.push_back(Symbol("insert", glu::VarType(baseType, precision)));
m_spec.inputs.push_back(Symbol("offset", glu::VarType(glu::TYPE_INT, precision)));
m_spec.inputs.push_back(Symbol("bits", glu::VarType(glu::TYPE_INT, precision)));
m_spec.outputs.push_back(Symbol("result", glu::VarType(baseType, precision)));
m_spec.source = "result = bitfieldInsert(base, insert, offset, bits);";
}
void getInputValues (int numValues, void* const* values) const
{
de::Random rnd (deStringHash(getName()) ^ 0x12c2acff);
const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
const int scalarSize = glu::getDataTypeScalarSize(type);
const int numBits = getShaderUintBitCount(m_shaderType, precision);
deUint32* inBase = (deUint32*)values[0];
deUint32* inInsert = (deUint32*)values[1];
int* inOffset = (int*)values[2];
int* inBits = (int*)values[3];
int valueNdx = 0;
while (valueNdx < numValues)
{
const int bits = rnd.getInt(0, numBits);
const int offset = rnd.getInt(0, numBits-bits);
inOffset[valueNdx] = offset;
inBits[valueNdx] = bits;
for (int compNdx = 0; compNdx < scalarSize; compNdx++)
{
inBase[valueNdx*scalarSize + compNdx] = rnd.getUint32();
inInsert[valueNdx*scalarSize + compNdx] = rnd.getUint32();
}
valueNdx += 1;
}
}
bool compare (const void* const* inputs, const void* const* outputs)
{
const deUint32 cmpMasks[] = { 0xffu, 0xffffu, 0xffffffffu };
const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
const int scalarSize = glu::getDataTypeScalarSize(type);
const deUint32 cmpMask = cmpMasks[precision];
const int offset = *((const int*)inputs[2]);
const int bits = *((const int*)inputs[3]);
for (int compNdx = 0; compNdx < scalarSize; compNdx++)
{
const deUint32 base = ((const deUint32*)inputs[0])[compNdx];
const deUint32 insert = ((const deUint32*)inputs[1])[compNdx];
const deInt32 out = ((const deUint32*)outputs[0])[compNdx];
const deUint32 mask = bits == 32 ? ~0u : (1u<<bits)-1;
const deUint32 ref = (base & ~(mask<<offset)) | ((insert & mask)<<offset);
if ((out&cmpMask) != (ref&cmpMask))
{
m_failMsg << "Expected [" << compNdx << "] = " << tcu::toHex(ref);
return false;
}
}
return true;
}
};
static inline deUint32 reverseBits (deUint32 v)
{
v = (((v & 0xaaaaaaaa) >> 1) | ((v & 0x55555555) << 1));
v = (((v & 0xcccccccc) >> 2) | ((v & 0x33333333) << 2));
v = (((v & 0xf0f0f0f0) >> 4) | ((v & 0x0f0f0f0f) << 4));
v = (((v & 0xff00ff00) >> 8) | ((v & 0x00ff00ff) << 8));
return((v >> 16) | (v << 16));
}
class BitfieldReverseCase : public IntegerFunctionCase
{
public:
BitfieldReverseCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
: IntegerFunctionCase(context, getIntegerFuncCaseName(baseType, precision, shaderType).c_str(), "bitfieldReverse", shaderType)
{
m_spec.inputs.push_back(Symbol("value", glu::VarType(baseType, precision)));
m_spec.outputs.push_back(Symbol("result", glu::VarType(baseType, glu::PRECISION_HIGHP)));
m_spec.source = "result = bitfieldReverse(value);";
}
void getInputValues (int numValues, void* const* values) const
{
de::Random rnd (deStringHash(getName()) ^ 0xff23a4);
const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
const int scalarSize = glu::getDataTypeScalarSize(type);
deUint32* inValue = (deUint32*)values[0];
int valueNdx = 0;
while (valueNdx < numValues)
{
for (int compNdx = 0; compNdx < scalarSize; compNdx++)
inValue[valueNdx*scalarSize + compNdx] = rnd.getUint32();
valueNdx += 1;
}
}
bool compare (const void* const* inputs, const void* const* outputs)
{
const deUint32 cmpMasks[] = { 0xff000000u, 0xffff0000u, 0xffffffffu };
const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
const int scalarSize = glu::getDataTypeScalarSize(type);
const deUint32 cmpMask = cmpMasks[precision];
for (int compNdx = 0; compNdx < scalarSize; compNdx++)
{
const deUint32 value = ((const deUint32*)inputs[0])[compNdx];
const deInt32 out = ((const deUint32*)outputs[0])[compNdx];
const deUint32 ref = reverseBits(value);
if ((out&cmpMask) != (ref&cmpMask))
{
m_failMsg << "Expected [" << compNdx << "] = " << tcu::toHex(ref);
return false;
}
}
return true;
}
};
class BitCountCase : public IntegerFunctionCase
{
public:
BitCountCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
: IntegerFunctionCase(context, getIntegerFuncCaseName(baseType, precision, shaderType).c_str(), "bitCount", shaderType)
{
const int vecSize = glu::getDataTypeScalarSize(baseType);
const glu::DataType intType = vecSize == 1 ? glu::TYPE_INT : glu::getDataTypeIntVec(vecSize);
m_spec.inputs.push_back(Symbol("value", glu::VarType(baseType, precision)));
m_spec.outputs.push_back(Symbol("count", glu::VarType(intType, glu::PRECISION_LOWP)));
m_spec.source = "count = bitCount(value);";
}
void getInputValues (int numValues, void* const* values) const
{
de::Random rnd (deStringHash(getName()) ^ 0xab2cca4);
const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
const int scalarSize = glu::getDataTypeScalarSize(type);
deUint32* inValue = (deUint32*)values[0];
int valueNdx = 0;
while (valueNdx < numValues)
{
for (int compNdx = 0; compNdx < scalarSize; compNdx++)
inValue[valueNdx*scalarSize + compNdx] = rnd.getUint32();
valueNdx += 1;
}
}
bool compare (const void* const* inputs, const void* const* outputs)
{
const deUint32 countMasks[] = { 0xffu, 0xffffu, 0xffffffffu };
const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
const int scalarSize = glu::getDataTypeScalarSize(type);
const deUint32 countMask = countMasks[precision];
for (int compNdx = 0; compNdx < scalarSize; compNdx++)
{
const deUint32 value = ((const deUint32*)inputs[0])[compNdx];
const int out = ((const int*)outputs[0])[compNdx];
const int minRef = dePop32(value&countMask);
const int maxRef = dePop32(value);
if (!de::inRange(out, minRef, maxRef))
{
m_failMsg << "Expected [" << compNdx << "] in range [" << minRef << ", " << maxRef << "]";
return false;
}
}
return true;
}
};
static int findLSB (deUint32 value)
{
for (int i = 0; i < 32; i++)
{
if (value & (1u<<i))
return i;
}
return -1;
}
class FindLSBCase : public IntegerFunctionCase
{
public:
FindLSBCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
: IntegerFunctionCase(context, getIntegerFuncCaseName(baseType, precision, shaderType).c_str(), "findLSB", shaderType)
{
const int vecSize = glu::getDataTypeScalarSize(baseType);
const glu::DataType intType = vecSize == 1 ? glu::TYPE_INT : glu::getDataTypeIntVec(vecSize);
m_spec.inputs.push_back(Symbol("value", glu::VarType(baseType, precision)));
m_spec.outputs.push_back(Symbol("lsb", glu::VarType(intType, glu::PRECISION_LOWP)));
m_spec.source = "lsb = findLSB(value);";
}
void getInputValues (int numValues, void* const* values) const
{
de::Random rnd (deStringHash(getName()) ^ 0x9923c2af);
const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
const int scalarSize = glu::getDataTypeScalarSize(type);
deUint32* inValue = (deUint32*)values[0];
int valueNdx = 0;
while (valueNdx < numValues)
{
for (int compNdx = 0; compNdx < scalarSize; compNdx++)
inValue[valueNdx*scalarSize + compNdx] = rnd.getUint32();
valueNdx += 1;
}
}
bool compare (const void* const* inputs, const void* const* outputs)
{
const deUint32 masks[] = { 0xffu, 0xffffu, 0xffffffffu };
const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
const int scalarSize = glu::getDataTypeScalarSize(type);
const deUint32 mask = masks[precision];
for (int compNdx = 0; compNdx < scalarSize; compNdx++)
{
const deUint32 value = ((const deUint32*)inputs[0])[compNdx];
const int out = ((const int*)outputs[0])[compNdx];
const int minRef = findLSB(value&mask);
const int maxRef = findLSB(value);
if (!de::inRange(out, minRef, maxRef))
{
m_failMsg << "Expected [" << compNdx << "] in range [" << minRef << ", " << maxRef << "]";
return false;
}
}
return true;
}
};
static int findMSB (int value)
{
if (value > 0)
return 31 - deClz32((deUint32)value);
else if (value < 0)
return 31 - deClz32(~(deUint32)value);
else
return -1;
}
static int findMSB (deUint32 value)
{
if (value > 0)
return 31 - deClz32(value);
else
return -1;
}
class FindMSBCase : public IntegerFunctionCase
{
public:
FindMSBCase (Context& context, glu::DataType baseType, glu::Precision precision, glu::ShaderType shaderType)
: IntegerFunctionCase(context, getIntegerFuncCaseName(baseType, precision, shaderType).c_str(), "findMSB", shaderType)
{
const int vecSize = glu::getDataTypeScalarSize(baseType);
const glu::DataType intType = vecSize == 1 ? glu::TYPE_INT : glu::getDataTypeIntVec(vecSize);
m_spec.inputs.push_back(Symbol("value", glu::VarType(baseType, precision)));
m_spec.outputs.push_back(Symbol("msb", glu::VarType(intType, glu::PRECISION_LOWP)));
m_spec.source = "msb = findMSB(value);";
}
void getInputValues (int numValues, void* const* values) const
{
de::Random rnd (deStringHash(getName()) ^ 0x742ac4e);
const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
const int scalarSize = glu::getDataTypeScalarSize(type);
deUint32* inValue = (deUint32*)values[0];
int valueNdx = 0;
while (valueNdx < numValues)
{
for (int compNdx = 0; compNdx < scalarSize; compNdx++)
inValue[valueNdx*scalarSize + compNdx] = rnd.getUint32();
valueNdx += 1;
}
}
bool compare (const void* const* inputs, const void* const* outputs)
{
const deUint32 masks[] = { 0xffu, 0xffffu, 0xffffffffu };
const glu::DataType type = m_spec.inputs[0].varType.getBasicType();
const glu::Precision precision = m_spec.inputs[0].varType.getPrecision();
const bool isSigned = glu::isDataTypeIntOrIVec(type);
const int scalarSize = glu::getDataTypeScalarSize(type);
const deUint32 mask = masks[precision];
for (int compNdx = 0; compNdx < scalarSize; compNdx++)
{
const deUint32 value = ((const deUint32*)inputs[0])[compNdx];
const int out = ((const int*)outputs[0])[compNdx];
const int minRef = isSigned ? findMSB(int(value&mask)) : findMSB(value&mask);
const int maxRef = isSigned ? findMSB(int(value)) : findMSB(value);
if (!de::inRange(out, minRef, maxRef))
{
m_failMsg << "Expected [" << compNdx << "] in range [" << minRef << ", " << maxRef << "]";
return false;
}
}
return true;
}
};
ShaderIntegerFunctionTests::ShaderIntegerFunctionTests (Context& context)
: TestCaseGroup(context, "integer", "Integer function tests")
{
}
ShaderIntegerFunctionTests::~ShaderIntegerFunctionTests (void)
{
}
template<class TestClass>
static void addFunctionCases (TestCaseGroup* parent, const char* functionName, bool intTypes, bool uintTypes, bool allPrec, deUint32 shaderBits)
{
tcu::TestCaseGroup* group = new tcu::TestCaseGroup(parent->getTestContext(), functionName, functionName);
parent->addChild(group);
const glu::DataType scalarTypes[] =
{
glu::TYPE_INT,
glu::TYPE_UINT
};
for (int scalarTypeNdx = 0; scalarTypeNdx < DE_LENGTH_OF_ARRAY(scalarTypes); scalarTypeNdx++)
{
const glu::DataType scalarType = scalarTypes[scalarTypeNdx];
if ((!intTypes && scalarType == glu::TYPE_INT) || (!uintTypes && scalarType == glu::TYPE_UINT))
continue;
for (int vecSize = 1; vecSize <= 4; vecSize++)
{
for (int prec = glu::PRECISION_LOWP; prec <= glu::PRECISION_HIGHP; prec++)
{
if (prec != glu::PRECISION_HIGHP && !allPrec)
continue;
for (int shaderTypeNdx = 0; shaderTypeNdx < glu::SHADERTYPE_LAST; shaderTypeNdx++)
{
if (shaderBits & (1<<shaderTypeNdx))
group->addChild(new TestClass(parent->getContext(), glu::DataType(scalarType + vecSize - 1), glu::Precision(prec), glu::ShaderType(shaderTypeNdx)));
}
}
}
}
}
void ShaderIntegerFunctionTests::init (void)
{
enum
{
VS = (1<<glu::SHADERTYPE_VERTEX),
FS = (1<<glu::SHADERTYPE_FRAGMENT),
CS = (1<<glu::SHADERTYPE_COMPUTE),
GS = (1<<glu::SHADERTYPE_GEOMETRY),
TC = (1<<glu::SHADERTYPE_TESSELLATION_CONTROL),
TE = (1<<glu::SHADERTYPE_TESSELLATION_EVALUATION),
ALL_SHADERS = VS|TC|TE|GS|FS|CS
};
// Int? Uint? AllPrec? Shaders
addFunctionCases<UaddCarryCase> (this, "uaddcarry", false, true, true, ALL_SHADERS);
addFunctionCases<UsubBorrowCase> (this, "usubborrow", false, true, true, ALL_SHADERS);
addFunctionCases<UmulExtendedCase> (this, "umulextended", false, true, false, ALL_SHADERS);
addFunctionCases<ImulExtendedCase> (this, "imulextended", true, false, false, ALL_SHADERS);
addFunctionCases<BitfieldExtractCase> (this, "bitfieldextract", true, true, true, ALL_SHADERS);
addFunctionCases<BitfieldInsertCase> (this, "bitfieldinsert", true, true, true, ALL_SHADERS);
addFunctionCases<BitfieldReverseCase> (this, "bitfieldreverse", true, true, true, ALL_SHADERS);
addFunctionCases<BitCountCase> (this, "bitcount", true, true, true, ALL_SHADERS);
addFunctionCases<FindLSBCase> (this, "findlsb", true, true, true, ALL_SHADERS);
addFunctionCases<FindMSBCase> (this, "findmsb", true, true, true, ALL_SHADERS);
}
} // Functional
} // gles31
} // deqp
|