[llvm] [NVPTX] Make i16x2 a native type and add supported vec instructions (PR #65799)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 8 16:07:33 PDT 2023


================
@@ -497,6 +497,20 @@ define i32 @test_bitcast_2xi16_to_i32(<2 x i16> %a) #0 {
   ret i32 %r
 }
 
+; COMMON-LABEL: test_bitcast_2xi16_to_2xhalf(
+; COMMON: ld.param.u16 	[[RS1:%rs[0-9]+]], [test_bitcast_2xi16_to_2xhalf_param_0];
+; COMMON:	mov.u16 	[[RS2:%rs[0-9]+]], 5;
+; COMMON:	mov.b32 	[[R:%r[0-9]+]], {[[RS1]], [[RS2]]};
+; COMMON: st.param.b32 	[func_retval0+0], [[R]];
+; COMMON: ret;
+define <2 x half> @test_bitcast_2xi16_to_2xhalf(i16 %a) #0 {
+  %ins.0 = insertelement <2 x i16> undef, i16 %a, i32 0
----------------
ThomasRaoux wrote:

> I think we need similar constructs in the other bitcast tests, as the bitcast would otherwise just dropped.
> 
> I wonder if there's a better way to make sure we do end up lowering specifically `bitcast`.

good point, let me send another PR for those

https://github.com/llvm/llvm-project/pull/65799


More information about the llvm-commits mailing list