diff --git a/src/gfx1013_direct_mesh.inl b/src/gfx1013_direct_mesh.inl index abc97056b8..ed9c7c6853 100644 --- a/src/gfx1013_direct_mesh.inl +++ b/src/gfx1013_direct_mesh.inl @@ -2100,8 +2100,8 @@ NativeComputeShader lower_mesh(const string &code, const MeshStageLayout &layout i.name=="v_mad_f32" || i.name=="v_mul_lo_u32" || i.name=="v_mul_hi_u32" || i.name=="v_mac_f32" || i.name=="v_mul_legacy_f32" || i.name=="v_sub_f32" || i.name=="v_subrev_f32" || i.name=="v_fmac_f32" || i.name=="v_fmaak_f32" || - i.name=="v_rsq_f32" || i.name=="v_rcp_f32" || i.name=="v_sqrt_f32" || - i.name=="v_fma_mixlo_f16" || i.name=="v_fma_mixhi_f16" || i.name=="v_fma_mix_f32" || i.name=="v_pack_b32_f16" || + i.name=="v_rsq_f32" || i.name=="v_rcp_f32" || i.name=="v_rcp_iflag_f32" || i.name=="v_sqrt_f32" || + i.name=="v_ashrrev_i32" || i.name=="v_fma_mixlo_f16" || i.name=="v_fma_mixhi_f16" || i.name=="v_fma_mix_f32" || i.name=="v_pack_b32_f16" || i.name=="v_sin_f32" || i.name=="v_cos_f32" || i.name.substr(0,15)=="v_cvt_f32_ubyte" || i.name=="v_min_u32" || i.name=="v_max_f32" || i.name=="v_mad_u32_u24" || i.name=="v_add3_u32" || i.name=="v_bfe_u32" || i.name=="v_mov_b32" || i.name=="v_add_nc_u32" || i.name=="v_sub_nc_u32" || i.name=="v_subrev_nc_u32" || i.name=="v_add_co_ci_u32" || i.name=="v_lshlrev_b32" || diff --git a/tests/native_direct_mesh_check.py b/tests/native_direct_mesh_check.py index 0816a19356..9e5f88046f 100644 --- a/tests/native_direct_mesh_check.py +++ b/tests/native_direct_mesh_check.py @@ -299,6 +299,18 @@ def run(name, words, expected=None): text = run('v-mad-f32', program[:5] + program[6:7] + mad + program[7:]) assert re.search(r'fmul float', text) and re.search(r'fadd float', text), text assert '@dx.op.tertiary.f32' not in text, text + # VOP2 0x18: v_ashrrev_i32 v1, 2, v0 shifts v0 right by 2, keeping the sign (ashr, not lshr). + text = run('v-ashrrev-i32', program[:5] + program[6:7] + [0x30020082] + program[7:]) + shifted = re.search(rf'(?P{value}) = and i32 2, 31\n\s*(?P{value}) = ashr i32 {value}, (?P=amount)\n', text) + assert shifted, text + assert_position_x(text, rf'ashr i32 {value}, {re.escape(shifted["amount"])}') + # VOP1 0x2b: v_rcp_iflag_f32 v1, v0 is the same reciprocal as v_rcp_f32; the flag only + # changes IEEE exception reporting, which DXIL does not expose. + text = run('v-rcp-iflag-f32', program[:5] + program[6:7] + [0x7e025700] + program[7:]) + reciprocal = re.search(rf'(?P{value}) = fdiv float 1\.000000e\+00, {value}\n', text) + assert reciprocal, text + # The reciprocal's bits are v1, which the fixture converts and exports as X. + assert_position_x(text, rf'bitcast float {re.escape(reciprocal["rcp"])} to i32') # Pack the thread ID, the inline constant 2 and the sign-extended immediate in s7. pack_position = [0xb0078000, 0xd7720001, 256 | (130 << 9) | (7 << 18)] text = run('v-or3-b32', program[:5] + program[6:7] + pack_position + program[7:])