@@ -1509,18 +1509,18 @@ multiclass MIMG_Gather <mimgopc op, AMDGPUSampleVariant sample, bit wqm = 0,
15091509multiclass MIMG_Gather_WQM <mimgopc op, AMDGPUSampleVariant sample>
15101510 : MIMG_Gather<op, sample, 1>;
15111511
1512- class MIMG_IntersectRay_Helper<bit Is64, bit IsA16, bit isDual> {
1513- int num_addrs = !if(Is64, !if(IsA16, 9, 12), !if(IsA16, 8, 11));
1512+ class MIMG_IntersectRay_Helper<bit Is64, bit IsA16, bit isDual, bit isBVH8 > {
1513+ int num_addrs = !if(isBVH8, 11, !if( Is64, !if(IsA16, 9, 12), !if(IsA16, 8, 11) ));
15141514 RegisterClass RegClass = MIMGAddrSize<num_addrs, 0>.RegClass;
15151515 int VAddrDwords = !srl(RegClass.Size, 5);
15161516
15171517 int GFX11PlusNSAAddrs = !if(IsA16, 4, 5);
15181518 RegisterClass node_ptr_type = !if(Is64, VReg_64, VGPR_32);
15191519 list<RegisterClass> GFX11PlusAddrTypes =
1520- !if(isDual, [VReg_64 , VReg_64, VReg_96, VReg_96, VReg_64 ],
1521- !if(IsA16 ,
1522- [node_ptr_type, VGPR_32, VReg_96, VReg_96],
1523- [node_ptr_type, VGPR_32, VReg_96, VReg_96, VReg_96]) );
1520+ !cond(isBVH8 : [node_ptr_type , VReg_64, VReg_96, VReg_96, VGPR_32 ],
1521+ isDual : [node_ptr_type, VReg_64, VReg_96, VReg_96, VReg_64] ,
1522+ IsA16 : [node_ptr_type, VGPR_32, VReg_96, VReg_96],
1523+ true : [node_ptr_type, VGPR_32, VReg_96, VReg_96, VReg_96]);
15241524}
15251525
15261526class MIMG_IntersectRay_gfx10<mimgopc op, string opcode, RegisterClass AddrRC>
@@ -1554,26 +1554,26 @@ class MIMG_IntersectRay_nsa_gfx11<mimgopc op, string opcode, int num_addrs,
15541554}
15551555
15561556class VIMAGE_IntersectRay_gfx12<mimgopc op, string opcode, int num_addrs,
1557- bit isDual,
1557+ bit isDual, bit isBVH8,
15581558 list<RegisterClass> addr_types>
1559- : VIMAGE_gfx12<op.GFX12, !if(isDual,
1559+ : VIMAGE_gfx12<op.GFX12, !if(!or( isDual, isBVH8) ,
15601560 (outs VReg_320:$vdata, VReg_96:$ray_origin_out,
15611561 VReg_96:$ray_dir_out),
15621562 (outs VReg_128:$vdata)),
15631563 num_addrs, "GFX12", addr_types> {
1564- let Constraints = !if(isDual,
1564+ let Constraints = !if(!or( isDual, isBVH8) ,
15651565 "$ray_origin_out = $vaddr2, $ray_dir_out = $vaddr3", "");
15661566 let InOperandList = !con(nsah.AddrIns, (ins SReg_128_XNULL:$rsrc),
1567- !if(isDual, (ins), (ins A16:$a16)));
1567+ !if(!or( isDual, isBVH8) , (ins), (ins A16:$a16)));
15681568 let AsmString = opcode#" $vdata, "#nsah.AddrAsm#", $rsrc"#
1569- !if(isDual, "", "$a16");
1570- let SchedRW = !if(isDual,
1569+ !if(!or( isDual, isBVH8) , "", "$a16");
1570+ let SchedRW = !if(!or( isDual, isBVH8) ,
15711571 [WriteVMEM, WriteVMEM, WriteVMEM], [WriteVMEM]);
15721572}
15731573
15741574multiclass MIMG_IntersectRay<mimgopc op, string opcode, bit Is64, bit IsA16,
1575- bit isDual> {
1576- defvar info = MIMG_IntersectRay_Helper<Is64, IsA16, isDual>;
1575+ bit isDual, bit isBVH8 = 0 > {
1576+ defvar info = MIMG_IntersectRay_Helper<Is64, IsA16, isDual, isBVH8 >;
15771577 def "" : MIMGBaseOpcode {
15781578 let BVH = 1;
15791579 let A16 = IsA16;
@@ -1611,8 +1611,9 @@ multiclass MIMG_IntersectRay<mimgopc op, string opcode, bit Is64, bit IsA16,
16111611 }
16121612 }
16131613 def _gfx12 : VIMAGE_IntersectRay_gfx12<op, opcode, info.GFX11PlusNSAAddrs,
1614- isDual, info.GFX11PlusAddrTypes> {
1615- let VDataDwords = !if(isDual, 10, 4);
1614+ isDual, isBVH8,
1615+ info.GFX11PlusAddrTypes> {
1616+ let VDataDwords = !if(!or(isDual, isBVH8), 10, 4);
16161617 let VAddrDwords = info.num_addrs;
16171618 }
16181619 }
@@ -1791,11 +1792,13 @@ defm IMAGE_BVH64_INTERSECT_RAY_a16 : MIMG_IntersectRay<mimgopc<0x1a, 0x1a, 0xe7>
17911792} // End OtherPredicates = [HasImageInsts, HasGFX10_AEncoding]
17921793
17931794defm IMAGE_BVH_DUAL_INTERSECT_RAY : MIMG_IntersectRay<mimgopc<0x80, MIMG.NOP, MIMG.NOP>, "image_bvh_dual_intersect_ray", 1, 0, 1>;
1795+ defm IMAGE_BVH8_INTERSECT_RAY : MIMG_IntersectRay<mimgopc<0x81, MIMG.NOP, MIMG.NOP>, "image_bvh8_intersect_ray", 1, 0, 0, 1>;
17941796
17951797let SubtargetPredicate = isGFX12Plus in {
17961798 def : AMDGPUMnemonicAlias<"bvh_intersect_ray", "image_bvh_intersect_ray">;
17971799 def : AMDGPUMnemonicAlias<"bvh64_intersect_ray", "image_bvh64_intersect_ray">;
17981800 def : AMDGPUMnemonicAlias<"bvh_dual_intersect_ray", "image_bvh_dual_intersect_ray">;
1801+ def : AMDGPUMnemonicAlias<"bvh8_intersect_ray", "image_bvh8_intersect_ray">;
17991802}
18001803
18011804} // End let OtherPredicates = [HasImageInsts]
0 commit comments