Skip to content

Commit 1da27e3

Browse files
DianaChensys_zuul
authored andcommitted
IGA: added Operand setter
Change-Id: I9b62f480cc93caa9d2fcfadd3d2e38ca2fc86893
1 parent 0abb7e2 commit 1da27e3

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

visa/iga/GEDLibrary/GED_external/Source/common/version.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2424
2525
======================= end_copyright_notice ==================================*/
2626

27-
const char* gedVersion = "0.37 (8a8db73d)";
27+
const char* gedVersion = "0.39 (a173b84)";

visa/iga/GEDLibrary/GED_external/Source/ged/xcoder/ged_ins.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3232
#include "common/ged_string_utils.h"
3333
#include "xcoder/ged_ins.h"
3434

35-
#include "common/secure_mem.h"
36-
3735
using std::setw;
3836
using std::setfill;
3937
using std::hex;
@@ -49,6 +47,14 @@ using std::left;
4947
using std::stringstream;
5048
#endif
5149

50+
#ifdef _WIN32
51+
# define MEMCPY(D,S,N) memcpy_s(D,N,S,N)
52+
#else
53+
using std::memcpy;
54+
# define MEMCPY(D,S,N) memcpy(D,S,N)
55+
#endif
56+
57+
5258
/*************************************************************************************************
5359
* class GEDIns static data members
5460
*************************************************************************************************/
@@ -236,7 +242,7 @@ GED_RETURN_VALUE GEDIns::Encode(const GED_INS_TYPE insType, unsigned char* rawBy
236242
GEDASSERT(IsCompactValid());
237243
if (NULL != rawBytes)
238244
{
239-
memcpy_s(rawBytes, GED_COMPACT_INS_SIZE, _compactBytes, GED_COMPACT_INS_SIZE); // copy the compact instruction bytes
245+
MEMCPY(rawBytes, _compactBytes, GED_COMPACT_INS_SIZE); // copy the compact instruction bytes
240246
}
241247
}
242248
else // retrieve the native instruction bytes
@@ -255,7 +261,7 @@ GED_RETURN_VALUE GEDIns::Encode(const GED_INS_TYPE insType, unsigned char* rawBy
255261
GEDASSERT(IsNativeValid());
256262
if (NULL != rawBytes)
257263
{
258-
memcpy_s(rawBytes, GED_NATIVE_INS_SIZE, _nativeBytes, GED_NATIVE_INS_SIZE); // copy the native instruction bytes
264+
MEMCPY(rawBytes, _nativeBytes, GED_NATIVE_INS_SIZE); // copy the native instruction bytes
259265
}
260266
}
261267
return ret;
@@ -524,7 +530,7 @@ void GEDIns::SetInstructionBytes(unsigned char* dst, const unsigned char* src, u
524530
{
525531
size = maxSize; // given buffer is too large, ignore the rest of the bytes.
526532
}
527-
memcpy_s(dst, size, src, size);
533+
MEMCPY(dst, src, size);
528534
}
529535

530536

@@ -1096,7 +1102,7 @@ bool GEDIns::BuildAllCompactedFormats(unsigned char* compactBytesArray, const un
10961102
return true;
10971103

10981104
// Set an arbitrary valid encoding into the instruction's compact bytes.
1099-
memcpy_s(_compactBytes, GED_COMPACT_INS_SIZE, compactBytesArray, GED_COMPACT_INS_SIZE);
1105+
MEMCPY(_compactBytes, compactBytesArray, GED_COMPACT_INS_SIZE);
11001106
SetCompactValid();
11011107
return true;
11021108
}

visa/iga/IGALibrary/Backend/GED/Decoder.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1404,12 +1404,13 @@ Instruction *DecoderBase::decodeSyncInstruction(Kernel &kernel)
14041404
decodeMaskCtrl(),
14051405
fri.modifier);
14061406
GED_REG_FILE regFile = decodeSrcRegFile<SourceIndex::SRC0>();
1407+
14071408
if (regFile == GED_REG_FILE_ARF) {
14081409
// e.g.
14091410
// sync.nop null
14101411
// sync.allrd null
14111412
// ...
1412-
inst->setSource(SourceIndex::SRC0, Operand::SRC_REG_NULL_UB);
1413+
inst->setSource(SourceIndex::SRC0, Operand::SRC_REG_NULL_UB);
14131414
} else {
14141415
// e.g.
14151416
// sync.allrd 0x15

visa/iga/IGALibrary/IR/Operand.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,12 @@ class Operand {
187187
void setRegion(const Region &rgn) { m_regOpRgn = rgn; }
188188
// sets the operand type
189189
void setType(Type type) { m_type = type; }
190+
// set the operand reg RegRef directly
191+
void setRegRef(const RegRef& regRef)
192+
{
193+
m_regOpReg.regNum = regRef.regNum;
194+
m_regOpReg.subRegNum = regRef.subRegNum;
195+
}
190196

191197
private:
192198
Operand::Kind m_kind;

0 commit comments

Comments
 (0)