load value into upper/lower part of a register

9 Views Asked by At

Is there a way to load a value directly into the upper/lower part of a register?

 .version 7.5
 .target sm_86
 .address_size 64
 .visible .entry function(
     .param .u64 data0,
 )
 {
     .reg            .u64 %dat_u64;
     .reg            .b32 %val_b32;

     ld.param.u64    %dat_u64, [data0+0];
     ld.global.b16   %val_b32.LOW [data0];
     // val_b32 is now {0000, [data0]}
     ld.global.b16   %val_b32.HIGH [data0+150];
     // val_b32 is now {[data0+150], [data0]}
     ret
}
 

one thing I could do is load into two b16 registers and then combine them into a b32 register

mov.b32 %val_b32, {%val_b16_0, %val_b16_1};

but that introduces an additional mov operation

0

There are 0 best solutions below