18
18
19
19
namespace NEO {
20
20
enum class NewAluOpcodes : uint32_t {
21
- OPCODE_LOAD = 0x080 ,
22
- OPCODE_LOAD0 = 0x081 ,
23
- OPCODE_LOAD1 = 0x481 ,
24
- OPCODE_LOADIND = 0x082 ,
25
- OPCODE_STOREIND = 0x181 ,
26
- OPCODE_SHL = 0x105 ,
27
- OPCODE_SHR = 0x106 ,
28
- OPCODE_SAR = 0x107 ,
29
- OPCODE_FENCE = 0x001
21
+ opcodeLoad = 0x080 ,
22
+ opcodeLoad0 = 0x081 ,
23
+ opcodeLoad1 = 0x481 ,
24
+ opcodeLoadind = 0x082 ,
25
+ opcodeStoreind = 0x181 ,
26
+ opcodeShl = 0x105 ,
27
+ opcodeShr = 0x106 ,
28
+ opcodeSar = 0x107 ,
29
+ opcodeFence = 0x001
30
30
};
31
31
32
32
struct MiMath : public AUBFixture , public ::testing::Test {
@@ -100,7 +100,7 @@ struct MiMath : public AUBFixture, public ::testing::Test {
100
100
pAluParam->DW0 .BitField .Operand1 = static_cast <uint32_t >(AluRegisters::R_SRCB);
101
101
pAluParam->DW0 .BitField .Operand2 = shiftReg;
102
102
pAluParam++;
103
- pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::OPCODE_SHL ); // shift high part
103
+ pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::opcodeShl ); // shift high part
104
104
pAluParam->DW0 .BitField .Operand1 = 0 ;
105
105
pAluParam->DW0 .BitField .Operand2 = 0 ;
106
106
pAluParam++;
@@ -158,15 +158,15 @@ HWTEST2_F(MiMath, givenLoadIndirectFromMemoryWhenUseMiMathToSimpleOperationThenS
158
158
reinterpret_cast <MI_MATH *>(pCmd)->DW0 .BitField .DwordLength = numberOfOperationToLoadAddressToMiMathAccu + 13 - 1 ;
159
159
loadAddressToMiMathAccu<FamilyType>(static_cast <uint32_t >(AluRegisters::R_0), static_cast <uint32_t >(AluRegisters::R_1), static_cast <uint32_t >(AluRegisters::R_2)); // GPU address of buffer load to ACCU register
160
160
MI_MATH_ALU_INST_INLINE *pAluParam = reinterpret_cast <MI_MATH_ALU_INST_INLINE *>(taskStream->getSpace (13 * sizeof (MI_MATH_ALU_INST_INLINE)));
161
- pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::OPCODE_FENCE ); // to be sure that all writes and reads are completed
161
+ pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::opcodeFence ); // to be sure that all writes and reads are completed
162
162
pAluParam->DW0 .BitField .Operand1 = 0 ;
163
163
pAluParam->DW0 .BitField .Operand2 = 0 ;
164
164
pAluParam++;
165
- pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::OPCODE_LOADIND ); // load dword from memory address located in ACCU
165
+ pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::opcodeLoadind ); // load dword from memory address located in ACCU
166
166
pAluParam->DW0 .BitField .Operand1 = static_cast <uint32_t >(AluRegisters::R_0);
167
167
pAluParam->DW0 .BitField .Operand2 = static_cast <uint32_t >(AluRegisters::R_ACCU);
168
168
pAluParam++;
169
- pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::OPCODE_FENCE ); // to be sure that all writes and reads are completed
169
+ pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::opcodeFence ); // to be sure that all writes and reads are completed
170
170
pAluParam->DW0 .BitField .Operand1 = 0 ;
171
171
pAluParam->DW0 .BitField .Operand2 = 0 ;
172
172
pAluParam++;
@@ -194,19 +194,19 @@ HWTEST2_F(MiMath, givenLoadIndirectFromMemoryWhenUseMiMathToSimpleOperationThenS
194
194
pAluParam->DW0 .BitField .Operand1 = static_cast <uint32_t >(AluRegisters::R_SRCA);
195
195
pAluParam->DW0 .BitField .Operand2 = static_cast <uint32_t >(AluRegisters::R_2);
196
196
pAluParam++;
197
- pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::OPCODE_LOAD0 );
197
+ pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::opcodeLoad0 );
198
198
pAluParam->DW0 .BitField .Operand1 = static_cast <uint32_t >(AluRegisters::R_SRCB);
199
199
pAluParam->DW0 .BitField .Operand2 = 0 ;
200
200
pAluParam++;
201
201
pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(AluRegisters::OPCODE_ADD); // move address to ACCU
202
202
pAluParam->DW0 .BitField .Operand1 = 0 ;
203
203
pAluParam->DW0 .BitField .Operand2 = 0 ;
204
204
pAluParam++;
205
- pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::OPCODE_FENCE ); // to be sure that all writes and reads are completed
205
+ pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::opcodeFence ); // to be sure that all writes and reads are completed
206
206
pAluParam->DW0 .BitField .Operand1 = 0 ;
207
207
pAluParam->DW0 .BitField .Operand2 = 0 ;
208
208
pAluParam++;
209
- pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::OPCODE_STOREIND ); // store to memory from ACCU, value from register R1
209
+ pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::opcodeStoreind ); // store to memory from ACCU, value from register R1
210
210
pAluParam->DW0 .BitField .Operand1 = static_cast <uint32_t >(AluRegisters::R_ACCU);
211
211
pAluParam->DW0 .BitField .Operand2 = static_cast <uint32_t >(AluRegisters::R_1);
212
212
@@ -248,30 +248,30 @@ HWTEST2_F(MiMath, givenLoadIndirectFromMemoryWhenUseMiMathThenStoreIndirectToAno
248
248
loadAddressToMiMathAccu<FamilyType>(static_cast <uint32_t >(AluRegisters::R_0), static_cast <uint32_t >(AluRegisters::R_1), static_cast <uint32_t >(AluRegisters::R_2)); // GPU address of buffer load to ACCU register
249
249
250
250
MI_MATH_ALU_INST_INLINE *pAluParam = reinterpret_cast <MI_MATH_ALU_INST_INLINE *>(taskStream->getSpace (3 * sizeof (MI_MATH_ALU_INST_INLINE)));
251
- pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::OPCODE_FENCE ); // to be sure that all writes and reads are completed
251
+ pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::opcodeFence ); // to be sure that all writes and reads are completed
252
252
pAluParam->DW0 .BitField .Operand1 = 0 ;
253
253
pAluParam->DW0 .BitField .Operand2 = 0 ;
254
254
pAluParam++;
255
- pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::OPCODE_LOADIND ); // load dword from memory address located in ACCU to R0
255
+ pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::opcodeLoadind ); // load dword from memory address located in ACCU to R0
256
256
pAluParam->DW0 .BitField .Operand1 = static_cast <uint32_t >(AluRegisters::R_0);
257
257
pAluParam->DW0 .BitField .Operand2 = static_cast <uint32_t >(AluRegisters::R_ACCU);
258
258
pAluParam++;
259
- pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::OPCODE_FENCE ); // to be sure that all writes and reads are completed
259
+ pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::opcodeFence ); // to be sure that all writes and reads are completed
260
260
pAluParam->DW0 .BitField .Operand1 = 0 ;
261
261
pAluParam->DW0 .BitField .Operand2 = 0 ;
262
262
263
263
loadAddressToMiMathAccu<FamilyType>(static_cast <uint32_t >(AluRegisters::R_3), static_cast <uint32_t >(AluRegisters::R_4), static_cast <uint32_t >(AluRegisters::R_2)); // GPU address of bufferB load to ACCU register
264
264
265
265
pAluParam = reinterpret_cast <MI_MATH_ALU_INST_INLINE *>(taskStream->getSpace (3 * sizeof (MI_MATH_ALU_INST_INLINE)));
266
- pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::OPCODE_FENCE ); // to be sure that all writes and reads are completed
266
+ pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::opcodeFence ); // to be sure that all writes and reads are completed
267
267
pAluParam->DW0 .BitField .Operand1 = 0 ;
268
268
pAluParam->DW0 .BitField .Operand2 = 0 ;
269
269
pAluParam++;
270
- pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::OPCODE_STOREIND ); // store to memory from ACCU, value from register R0
270
+ pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::opcodeStoreind ); // store to memory from ACCU, value from register R0
271
271
pAluParam->DW0 .BitField .Operand1 = static_cast <uint32_t >(AluRegisters::R_ACCU);
272
272
pAluParam->DW0 .BitField .Operand2 = static_cast <uint32_t >(AluRegisters::R_0);
273
273
pAluParam++;
274
- pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::OPCODE_FENCE ); // to be sure that all writes and reads are completed
274
+ pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::opcodeFence ); // to be sure that all writes and reads are completed
275
275
pAluParam->DW0 .BitField .Operand1 = 0 ;
276
276
pAluParam->DW0 .BitField .Operand2 = 0 ;
277
277
@@ -317,7 +317,7 @@ HWTEST2_F(MiMath, givenValueToMakeLeftLogicalShiftWhenUseMiMathThenShiftIsDonePr
317
317
pAluParam->DW0 .BitField .Operand1 = static_cast <uint32_t >(AluRegisters::R_SRCB);
318
318
pAluParam->DW0 .BitField .Operand2 = static_cast <uint32_t >(AluRegisters::R_1);
319
319
pAluParam++;
320
- pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::OPCODE_SHL ); // load value to shift to SRCB
320
+ pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::opcodeShl ); // load value to shift to SRCB
321
321
pAluParam->DW0 .BitField .Operand1 = 0 ;
322
322
pAluParam->DW0 .BitField .Operand2 = 0 ;
323
323
pAluParam++;
@@ -329,7 +329,7 @@ HWTEST2_F(MiMath, givenValueToMakeLeftLogicalShiftWhenUseMiMathThenShiftIsDonePr
329
329
pAluParam->DW0 .BitField .Operand1 = static_cast <uint32_t >(AluRegisters::R_SRCB);
330
330
pAluParam->DW0 .BitField .Operand2 = static_cast <uint32_t >(AluRegisters::R_2);
331
331
pAluParam++;
332
- pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::OPCODE_SHL ); // load value to shift to SRCB
332
+ pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::opcodeShl ); // load value to shift to SRCB
333
333
pAluParam->DW0 .BitField .Operand1 = 0 ;
334
334
pAluParam->DW0 .BitField .Operand2 = 0 ;
335
335
pAluParam++;
@@ -388,7 +388,7 @@ HWTEST2_F(MiMath, givenValueToMakeRightLogicalShiftWhenUseMiMathThenShiftIsDoneP
388
388
pAluParam->DW0 .BitField .Operand1 = static_cast <uint32_t >(AluRegisters::R_SRCB);
389
389
pAluParam->DW0 .BitField .Operand2 = static_cast <uint32_t >(AluRegisters::R_1);
390
390
pAluParam++;
391
- pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::OPCODE_SHR ); // load value to shift to SRCB
391
+ pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::opcodeShr ); // load value to shift to SRCB
392
392
pAluParam->DW0 .BitField .Operand1 = 0 ;
393
393
pAluParam->DW0 .BitField .Operand2 = 0 ;
394
394
pAluParam++;
@@ -400,7 +400,7 @@ HWTEST2_F(MiMath, givenValueToMakeRightLogicalShiftWhenUseMiMathThenShiftIsDoneP
400
400
pAluParam->DW0 .BitField .Operand1 = static_cast <uint32_t >(AluRegisters::R_SRCB);
401
401
pAluParam->DW0 .BitField .Operand2 = static_cast <uint32_t >(AluRegisters::R_2);
402
402
pAluParam++;
403
- pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::OPCODE_SHR ); // load value to shift to SRCB
403
+ pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::opcodeShr ); // load value to shift to SRCB
404
404
pAluParam->DW0 .BitField .Operand1 = 0 ;
405
405
pAluParam->DW0 .BitField .Operand2 = 0 ;
406
406
pAluParam++;
@@ -452,11 +452,11 @@ HWTEST2_F(MiMath, givenValueToMakeRightAritmeticShiftWhenUseMiMathThenShiftIsDon
452
452
reinterpret_cast <MI_MATH *>(pCmd)->DW0 .BitField .DwordLength = numberOfOperationToLoadAddressToMiMathAccu + 9 - 1 ;
453
453
loadAddressToMiMathAccu<FamilyType>(static_cast <uint32_t >(AluRegisters::R_0), static_cast <uint32_t >(AluRegisters::R_1), static_cast <uint32_t >(AluRegisters::R_2)); // GPU address of buffer load to ACCU register
454
454
MI_MATH_ALU_INST_INLINE *pAluParam = reinterpret_cast <MI_MATH_ALU_INST_INLINE *>(taskStream->getSpace (9 * sizeof (MI_MATH_ALU_INST_INLINE)));
455
- pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::OPCODE_LOADIND ); // load value from R0 to SRCA
455
+ pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::opcodeLoadind ); // load value from R0 to SRCA
456
456
pAluParam->DW0 .BitField .Operand1 = static_cast <uint32_t >(AluRegisters::R_3);
457
457
pAluParam->DW0 .BitField .Operand2 = static_cast <uint32_t >(AluRegisters::R_ACCU);
458
458
pAluParam++;
459
- pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::OPCODE_FENCE ); // to be sure that all writes and reads are completed
459
+ pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::opcodeFence ); // to be sure that all writes and reads are completed
460
460
pAluParam->DW0 .BitField .Operand1 = 0 ;
461
461
pAluParam->DW0 .BitField .Operand2 = 0 ;
462
462
pAluParam++;
@@ -468,7 +468,7 @@ HWTEST2_F(MiMath, givenValueToMakeRightAritmeticShiftWhenUseMiMathThenShiftIsDon
468
468
pAluParam->DW0 .BitField .Operand1 = static_cast <uint32_t >(AluRegisters::R_SRCB);
469
469
pAluParam->DW0 .BitField .Operand2 = static_cast <uint32_t >(AluRegisters::R_4);
470
470
pAluParam++;
471
- pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::OPCODE_SAR ); // load value to shift to SRCB
471
+ pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::opcodeSar ); // load value to shift to SRCB
472
472
pAluParam->DW0 .BitField .Operand1 = 0 ;
473
473
pAluParam->DW0 .BitField .Operand2 = 0 ;
474
474
pAluParam++;
@@ -480,7 +480,7 @@ HWTEST2_F(MiMath, givenValueToMakeRightAritmeticShiftWhenUseMiMathThenShiftIsDon
480
480
pAluParam->DW0 .BitField .Operand1 = static_cast <uint32_t >(AluRegisters::R_SRCB);
481
481
pAluParam->DW0 .BitField .Operand2 = static_cast <uint32_t >(AluRegisters::R_5);
482
482
pAluParam++;
483
- pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::OPCODE_SAR ); // load value to shift to SRCB
483
+ pAluParam->DW0 .BitField .ALUOpcode = static_cast <uint32_t >(NewAluOpcodes::opcodeSar ); // load value to shift to SRCB
484
484
pAluParam->DW0 .BitField .Operand1 = 0 ;
485
485
pAluParam->DW0 .BitField .Operand2 = 0 ;
486
486
pAluParam++;
0 commit comments