From 71f96a67578ce1ccb56e045b7913913073a5d42e Mon Sep 17 00:00:00 2001 From: Yang Rong Date: Wed, 28 May 2014 15:37:49 +0800 Subject: [PATCH] Silence compilation warnings when release build. Also silence warnings in 32bit system. Signed-off-by: Yang Rong Reviewed-by: Zhigang Gong --- backend/src/backend/gen_encoder.cpp | 3 +-- backend/src/backend/gen_insn_selection.cpp | 3 +-- backend/src/backend/program.cpp | 2 +- src/performance.c | 10 +++++----- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/backend/src/backend/gen_encoder.cpp b/backend/src/backend/gen_encoder.cpp index eadd94f..038d14b 100644 --- a/backend/src/backend/gen_encoder.cpp +++ b/backend/src/backend/gen_encoder.cpp @@ -1101,6 +1101,7 @@ namespace gbe void GenEncoder::patchJMPI(uint32_t insnID, int32_t jumpDistance) { GenNativeInstruction &insn = *(GenNativeInstruction *)&this->store[insnID]; + GenNativeInstruction &insn2 = *(GenNativeInstruction *)&this->store[insnID+2]; GBE_ASSERT(insnID < this->store.size()); GBE_ASSERT(insn.header.opcode == GEN_OPCODE_JMPI || insn.header.opcode == GEN_OPCODE_BRD || @@ -1129,7 +1130,6 @@ namespace gbe // for all the branching instruction. And need to adjust the distance // for those branch instruction's start point and end point contains // this instruction. - GenNativeInstruction &insn2 = *(GenNativeInstruction *)&this->store[insnID+2]; GBE_ASSERT(insn2.header.opcode == GEN_OPCODE_NOP); insn.header.opcode = GEN_OPCODE_ADD; this->setDst(&insn, GenRegister::ip()); @@ -1138,7 +1138,6 @@ namespace gbe } else { insn.header.predicate_inverse ^= 1; this->setSrc1(&insn, GenRegister::immd(2)); - GenNativeInstruction &insn2 = *(GenNativeInstruction *)&this->store[insnID+2]; GBE_ASSERT(insn2.header.opcode == GEN_OPCODE_NOP); GBE_ASSERT(insnID < this->store.size()); insn2.header.predicate_control = GEN_PREDICATE_NONE; diff --git a/backend/src/backend/gen_insn_selection.cpp b/backend/src/backend/gen_insn_selection.cpp index cb86e34..cf0af9d 100644 --- a/backend/src/backend/gen_insn_selection.cpp +++ b/backend/src/backend/gen_insn_selection.cpp @@ -2702,9 +2702,8 @@ namespace gbe uint32_t bti) const { using namespace ir; - const uint32_t valueNum = insn.getValueNum(); const uint32_t simdWidth = sel.isScalarReg(insn.getValue(0)) ? 1 : sel.ctx.getSimdWidth(); - GBE_ASSERT(valueNum == 1); + GBE_ASSERT(insn.getValueNum() == 1); GenRegister dst = GenRegister::retype(sel.selReg(insn.getValue(0)), GEN_TYPE_F); // get dword based address GenRegister addrDW = GenRegister::udxgrf(simdWidth, sel.reg(FAMILY_DWORD, simdWidth == 1)); diff --git a/backend/src/backend/program.cpp b/backend/src/backend/program.cpp index 121e237..ea36f28 100644 --- a/backend/src/backend/program.cpp +++ b/backend/src/backend/program.cpp @@ -643,7 +643,7 @@ namespace gbe { while (getline(idirs, pcmFileName, ':')) { if(access(pcmFileName.c_str(), R_OK) == 0) { - findPcm = true; + findPcm |= true; break; } } diff --git a/src/performance.c b/src/performance.c index 5248bb7..a785460 100644 --- a/src/performance.c +++ b/src/performance.c @@ -20,7 +20,7 @@ typedef struct kernel_storage_node typedef struct context_storage_node { - uint64_t context_id; + uintptr_t context_id; kernel_storage_node *kernels_storage; char max_time_kernel_name[MAX_KERNEL_NAME_LENGTH]; float kernel_max_time; @@ -46,14 +46,14 @@ static context_storage_node * find_context(cl_context context) { if(NULL != prev_context_pointer ) { - if(prev_context_pointer->context_id == (uint64_t)context) + if(prev_context_pointer->context_id == (uintptr_t)context) return prev_context_pointer; } if(NULL == record.context_storage) { record.context_storage = (context_storage_node *) malloc(sizeof(context_storage_node)); - record.context_storage->context_id = (uint64_t)context; + record.context_storage->context_id = (uintptr_t)context; record.context_storage->kernels_storage = NULL; record.context_storage->kernel_max_time = 0.0f; record.context_storage->next = NULL; @@ -63,7 +63,7 @@ static context_storage_node * find_context(cl_context context) context_storage_node *pre = record.context_storage; context_storage_node *cur = record.context_storage; - while(NULL !=cur && (uint64_t)context != cur->context_id ) + while(NULL !=cur && (uintptr_t)context != cur->context_id ) { pre = cur; cur = cur->next; @@ -73,7 +73,7 @@ static context_storage_node * find_context(cl_context context) pre->next = (context_storage_node *)malloc(sizeof(context_storage_node)); pre = pre->next; - pre->context_id = (uint64_t)context; + pre->context_id = (uintptr_t)context; pre->kernels_storage = NULL; pre->kernel_max_time = 0.0f; pre->next = NULL; -- 2.7.4