NVlabs / NVBit

220 stars 20 forks source link

Is there a SASS inst with more than one memory ref? #21

Closed mkhairy closed 4 years ago

mkhairy commented 4 years ago

Hello,

When I took a look at the mem_trace tool example that comes with v1.4. It seems like you are handling more than one memory reference per inst, as shown below. My question, is there case ever happen you can have more than one memory reference per instruction? A second question, do you handle TEX memory reference?

            if (op->type == Instr::operandType::MREF) {
                /* insert call to the instrumentation function with its
                 * arguments */
                nvbit_insert_call(instr, "instrument_mem", IPOINT_BEFORE);
                /* predicate value */
                nvbit_add_call_arg_pred_val(instr);
                /* opcode id */
                nvbit_add_call_arg_const_val32(instr, opcode_id);
                /* memory reference 64 bit address */
                nvbit_add_call_arg_mref_addr64(instr, mref_idx);
                /* add pointer to channel_dev*/
                nvbit_add_call_arg_const_val64(instr,
                                               (uint64_t)&channel_dev);
                mref_idx++;
            }
x-y-z commented 4 years ago

See LDGSTS instruction in: https://docs.nvidia.com/cuda/cuda-binary-utilities/index.html

mkhairy commented 4 years ago

ok, I got it. Thanks!