summaryrefslogtreecommitdiff
path: root/src/cuda-sim
diff options
context:
space:
mode:
authorJRPan <[email protected]>2024-08-16 11:16:06 -0400
committerGitHub <[email protected]>2024-08-16 15:16:06 +0000
commit42a0cde4b463794d041b544309afb69c315f78bc (patch)
treeacc2196fb5157f7167de0318bb3aa1a20a7f70af /src/cuda-sim
parent081da0abacbc3595b090094b1a66fc37d35bd82a (diff)
remove unused & unintilized variables & format automation (#69)
* run formatter only on PR * remove unused & unintilized variables * fix signed & unsigned comparison warning * enable merge queue * resolve conflict * in formatter, checkout the forked repo, not the base repo in PR * Try to use jenkins for formatter * Automated Format --------- Co-authored-by: purdue-jenkins <[email protected]>
Diffstat (limited to 'src/cuda-sim')
-rw-r--r--src/cuda-sim/instructions.cc16
-rw-r--r--src/cuda-sim/ptx_ir.h2
2 files changed, 9 insertions, 9 deletions
diff --git a/src/cuda-sim/instructions.cc b/src/cuda-sim/instructions.cc
index 2314bef..108de97 100644
--- a/src/cuda-sim/instructions.cc
+++ b/src/cuda-sim/instructions.cc
@@ -5442,33 +5442,33 @@ void shfl_impl(const ptx_instruction *pI, core_t *core, warp_inst_t inst) {
}
void shf_impl(const ptx_instruction *pI, ptx_thread_info *thread) {
- ptx_reg_t a,b,c,d;
+ ptx_reg_t a, b, c, d;
const operand_info &dst = pI->dst();
const operand_info &src1 = pI->src1();
const operand_info &src2 = pI->src2();
const operand_info &src3 = pI->src3();
- // Only b32 is allowed
+ // Only b32 is allowed
unsigned i_type = pI->get_type();
a = thread->get_operand_value(src1, dst, i_type, thread, 1);
b = thread->get_operand_value(src2, dst, i_type, thread, 1);
c = thread->get_operand_value(src3, dst, i_type, thread, 1);
- if(i_type != B32_TYPE)
+ if (i_type != B32_TYPE)
printf("Only the b32 data_type is allowed per the ISA\n");
unsigned clamp_mode = pI->clamp_mode();
unsigned n = c.u32 & 0x1f;
- if(clamp_mode) {
- if(c.u32 < 32)
+ if (clamp_mode) {
+ if (c.u32 < 32)
n = c;
else
n = 32;
}
- if(pI->left_mode())
- d.u32 = (b.u32 << n) | (a.u32 >> (32-n));
+ if (pI->left_mode())
+ d.u32 = (b.u32 << n) | (a.u32 >> (32 - n));
else
- d.u32 = (b.u32 << (32-n)) | (a.u32 >> n);
+ d.u32 = (b.u32 << (32 - n)) | (a.u32 >> n);
thread->set_operand_value(dst, d, i_type, thread, pI);
}
diff --git a/src/cuda-sim/ptx_ir.h b/src/cuda-sim/ptx_ir.h
index 46f183b..d253866 100644
--- a/src/cuda-sim/ptx_ir.h
+++ b/src/cuda-sim/ptx_ir.h
@@ -1085,7 +1085,7 @@ class ptx_instruction : public warp_inst_t {
unsigned cache_option() const { return m_cache_option; }
unsigned rounding_mode() const { return m_rounding_mode; }
unsigned saturation_mode() const { return m_saturation_mode; }
- unsigned clamp_mode() const {return m_clamp_mode;}
+ unsigned clamp_mode() const { return m_clamp_mode; }
unsigned left_mode() const { return m_left_mode; }
unsigned dimension() const { return m_geom_spec; }
unsigned barrier_op() const { return m_barrier_op; }