1410 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --extra_scrub --version 52; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx900 < %s | FileCheck -check-prefixes=GFX9-SDAG %s3; RUN: llc -global-isel=1 -mtriple=amdgcn -mcpu=gfx900 < %s | FileCheck -check-prefixes=GFX9-GISEL %s4; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx1010 < %s | FileCheck -check-prefixes=GFX10-SDAG %s5; RUN: llc -global-isel=1 -mtriple=amdgcn -mcpu=gfx1010 < %s | FileCheck -check-prefixes=GFX10-GISEL %s6; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx1100 -mattr=+real-true16 < %s | FileCheck -check-prefixes=GFX11-SDAG,GFX11-SDAG-TRUE16 %s7; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx1100 -mattr=-real-true16 < %s | FileCheck -check-prefixes=GFX11-SDAG,GFX11-SDAG-FAKE16 %s8; RUN: llc -global-isel=1 -mtriple=amdgcn -mcpu=gfx1100 -mattr=+real-true16 < %s | FileCheck -check-prefixes=GFX11-GISEL,GFX11-GISEL-TRUE16 %s9; RUN: llc -global-isel=1 -mtriple=amdgcn -mcpu=gfx1100 -mattr=-real-true16 < %s | FileCheck -check-prefixes=GFX11-GISEL,GFX11-GISEL-FAKE16 %s10 11define i32 @intrinsic_lround_i32_f32(float %arg) {12; GFX9-SDAG-LABEL: intrinsic_lround_i32_f32:13; GFX9-SDAG: ; %bb.0: ; %entry14; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)15; GFX9-SDAG-NEXT: v_trunc_f32_e32 v1, v016; GFX9-SDAG-NEXT: v_sub_f32_e32 v2, v0, v117; GFX9-SDAG-NEXT: v_cmp_ge_f32_e64 s[4:5], |v2|, 0.518; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v2, 0, 1.0, s[4:5]19; GFX9-SDAG-NEXT: s_brev_b32 s4, -220; GFX9-SDAG-NEXT: v_bfi_b32 v0, s4, v2, v021; GFX9-SDAG-NEXT: v_add_f32_e32 v0, v1, v022; GFX9-SDAG-NEXT: v_cvt_i32_f32_e32 v0, v023; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]24;25; GFX9-GISEL-LABEL: intrinsic_lround_i32_f32:26; GFX9-GISEL: ; %bb.0: ; %entry27; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)28; GFX9-GISEL-NEXT: v_trunc_f32_e32 v1, v029; GFX9-GISEL-NEXT: v_sub_f32_e32 v2, v0, v130; GFX9-GISEL-NEXT: v_cmp_ge_f32_e64 s[4:5], |v2|, 0.531; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v2, 0, 1.0, s[4:5]32; GFX9-GISEL-NEXT: v_bfrev_b32_e32 v3, 133; GFX9-GISEL-NEXT: v_and_or_b32 v0, v0, v3, v234; GFX9-GISEL-NEXT: v_add_f32_e32 v0, v1, v035; GFX9-GISEL-NEXT: v_cvt_i32_f32_e32 v0, v036; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]37;38; GFX10-SDAG-LABEL: intrinsic_lround_i32_f32:39; GFX10-SDAG: ; %bb.0: ; %entry40; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)41; GFX10-SDAG-NEXT: v_trunc_f32_e32 v1, v042; GFX10-SDAG-NEXT: v_sub_f32_e32 v2, v0, v143; GFX10-SDAG-NEXT: v_cmp_ge_f32_e64 s4, |v2|, 0.544; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v2, 0, 1.0, s445; GFX10-SDAG-NEXT: v_bfi_b32 v0, 0x7fffffff, v2, v046; GFX10-SDAG-NEXT: v_add_f32_e32 v0, v1, v047; GFX10-SDAG-NEXT: v_cvt_i32_f32_e32 v0, v048; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]49;50; GFX10-GISEL-LABEL: intrinsic_lround_i32_f32:51; GFX10-GISEL: ; %bb.0: ; %entry52; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)53; GFX10-GISEL-NEXT: v_trunc_f32_e32 v1, v054; GFX10-GISEL-NEXT: v_sub_f32_e32 v2, v0, v155; GFX10-GISEL-NEXT: v_cmp_ge_f32_e64 s4, |v2|, 0.556; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v2, 0, 1.0, s457; GFX10-GISEL-NEXT: v_and_or_b32 v0, 0x80000000, v0, v258; GFX10-GISEL-NEXT: v_add_f32_e32 v0, v1, v059; GFX10-GISEL-NEXT: v_cvt_i32_f32_e32 v0, v060; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]61;62; GFX11-SDAG-LABEL: intrinsic_lround_i32_f32:63; GFX11-SDAG: ; %bb.0: ; %entry64; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)65; GFX11-SDAG-NEXT: v_trunc_f32_e32 v1, v066; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)67; GFX11-SDAG-NEXT: v_sub_f32_e32 v2, v0, v168; GFX11-SDAG-NEXT: v_cmp_ge_f32_e64 s0, |v2|, 0.569; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)70; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v2, 0, 1.0, s071; GFX11-SDAG-NEXT: v_bfi_b32 v0, 0x7fffffff, v2, v072; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)73; GFX11-SDAG-NEXT: v_add_f32_e32 v0, v1, v074; GFX11-SDAG-NEXT: v_cvt_i32_f32_e32 v0, v075; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]76;77; GFX11-GISEL-LABEL: intrinsic_lround_i32_f32:78; GFX11-GISEL: ; %bb.0: ; %entry79; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)80; GFX11-GISEL-NEXT: v_trunc_f32_e32 v1, v081; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)82; GFX11-GISEL-NEXT: v_sub_f32_e32 v2, v0, v183; GFX11-GISEL-NEXT: v_cmp_ge_f32_e64 s0, |v2|, 0.584; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)85; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v2, 0, 1.0, s086; GFX11-GISEL-NEXT: v_and_or_b32 v0, 0x80000000, v0, v287; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)88; GFX11-GISEL-NEXT: v_add_f32_e32 v0, v1, v089; GFX11-GISEL-NEXT: v_cvt_i32_f32_e32 v0, v090; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]91entry:92 %res = tail call i32 @llvm.lround.i32.f32(float %arg)93 ret i32 %res94}95 96define i32 @intrinsic_lround_i32_f64(double %arg) {97; GFX9-SDAG-LABEL: intrinsic_lround_i32_f64:98; GFX9-SDAG: ; %bb.0: ; %entry99; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)100; GFX9-SDAG-NEXT: v_trunc_f64_e32 v[2:3], v[0:1]101; GFX9-SDAG-NEXT: s_brev_b32 s4, -2102; GFX9-SDAG-NEXT: v_add_f64 v[4:5], v[0:1], -v[2:3]103; GFX9-SDAG-NEXT: v_mov_b32_e32 v0, 0x3ff00000104; GFX9-SDAG-NEXT: v_cmp_ge_f64_e64 vcc, |v[4:5]|, 0.5105; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v0, vcc106; GFX9-SDAG-NEXT: v_bfi_b32 v1, s4, v0, v1107; GFX9-SDAG-NEXT: v_mov_b32_e32 v0, 0108; GFX9-SDAG-NEXT: v_add_f64 v[0:1], v[2:3], v[0:1]109; GFX9-SDAG-NEXT: v_cvt_i32_f64_e32 v0, v[0:1]110; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]111;112; GFX9-GISEL-LABEL: intrinsic_lround_i32_f64:113; GFX9-GISEL: ; %bb.0: ; %entry114; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)115; GFX9-GISEL-NEXT: v_trunc_f64_e32 v[2:3], v[0:1]116; GFX9-GISEL-NEXT: v_mov_b32_e32 v6, 0x3ff00000117; GFX9-GISEL-NEXT: s_brev_b32 s4, 1118; GFX9-GISEL-NEXT: v_add_f64 v[4:5], v[0:1], -v[2:3]119; GFX9-GISEL-NEXT: v_and_or_b32 v0, v0, 0, 0120; GFX9-GISEL-NEXT: v_cmp_ge_f64_e64 vcc, |v[4:5]|, 0.5121; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v4, 0, v6, vcc122; GFX9-GISEL-NEXT: v_and_or_b32 v1, v1, s4, v4123; GFX9-GISEL-NEXT: v_add_f64 v[0:1], v[2:3], v[0:1]124; GFX9-GISEL-NEXT: v_cvt_i32_f64_e32 v0, v[0:1]125; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]126;127; GFX10-SDAG-LABEL: intrinsic_lround_i32_f64:128; GFX10-SDAG: ; %bb.0: ; %entry129; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)130; GFX10-SDAG-NEXT: v_trunc_f64_e32 v[2:3], v[0:1]131; GFX10-SDAG-NEXT: v_add_f64 v[4:5], v[0:1], -v[2:3]132; GFX10-SDAG-NEXT: v_cmp_ge_f64_e64 s4, |v[4:5]|, 0.5133; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v0, 0, 0x3ff00000, s4134; GFX10-SDAG-NEXT: v_bfi_b32 v1, 0x7fffffff, v0, v1135; GFX10-SDAG-NEXT: v_mov_b32_e32 v0, 0136; GFX10-SDAG-NEXT: v_add_f64 v[0:1], v[2:3], v[0:1]137; GFX10-SDAG-NEXT: v_cvt_i32_f64_e32 v0, v[0:1]138; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]139;140; GFX10-GISEL-LABEL: intrinsic_lround_i32_f64:141; GFX10-GISEL: ; %bb.0: ; %entry142; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)143; GFX10-GISEL-NEXT: v_trunc_f64_e32 v[2:3], v[0:1]144; GFX10-GISEL-NEXT: v_add_f64 v[4:5], v[0:1], -v[2:3]145; GFX10-GISEL-NEXT: v_and_or_b32 v0, v0, 0, 0146; GFX10-GISEL-NEXT: v_cmp_ge_f64_e64 s4, |v[4:5]|, 0.5147; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v4, 0, 0x3ff00000, s4148; GFX10-GISEL-NEXT: v_and_or_b32 v1, 0x80000000, v1, v4149; GFX10-GISEL-NEXT: v_add_f64 v[0:1], v[2:3], v[0:1]150; GFX10-GISEL-NEXT: v_cvt_i32_f64_e32 v0, v[0:1]151; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]152;153; GFX11-SDAG-LABEL: intrinsic_lround_i32_f64:154; GFX11-SDAG: ; %bb.0: ; %entry155; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)156; GFX11-SDAG-NEXT: v_trunc_f64_e32 v[2:3], v[0:1]157; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)158; GFX11-SDAG-NEXT: v_add_f64 v[4:5], v[0:1], -v[2:3]159; GFX11-SDAG-NEXT: v_cmp_ge_f64_e64 s0, |v[4:5]|, 0.5160; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)161; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v0, 0, 0x3ff00000, s0162; GFX11-SDAG-NEXT: v_bfi_b32 v1, 0x7fffffff, v0, v1163; GFX11-SDAG-NEXT: v_mov_b32_e32 v0, 0164; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)165; GFX11-SDAG-NEXT: v_add_f64 v[0:1], v[2:3], v[0:1]166; GFX11-SDAG-NEXT: v_cvt_i32_f64_e32 v0, v[0:1]167; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]168;169; GFX11-GISEL-LABEL: intrinsic_lround_i32_f64:170; GFX11-GISEL: ; %bb.0: ; %entry171; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)172; GFX11-GISEL-NEXT: v_trunc_f64_e32 v[2:3], v[0:1]173; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)174; GFX11-GISEL-NEXT: v_add_f64 v[4:5], v[0:1], -v[2:3]175; GFX11-GISEL-NEXT: v_and_or_b32 v0, v0, 0, 0176; GFX11-GISEL-NEXT: v_cmp_ge_f64_e64 s0, |v[4:5]|, 0.5177; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)178; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v4, 0, 0x3ff00000, s0179; GFX11-GISEL-NEXT: v_and_or_b32 v1, 0x80000000, v1, v4180; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)181; GFX11-GISEL-NEXT: v_add_f64 v[0:1], v[2:3], v[0:1]182; GFX11-GISEL-NEXT: v_cvt_i32_f64_e32 v0, v[0:1]183; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]184entry:185 %res = tail call i32 @llvm.lround.i32.f64(double %arg)186 ret i32 %res187}188 189define i64 @intrinsic_lround_i64_f32(float %arg) {190; GFX9-SDAG-LABEL: intrinsic_lround_i64_f32:191; GFX9-SDAG: ; %bb.0: ; %entry192; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)193; GFX9-SDAG-NEXT: v_trunc_f32_e32 v1, v0194; GFX9-SDAG-NEXT: v_sub_f32_e32 v2, v0, v1195; GFX9-SDAG-NEXT: v_cmp_ge_f32_e64 s[4:5], |v2|, 0.5196; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v2, 0, 1.0, s[4:5]197; GFX9-SDAG-NEXT: s_brev_b32 s4, -2198; GFX9-SDAG-NEXT: v_bfi_b32 v0, s4, v2, v0199; GFX9-SDAG-NEXT: v_add_f32_e32 v0, v1, v0200; GFX9-SDAG-NEXT: v_trunc_f32_e32 v0, v0201; GFX9-SDAG-NEXT: s_mov_b32 s4, 0x2f800000202; GFX9-SDAG-NEXT: v_mul_f32_e64 v1, |v0|, s4203; GFX9-SDAG-NEXT: v_floor_f32_e32 v1, v1204; GFX9-SDAG-NEXT: s_mov_b32 s4, 0xcf800000205; GFX9-SDAG-NEXT: v_fma_f32 v2, v1, s4, |v0|206; GFX9-SDAG-NEXT: v_cvt_u32_f32_e32 v2, v2207; GFX9-SDAG-NEXT: v_cvt_u32_f32_e32 v1, v1208; GFX9-SDAG-NEXT: v_ashrrev_i32_e32 v3, 31, v0209; GFX9-SDAG-NEXT: v_xor_b32_e32 v0, v2, v3210; GFX9-SDAG-NEXT: v_xor_b32_e32 v1, v1, v3211; GFX9-SDAG-NEXT: v_sub_co_u32_e32 v0, vcc, v0, v3212; GFX9-SDAG-NEXT: v_subb_co_u32_e32 v1, vcc, v1, v3, vcc213; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]214;215; GFX9-GISEL-LABEL: intrinsic_lround_i64_f32:216; GFX9-GISEL: ; %bb.0: ; %entry217; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)218; GFX9-GISEL-NEXT: v_trunc_f32_e32 v1, v0219; GFX9-GISEL-NEXT: v_sub_f32_e32 v2, v0, v1220; GFX9-GISEL-NEXT: v_cmp_ge_f32_e64 s[4:5], |v2|, 0.5221; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v2, 0, 1.0, s[4:5]222; GFX9-GISEL-NEXT: v_bfrev_b32_e32 v3, 1223; GFX9-GISEL-NEXT: v_and_or_b32 v0, v0, v3, v2224; GFX9-GISEL-NEXT: v_add_f32_e32 v0, v1, v0225; GFX9-GISEL-NEXT: v_trunc_f32_e32 v1, v0226; GFX9-GISEL-NEXT: v_mov_b32_e32 v2, 0x2f800000227; GFX9-GISEL-NEXT: v_mul_f32_e64 v2, |v1|, v2228; GFX9-GISEL-NEXT: v_floor_f32_e32 v2, v2229; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, 0xcf800000230; GFX9-GISEL-NEXT: v_fma_f32 v1, v2, v3, |v1|231; GFX9-GISEL-NEXT: v_cvt_u32_f32_e32 v1, v1232; GFX9-GISEL-NEXT: v_cvt_u32_f32_e32 v2, v2233; GFX9-GISEL-NEXT: v_ashrrev_i32_e32 v3, 31, v0234; GFX9-GISEL-NEXT: v_xor_b32_e32 v0, v1, v3235; GFX9-GISEL-NEXT: v_xor_b32_e32 v1, v2, v3236; GFX9-GISEL-NEXT: v_sub_co_u32_e32 v0, vcc, v0, v3237; GFX9-GISEL-NEXT: v_subb_co_u32_e32 v1, vcc, v1, v3, vcc238; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]239;240; GFX10-SDAG-LABEL: intrinsic_lround_i64_f32:241; GFX10-SDAG: ; %bb.0: ; %entry242; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)243; GFX10-SDAG-NEXT: v_trunc_f32_e32 v1, v0244; GFX10-SDAG-NEXT: v_sub_f32_e32 v2, v0, v1245; GFX10-SDAG-NEXT: v_cmp_ge_f32_e64 s4, |v2|, 0.5246; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v2, 0, 1.0, s4247; GFX10-SDAG-NEXT: v_bfi_b32 v0, 0x7fffffff, v2, v0248; GFX10-SDAG-NEXT: v_add_f32_e32 v0, v1, v0249; GFX10-SDAG-NEXT: v_trunc_f32_e32 v0, v0250; GFX10-SDAG-NEXT: v_mul_f32_e64 v1, 0x2f800000, |v0|251; GFX10-SDAG-NEXT: v_ashrrev_i32_e32 v3, 31, v0252; GFX10-SDAG-NEXT: v_floor_f32_e32 v1, v1253; GFX10-SDAG-NEXT: v_fma_f32 v2, 0xcf800000, v1, |v0|254; GFX10-SDAG-NEXT: v_cvt_u32_f32_e32 v1, v1255; GFX10-SDAG-NEXT: v_cvt_u32_f32_e32 v0, v2256; GFX10-SDAG-NEXT: v_xor_b32_e32 v1, v1, v3257; GFX10-SDAG-NEXT: v_xor_b32_e32 v0, v0, v3258; GFX10-SDAG-NEXT: v_sub_co_u32 v0, vcc_lo, v0, v3259; GFX10-SDAG-NEXT: v_sub_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo260; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]261;262; GFX10-GISEL-LABEL: intrinsic_lround_i64_f32:263; GFX10-GISEL: ; %bb.0: ; %entry264; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)265; GFX10-GISEL-NEXT: v_trunc_f32_e32 v1, v0266; GFX10-GISEL-NEXT: v_sub_f32_e32 v2, v0, v1267; GFX10-GISEL-NEXT: v_cmp_ge_f32_e64 s4, |v2|, 0.5268; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v2, 0, 1.0, s4269; GFX10-GISEL-NEXT: v_and_or_b32 v0, 0x80000000, v0, v2270; GFX10-GISEL-NEXT: v_add_f32_e32 v0, v1, v0271; GFX10-GISEL-NEXT: v_trunc_f32_e32 v1, v0272; GFX10-GISEL-NEXT: v_ashrrev_i32_e32 v3, 31, v0273; GFX10-GISEL-NEXT: v_mul_f32_e64 v2, 0x2f800000, |v1|274; GFX10-GISEL-NEXT: v_floor_f32_e32 v2, v2275; GFX10-GISEL-NEXT: v_fma_f32 v1, 0xcf800000, v2, |v1|276; GFX10-GISEL-NEXT: v_cvt_u32_f32_e32 v0, v1277; GFX10-GISEL-NEXT: v_cvt_u32_f32_e32 v1, v2278; GFX10-GISEL-NEXT: v_xor_b32_e32 v0, v0, v3279; GFX10-GISEL-NEXT: v_xor_b32_e32 v1, v1, v3280; GFX10-GISEL-NEXT: v_sub_co_u32 v0, vcc_lo, v0, v3281; GFX10-GISEL-NEXT: v_sub_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo282; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]283;284; GFX11-SDAG-LABEL: intrinsic_lround_i64_f32:285; GFX11-SDAG: ; %bb.0: ; %entry286; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)287; GFX11-SDAG-NEXT: v_trunc_f32_e32 v1, v0288; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)289; GFX11-SDAG-NEXT: v_sub_f32_e32 v2, v0, v1290; GFX11-SDAG-NEXT: v_cmp_ge_f32_e64 s0, |v2|, 0.5291; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)292; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v2, 0, 1.0, s0293; GFX11-SDAG-NEXT: v_bfi_b32 v0, 0x7fffffff, v2, v0294; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)295; GFX11-SDAG-NEXT: v_add_f32_e32 v0, v1, v0296; GFX11-SDAG-NEXT: v_trunc_f32_e32 v0, v0297; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)298; GFX11-SDAG-NEXT: v_mul_f32_e64 v1, 0x2f800000, |v0|299; GFX11-SDAG-NEXT: v_ashrrev_i32_e32 v3, 31, v0300; GFX11-SDAG-NEXT: v_floor_f32_e32 v1, v1301; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)302; GFX11-SDAG-NEXT: v_fma_f32 v2, 0xcf800000, v1, |v0|303; GFX11-SDAG-NEXT: v_cvt_u32_f32_e32 v1, v1304; GFX11-SDAG-NEXT: v_cvt_u32_f32_e32 v0, v2305; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)306; GFX11-SDAG-NEXT: v_xor_b32_e32 v1, v1, v3307; GFX11-SDAG-NEXT: v_xor_b32_e32 v0, v0, v3308; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)309; GFX11-SDAG-NEXT: v_sub_co_u32 v0, vcc_lo, v0, v3310; GFX11-SDAG-NEXT: v_sub_co_ci_u32_e64 v1, null, v1, v3, vcc_lo311; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]312;313; GFX11-GISEL-LABEL: intrinsic_lround_i64_f32:314; GFX11-GISEL: ; %bb.0: ; %entry315; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)316; GFX11-GISEL-NEXT: v_trunc_f32_e32 v1, v0317; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)318; GFX11-GISEL-NEXT: v_sub_f32_e32 v2, v0, v1319; GFX11-GISEL-NEXT: v_cmp_ge_f32_e64 s0, |v2|, 0.5320; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)321; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v2, 0, 1.0, s0322; GFX11-GISEL-NEXT: v_and_or_b32 v0, 0x80000000, v0, v2323; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)324; GFX11-GISEL-NEXT: v_add_f32_e32 v0, v1, v0325; GFX11-GISEL-NEXT: v_trunc_f32_e32 v1, v0326; GFX11-GISEL-NEXT: v_ashrrev_i32_e32 v3, 31, v0327; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)328; GFX11-GISEL-NEXT: v_mul_f32_e64 v2, 0x2f800000, |v1|329; GFX11-GISEL-NEXT: v_floor_f32_e32 v2, v2330; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)331; GFX11-GISEL-NEXT: v_fma_f32 v1, 0xcf800000, v2, |v1|332; GFX11-GISEL-NEXT: v_cvt_u32_f32_e32 v0, v1333; GFX11-GISEL-NEXT: v_cvt_u32_f32_e32 v1, v2334; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)335; GFX11-GISEL-NEXT: v_xor_b32_e32 v0, v0, v3336; GFX11-GISEL-NEXT: v_xor_b32_e32 v1, v1, v3337; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)338; GFX11-GISEL-NEXT: v_sub_co_u32 v0, vcc_lo, v0, v3339; GFX11-GISEL-NEXT: v_sub_co_ci_u32_e64 v1, null, v1, v3, vcc_lo340; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]341entry:342 %res = tail call i64 @llvm.lround.i64.f32(float %arg)343 ret i64 %res344}345 346define i64 @intrinsic_lround_i64_f64(double %arg) {347; GFX9-SDAG-LABEL: intrinsic_lround_i64_f64:348; GFX9-SDAG: ; %bb.0: ; %entry349; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)350; GFX9-SDAG-NEXT: v_trunc_f64_e32 v[2:3], v[0:1]351; GFX9-SDAG-NEXT: v_mov_b32_e32 v6, 0x3ff00000352; GFX9-SDAG-NEXT: s_brev_b32 s4, -2353; GFX9-SDAG-NEXT: v_add_f64 v[4:5], v[0:1], -v[2:3]354; GFX9-SDAG-NEXT: v_mov_b32_e32 v0, 0355; GFX9-SDAG-NEXT: v_cmp_ge_f64_e64 vcc, |v[4:5]|, 0.5356; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v4, 0, v6, vcc357; GFX9-SDAG-NEXT: v_bfi_b32 v1, s4, v4, v1358; GFX9-SDAG-NEXT: v_add_f64 v[0:1], v[2:3], v[0:1]359; GFX9-SDAG-NEXT: s_movk_i32 s4, 0xffe0360; GFX9-SDAG-NEXT: v_trunc_f64_e32 v[0:1], v[0:1]361; GFX9-SDAG-NEXT: v_ldexp_f64 v[2:3], v[0:1], s4362; GFX9-SDAG-NEXT: s_mov_b32 s4, 0363; GFX9-SDAG-NEXT: s_mov_b32 s5, 0xc1f00000364; GFX9-SDAG-NEXT: v_floor_f64_e32 v[2:3], v[2:3]365; GFX9-SDAG-NEXT: v_fma_f64 v[0:1], v[2:3], s[4:5], v[0:1]366; GFX9-SDAG-NEXT: v_cvt_u32_f64_e32 v0, v[0:1]367; GFX9-SDAG-NEXT: v_cvt_i32_f64_e32 v1, v[2:3]368; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]369;370; GFX9-GISEL-LABEL: intrinsic_lround_i64_f64:371; GFX9-GISEL: ; %bb.0: ; %entry372; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)373; GFX9-GISEL-NEXT: v_trunc_f64_e32 v[2:3], v[0:1]374; GFX9-GISEL-NEXT: v_mov_b32_e32 v6, 0x3ff00000375; GFX9-GISEL-NEXT: s_brev_b32 s4, 1376; GFX9-GISEL-NEXT: v_add_f64 v[4:5], v[0:1], -v[2:3]377; GFX9-GISEL-NEXT: v_and_or_b32 v0, v0, 0, 0378; GFX9-GISEL-NEXT: v_cmp_ge_f64_e64 vcc, |v[4:5]|, 0.5379; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v4, 0, v6, vcc380; GFX9-GISEL-NEXT: v_and_or_b32 v1, v1, s4, v4381; GFX9-GISEL-NEXT: v_add_f64 v[0:1], v[2:3], v[0:1]382; GFX9-GISEL-NEXT: v_mov_b32_e32 v2, 0383; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, 0x3df00000384; GFX9-GISEL-NEXT: v_mov_b32_e32 v4, 0385; GFX9-GISEL-NEXT: v_mov_b32_e32 v5, 0xc1f00000386; GFX9-GISEL-NEXT: v_trunc_f64_e32 v[0:1], v[0:1]387; GFX9-GISEL-NEXT: v_mul_f64 v[2:3], v[0:1], v[2:3]388; GFX9-GISEL-NEXT: v_floor_f64_e32 v[2:3], v[2:3]389; GFX9-GISEL-NEXT: v_fma_f64 v[0:1], v[2:3], v[4:5], v[0:1]390; GFX9-GISEL-NEXT: v_cvt_u32_f64_e32 v0, v[0:1]391; GFX9-GISEL-NEXT: v_cvt_i32_f64_e32 v1, v[2:3]392; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]393;394; GFX10-SDAG-LABEL: intrinsic_lround_i64_f64:395; GFX10-SDAG: ; %bb.0: ; %entry396; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)397; GFX10-SDAG-NEXT: v_trunc_f64_e32 v[2:3], v[0:1]398; GFX10-SDAG-NEXT: v_add_f64 v[4:5], v[0:1], -v[2:3]399; GFX10-SDAG-NEXT: v_mov_b32_e32 v0, 0400; GFX10-SDAG-NEXT: v_cmp_ge_f64_e64 s4, |v[4:5]|, 0.5401; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v4, 0, 0x3ff00000, s4402; GFX10-SDAG-NEXT: v_bfi_b32 v1, 0x7fffffff, v4, v1403; GFX10-SDAG-NEXT: v_add_f64 v[0:1], v[2:3], v[0:1]404; GFX10-SDAG-NEXT: v_trunc_f64_e32 v[0:1], v[0:1]405; GFX10-SDAG-NEXT: v_ldexp_f64 v[2:3], v[0:1], 0xffffffe0406; GFX10-SDAG-NEXT: v_floor_f64_e32 v[2:3], v[2:3]407; GFX10-SDAG-NEXT: v_fma_f64 v[0:1], 0xc1f00000, v[2:3], v[0:1]408; GFX10-SDAG-NEXT: v_cvt_u32_f64_e32 v0, v[0:1]409; GFX10-SDAG-NEXT: v_cvt_i32_f64_e32 v1, v[2:3]410; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]411;412; GFX10-GISEL-LABEL: intrinsic_lround_i64_f64:413; GFX10-GISEL: ; %bb.0: ; %entry414; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)415; GFX10-GISEL-NEXT: v_trunc_f64_e32 v[2:3], v[0:1]416; GFX10-GISEL-NEXT: v_add_f64 v[4:5], v[0:1], -v[2:3]417; GFX10-GISEL-NEXT: v_and_or_b32 v0, v0, 0, 0418; GFX10-GISEL-NEXT: v_cmp_ge_f64_e64 s4, |v[4:5]|, 0.5419; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v4, 0, 0x3ff00000, s4420; GFX10-GISEL-NEXT: v_and_or_b32 v1, 0x80000000, v1, v4421; GFX10-GISEL-NEXT: v_add_f64 v[0:1], v[2:3], v[0:1]422; GFX10-GISEL-NEXT: v_trunc_f64_e32 v[0:1], v[0:1]423; GFX10-GISEL-NEXT: v_mul_f64 v[2:3], 0x3df00000, v[0:1]424; GFX10-GISEL-NEXT: v_floor_f64_e32 v[2:3], v[2:3]425; GFX10-GISEL-NEXT: v_fma_f64 v[0:1], 0xc1f00000, v[2:3], v[0:1]426; GFX10-GISEL-NEXT: v_cvt_u32_f64_e32 v0, v[0:1]427; GFX10-GISEL-NEXT: v_cvt_i32_f64_e32 v1, v[2:3]428; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]429;430; GFX11-SDAG-LABEL: intrinsic_lround_i64_f64:431; GFX11-SDAG: ; %bb.0: ; %entry432; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)433; GFX11-SDAG-NEXT: v_trunc_f64_e32 v[2:3], v[0:1]434; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)435; GFX11-SDAG-NEXT: v_add_f64 v[4:5], v[0:1], -v[2:3]436; GFX11-SDAG-NEXT: v_mov_b32_e32 v0, 0437; GFX11-SDAG-NEXT: v_cmp_ge_f64_e64 s0, |v[4:5]|, 0.5438; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)439; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v4, 0, 0x3ff00000, s0440; GFX11-SDAG-NEXT: v_bfi_b32 v1, 0x7fffffff, v4, v1441; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)442; GFX11-SDAG-NEXT: v_add_f64 v[0:1], v[2:3], v[0:1]443; GFX11-SDAG-NEXT: v_trunc_f64_e32 v[0:1], v[0:1]444; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)445; GFX11-SDAG-NEXT: v_ldexp_f64 v[2:3], v[0:1], 0xffffffe0446; GFX11-SDAG-NEXT: v_floor_f64_e32 v[2:3], v[2:3]447; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)448; GFX11-SDAG-NEXT: v_fma_f64 v[0:1], 0xc1f00000, v[2:3], v[0:1]449; GFX11-SDAG-NEXT: v_cvt_u32_f64_e32 v0, v[0:1]450; GFX11-SDAG-NEXT: v_cvt_i32_f64_e32 v1, v[2:3]451; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]452;453; GFX11-GISEL-LABEL: intrinsic_lround_i64_f64:454; GFX11-GISEL: ; %bb.0: ; %entry455; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)456; GFX11-GISEL-NEXT: v_trunc_f64_e32 v[2:3], v[0:1]457; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)458; GFX11-GISEL-NEXT: v_add_f64 v[4:5], v[0:1], -v[2:3]459; GFX11-GISEL-NEXT: v_and_or_b32 v0, v0, 0, 0460; GFX11-GISEL-NEXT: v_cmp_ge_f64_e64 s0, |v[4:5]|, 0.5461; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)462; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v4, 0, 0x3ff00000, s0463; GFX11-GISEL-NEXT: v_and_or_b32 v1, 0x80000000, v1, v4464; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)465; GFX11-GISEL-NEXT: v_add_f64 v[0:1], v[2:3], v[0:1]466; GFX11-GISEL-NEXT: v_trunc_f64_e32 v[0:1], v[0:1]467; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)468; GFX11-GISEL-NEXT: v_mul_f64 v[2:3], 0x3df00000, v[0:1]469; GFX11-GISEL-NEXT: v_floor_f64_e32 v[2:3], v[2:3]470; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)471; GFX11-GISEL-NEXT: v_fma_f64 v[0:1], 0xc1f00000, v[2:3], v[0:1]472; GFX11-GISEL-NEXT: v_cvt_u32_f64_e32 v0, v[0:1]473; GFX11-GISEL-NEXT: v_cvt_i32_f64_e32 v1, v[2:3]474; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]475entry:476 %res = tail call i64 @llvm.lround.i64.f64(double %arg)477 ret i64 %res478}479 480define i64 @intrinsic_llround_i64_f32(float %arg) {481; GFX9-SDAG-LABEL: intrinsic_llround_i64_f32:482; GFX9-SDAG: ; %bb.0: ; %entry483; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)484; GFX9-SDAG-NEXT: v_trunc_f32_e32 v1, v0485; GFX9-SDAG-NEXT: v_sub_f32_e32 v2, v0, v1486; GFX9-SDAG-NEXT: v_cmp_ge_f32_e64 s[4:5], |v2|, 0.5487; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v2, 0, 1.0, s[4:5]488; GFX9-SDAG-NEXT: s_brev_b32 s4, -2489; GFX9-SDAG-NEXT: v_bfi_b32 v0, s4, v2, v0490; GFX9-SDAG-NEXT: v_add_f32_e32 v0, v1, v0491; GFX9-SDAG-NEXT: v_trunc_f32_e32 v0, v0492; GFX9-SDAG-NEXT: s_mov_b32 s4, 0x2f800000493; GFX9-SDAG-NEXT: v_mul_f32_e64 v1, |v0|, s4494; GFX9-SDAG-NEXT: v_floor_f32_e32 v1, v1495; GFX9-SDAG-NEXT: s_mov_b32 s4, 0xcf800000496; GFX9-SDAG-NEXT: v_fma_f32 v2, v1, s4, |v0|497; GFX9-SDAG-NEXT: v_cvt_u32_f32_e32 v2, v2498; GFX9-SDAG-NEXT: v_cvt_u32_f32_e32 v1, v1499; GFX9-SDAG-NEXT: v_ashrrev_i32_e32 v3, 31, v0500; GFX9-SDAG-NEXT: v_xor_b32_e32 v0, v2, v3501; GFX9-SDAG-NEXT: v_xor_b32_e32 v1, v1, v3502; GFX9-SDAG-NEXT: v_sub_co_u32_e32 v0, vcc, v0, v3503; GFX9-SDAG-NEXT: v_subb_co_u32_e32 v1, vcc, v1, v3, vcc504; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]505;506; GFX9-GISEL-LABEL: intrinsic_llround_i64_f32:507; GFX9-GISEL: ; %bb.0: ; %entry508; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)509; GFX9-GISEL-NEXT: v_trunc_f32_e32 v1, v0510; GFX9-GISEL-NEXT: v_sub_f32_e32 v2, v0, v1511; GFX9-GISEL-NEXT: v_cmp_ge_f32_e64 s[4:5], |v2|, 0.5512; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v2, 0, 1.0, s[4:5]513; GFX9-GISEL-NEXT: v_bfrev_b32_e32 v3, 1514; GFX9-GISEL-NEXT: v_and_or_b32 v0, v0, v3, v2515; GFX9-GISEL-NEXT: v_add_f32_e32 v0, v1, v0516; GFX9-GISEL-NEXT: v_trunc_f32_e32 v1, v0517; GFX9-GISEL-NEXT: v_mov_b32_e32 v2, 0x2f800000518; GFX9-GISEL-NEXT: v_mul_f32_e64 v2, |v1|, v2519; GFX9-GISEL-NEXT: v_floor_f32_e32 v2, v2520; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, 0xcf800000521; GFX9-GISEL-NEXT: v_fma_f32 v1, v2, v3, |v1|522; GFX9-GISEL-NEXT: v_cvt_u32_f32_e32 v1, v1523; GFX9-GISEL-NEXT: v_cvt_u32_f32_e32 v2, v2524; GFX9-GISEL-NEXT: v_ashrrev_i32_e32 v3, 31, v0525; GFX9-GISEL-NEXT: v_xor_b32_e32 v0, v1, v3526; GFX9-GISEL-NEXT: v_xor_b32_e32 v1, v2, v3527; GFX9-GISEL-NEXT: v_sub_co_u32_e32 v0, vcc, v0, v3528; GFX9-GISEL-NEXT: v_subb_co_u32_e32 v1, vcc, v1, v3, vcc529; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]530;531; GFX10-SDAG-LABEL: intrinsic_llround_i64_f32:532; GFX10-SDAG: ; %bb.0: ; %entry533; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)534; GFX10-SDAG-NEXT: v_trunc_f32_e32 v1, v0535; GFX10-SDAG-NEXT: v_sub_f32_e32 v2, v0, v1536; GFX10-SDAG-NEXT: v_cmp_ge_f32_e64 s4, |v2|, 0.5537; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v2, 0, 1.0, s4538; GFX10-SDAG-NEXT: v_bfi_b32 v0, 0x7fffffff, v2, v0539; GFX10-SDAG-NEXT: v_add_f32_e32 v0, v1, v0540; GFX10-SDAG-NEXT: v_trunc_f32_e32 v0, v0541; GFX10-SDAG-NEXT: v_mul_f32_e64 v1, 0x2f800000, |v0|542; GFX10-SDAG-NEXT: v_ashrrev_i32_e32 v3, 31, v0543; GFX10-SDAG-NEXT: v_floor_f32_e32 v1, v1544; GFX10-SDAG-NEXT: v_fma_f32 v2, 0xcf800000, v1, |v0|545; GFX10-SDAG-NEXT: v_cvt_u32_f32_e32 v1, v1546; GFX10-SDAG-NEXT: v_cvt_u32_f32_e32 v0, v2547; GFX10-SDAG-NEXT: v_xor_b32_e32 v1, v1, v3548; GFX10-SDAG-NEXT: v_xor_b32_e32 v0, v0, v3549; GFX10-SDAG-NEXT: v_sub_co_u32 v0, vcc_lo, v0, v3550; GFX10-SDAG-NEXT: v_sub_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo551; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]552;553; GFX10-GISEL-LABEL: intrinsic_llround_i64_f32:554; GFX10-GISEL: ; %bb.0: ; %entry555; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)556; GFX10-GISEL-NEXT: v_trunc_f32_e32 v1, v0557; GFX10-GISEL-NEXT: v_sub_f32_e32 v2, v0, v1558; GFX10-GISEL-NEXT: v_cmp_ge_f32_e64 s4, |v2|, 0.5559; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v2, 0, 1.0, s4560; GFX10-GISEL-NEXT: v_and_or_b32 v0, 0x80000000, v0, v2561; GFX10-GISEL-NEXT: v_add_f32_e32 v0, v1, v0562; GFX10-GISEL-NEXT: v_trunc_f32_e32 v1, v0563; GFX10-GISEL-NEXT: v_ashrrev_i32_e32 v3, 31, v0564; GFX10-GISEL-NEXT: v_mul_f32_e64 v2, 0x2f800000, |v1|565; GFX10-GISEL-NEXT: v_floor_f32_e32 v2, v2566; GFX10-GISEL-NEXT: v_fma_f32 v1, 0xcf800000, v2, |v1|567; GFX10-GISEL-NEXT: v_cvt_u32_f32_e32 v0, v1568; GFX10-GISEL-NEXT: v_cvt_u32_f32_e32 v1, v2569; GFX10-GISEL-NEXT: v_xor_b32_e32 v0, v0, v3570; GFX10-GISEL-NEXT: v_xor_b32_e32 v1, v1, v3571; GFX10-GISEL-NEXT: v_sub_co_u32 v0, vcc_lo, v0, v3572; GFX10-GISEL-NEXT: v_sub_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo573; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]574;575; GFX11-SDAG-LABEL: intrinsic_llround_i64_f32:576; GFX11-SDAG: ; %bb.0: ; %entry577; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)578; GFX11-SDAG-NEXT: v_trunc_f32_e32 v1, v0579; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)580; GFX11-SDAG-NEXT: v_sub_f32_e32 v2, v0, v1581; GFX11-SDAG-NEXT: v_cmp_ge_f32_e64 s0, |v2|, 0.5582; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)583; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v2, 0, 1.0, s0584; GFX11-SDAG-NEXT: v_bfi_b32 v0, 0x7fffffff, v2, v0585; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)586; GFX11-SDAG-NEXT: v_add_f32_e32 v0, v1, v0587; GFX11-SDAG-NEXT: v_trunc_f32_e32 v0, v0588; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)589; GFX11-SDAG-NEXT: v_mul_f32_e64 v1, 0x2f800000, |v0|590; GFX11-SDAG-NEXT: v_ashrrev_i32_e32 v3, 31, v0591; GFX11-SDAG-NEXT: v_floor_f32_e32 v1, v1592; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)593; GFX11-SDAG-NEXT: v_fma_f32 v2, 0xcf800000, v1, |v0|594; GFX11-SDAG-NEXT: v_cvt_u32_f32_e32 v1, v1595; GFX11-SDAG-NEXT: v_cvt_u32_f32_e32 v0, v2596; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)597; GFX11-SDAG-NEXT: v_xor_b32_e32 v1, v1, v3598; GFX11-SDAG-NEXT: v_xor_b32_e32 v0, v0, v3599; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)600; GFX11-SDAG-NEXT: v_sub_co_u32 v0, vcc_lo, v0, v3601; GFX11-SDAG-NEXT: v_sub_co_ci_u32_e64 v1, null, v1, v3, vcc_lo602; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]603;604; GFX11-GISEL-LABEL: intrinsic_llround_i64_f32:605; GFX11-GISEL: ; %bb.0: ; %entry606; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)607; GFX11-GISEL-NEXT: v_trunc_f32_e32 v1, v0608; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)609; GFX11-GISEL-NEXT: v_sub_f32_e32 v2, v0, v1610; GFX11-GISEL-NEXT: v_cmp_ge_f32_e64 s0, |v2|, 0.5611; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)612; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v2, 0, 1.0, s0613; GFX11-GISEL-NEXT: v_and_or_b32 v0, 0x80000000, v0, v2614; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)615; GFX11-GISEL-NEXT: v_add_f32_e32 v0, v1, v0616; GFX11-GISEL-NEXT: v_trunc_f32_e32 v1, v0617; GFX11-GISEL-NEXT: v_ashrrev_i32_e32 v3, 31, v0618; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)619; GFX11-GISEL-NEXT: v_mul_f32_e64 v2, 0x2f800000, |v1|620; GFX11-GISEL-NEXT: v_floor_f32_e32 v2, v2621; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)622; GFX11-GISEL-NEXT: v_fma_f32 v1, 0xcf800000, v2, |v1|623; GFX11-GISEL-NEXT: v_cvt_u32_f32_e32 v0, v1624; GFX11-GISEL-NEXT: v_cvt_u32_f32_e32 v1, v2625; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)626; GFX11-GISEL-NEXT: v_xor_b32_e32 v0, v0, v3627; GFX11-GISEL-NEXT: v_xor_b32_e32 v1, v1, v3628; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)629; GFX11-GISEL-NEXT: v_sub_co_u32 v0, vcc_lo, v0, v3630; GFX11-GISEL-NEXT: v_sub_co_ci_u32_e64 v1, null, v1, v3, vcc_lo631; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]632entry:633 %res = tail call i64 @llvm.llround.i64.f32(float %arg)634 ret i64 %res635}636 637define i64 @intrinsic_llround_i64_f64(double %arg) {638; GFX9-SDAG-LABEL: intrinsic_llround_i64_f64:639; GFX9-SDAG: ; %bb.0: ; %entry640; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)641; GFX9-SDAG-NEXT: v_trunc_f64_e32 v[2:3], v[0:1]642; GFX9-SDAG-NEXT: v_mov_b32_e32 v6, 0x3ff00000643; GFX9-SDAG-NEXT: s_brev_b32 s4, -2644; GFX9-SDAG-NEXT: v_add_f64 v[4:5], v[0:1], -v[2:3]645; GFX9-SDAG-NEXT: v_mov_b32_e32 v0, 0646; GFX9-SDAG-NEXT: v_cmp_ge_f64_e64 vcc, |v[4:5]|, 0.5647; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v4, 0, v6, vcc648; GFX9-SDAG-NEXT: v_bfi_b32 v1, s4, v4, v1649; GFX9-SDAG-NEXT: v_add_f64 v[0:1], v[2:3], v[0:1]650; GFX9-SDAG-NEXT: s_movk_i32 s4, 0xffe0651; GFX9-SDAG-NEXT: v_trunc_f64_e32 v[0:1], v[0:1]652; GFX9-SDAG-NEXT: v_ldexp_f64 v[2:3], v[0:1], s4653; GFX9-SDAG-NEXT: s_mov_b32 s4, 0654; GFX9-SDAG-NEXT: s_mov_b32 s5, 0xc1f00000655; GFX9-SDAG-NEXT: v_floor_f64_e32 v[2:3], v[2:3]656; GFX9-SDAG-NEXT: v_fma_f64 v[0:1], v[2:3], s[4:5], v[0:1]657; GFX9-SDAG-NEXT: v_cvt_u32_f64_e32 v0, v[0:1]658; GFX9-SDAG-NEXT: v_cvt_i32_f64_e32 v1, v[2:3]659; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]660;661; GFX9-GISEL-LABEL: intrinsic_llround_i64_f64:662; GFX9-GISEL: ; %bb.0: ; %entry663; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)664; GFX9-GISEL-NEXT: v_trunc_f64_e32 v[2:3], v[0:1]665; GFX9-GISEL-NEXT: v_mov_b32_e32 v6, 0x3ff00000666; GFX9-GISEL-NEXT: s_brev_b32 s4, 1667; GFX9-GISEL-NEXT: v_add_f64 v[4:5], v[0:1], -v[2:3]668; GFX9-GISEL-NEXT: v_and_or_b32 v0, v0, 0, 0669; GFX9-GISEL-NEXT: v_cmp_ge_f64_e64 vcc, |v[4:5]|, 0.5670; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v4, 0, v6, vcc671; GFX9-GISEL-NEXT: v_and_or_b32 v1, v1, s4, v4672; GFX9-GISEL-NEXT: v_add_f64 v[0:1], v[2:3], v[0:1]673; GFX9-GISEL-NEXT: v_mov_b32_e32 v2, 0674; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, 0x3df00000675; GFX9-GISEL-NEXT: v_mov_b32_e32 v4, 0676; GFX9-GISEL-NEXT: v_mov_b32_e32 v5, 0xc1f00000677; GFX9-GISEL-NEXT: v_trunc_f64_e32 v[0:1], v[0:1]678; GFX9-GISEL-NEXT: v_mul_f64 v[2:3], v[0:1], v[2:3]679; GFX9-GISEL-NEXT: v_floor_f64_e32 v[2:3], v[2:3]680; GFX9-GISEL-NEXT: v_fma_f64 v[0:1], v[2:3], v[4:5], v[0:1]681; GFX9-GISEL-NEXT: v_cvt_u32_f64_e32 v0, v[0:1]682; GFX9-GISEL-NEXT: v_cvt_i32_f64_e32 v1, v[2:3]683; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]684;685; GFX10-SDAG-LABEL: intrinsic_llround_i64_f64:686; GFX10-SDAG: ; %bb.0: ; %entry687; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)688; GFX10-SDAG-NEXT: v_trunc_f64_e32 v[2:3], v[0:1]689; GFX10-SDAG-NEXT: v_add_f64 v[4:5], v[0:1], -v[2:3]690; GFX10-SDAG-NEXT: v_mov_b32_e32 v0, 0691; GFX10-SDAG-NEXT: v_cmp_ge_f64_e64 s4, |v[4:5]|, 0.5692; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v4, 0, 0x3ff00000, s4693; GFX10-SDAG-NEXT: v_bfi_b32 v1, 0x7fffffff, v4, v1694; GFX10-SDAG-NEXT: v_add_f64 v[0:1], v[2:3], v[0:1]695; GFX10-SDAG-NEXT: v_trunc_f64_e32 v[0:1], v[0:1]696; GFX10-SDAG-NEXT: v_ldexp_f64 v[2:3], v[0:1], 0xffffffe0697; GFX10-SDAG-NEXT: v_floor_f64_e32 v[2:3], v[2:3]698; GFX10-SDAG-NEXT: v_fma_f64 v[0:1], 0xc1f00000, v[2:3], v[0:1]699; GFX10-SDAG-NEXT: v_cvt_u32_f64_e32 v0, v[0:1]700; GFX10-SDAG-NEXT: v_cvt_i32_f64_e32 v1, v[2:3]701; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]702;703; GFX10-GISEL-LABEL: intrinsic_llround_i64_f64:704; GFX10-GISEL: ; %bb.0: ; %entry705; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)706; GFX10-GISEL-NEXT: v_trunc_f64_e32 v[2:3], v[0:1]707; GFX10-GISEL-NEXT: v_add_f64 v[4:5], v[0:1], -v[2:3]708; GFX10-GISEL-NEXT: v_and_or_b32 v0, v0, 0, 0709; GFX10-GISEL-NEXT: v_cmp_ge_f64_e64 s4, |v[4:5]|, 0.5710; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v4, 0, 0x3ff00000, s4711; GFX10-GISEL-NEXT: v_and_or_b32 v1, 0x80000000, v1, v4712; GFX10-GISEL-NEXT: v_add_f64 v[0:1], v[2:3], v[0:1]713; GFX10-GISEL-NEXT: v_trunc_f64_e32 v[0:1], v[0:1]714; GFX10-GISEL-NEXT: v_mul_f64 v[2:3], 0x3df00000, v[0:1]715; GFX10-GISEL-NEXT: v_floor_f64_e32 v[2:3], v[2:3]716; GFX10-GISEL-NEXT: v_fma_f64 v[0:1], 0xc1f00000, v[2:3], v[0:1]717; GFX10-GISEL-NEXT: v_cvt_u32_f64_e32 v0, v[0:1]718; GFX10-GISEL-NEXT: v_cvt_i32_f64_e32 v1, v[2:3]719; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]720;721; GFX11-SDAG-LABEL: intrinsic_llround_i64_f64:722; GFX11-SDAG: ; %bb.0: ; %entry723; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)724; GFX11-SDAG-NEXT: v_trunc_f64_e32 v[2:3], v[0:1]725; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)726; GFX11-SDAG-NEXT: v_add_f64 v[4:5], v[0:1], -v[2:3]727; GFX11-SDAG-NEXT: v_mov_b32_e32 v0, 0728; GFX11-SDAG-NEXT: v_cmp_ge_f64_e64 s0, |v[4:5]|, 0.5729; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)730; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v4, 0, 0x3ff00000, s0731; GFX11-SDAG-NEXT: v_bfi_b32 v1, 0x7fffffff, v4, v1732; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)733; GFX11-SDAG-NEXT: v_add_f64 v[0:1], v[2:3], v[0:1]734; GFX11-SDAG-NEXT: v_trunc_f64_e32 v[0:1], v[0:1]735; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)736; GFX11-SDAG-NEXT: v_ldexp_f64 v[2:3], v[0:1], 0xffffffe0737; GFX11-SDAG-NEXT: v_floor_f64_e32 v[2:3], v[2:3]738; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)739; GFX11-SDAG-NEXT: v_fma_f64 v[0:1], 0xc1f00000, v[2:3], v[0:1]740; GFX11-SDAG-NEXT: v_cvt_u32_f64_e32 v0, v[0:1]741; GFX11-SDAG-NEXT: v_cvt_i32_f64_e32 v1, v[2:3]742; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]743;744; GFX11-GISEL-LABEL: intrinsic_llround_i64_f64:745; GFX11-GISEL: ; %bb.0: ; %entry746; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)747; GFX11-GISEL-NEXT: v_trunc_f64_e32 v[2:3], v[0:1]748; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)749; GFX11-GISEL-NEXT: v_add_f64 v[4:5], v[0:1], -v[2:3]750; GFX11-GISEL-NEXT: v_and_or_b32 v0, v0, 0, 0751; GFX11-GISEL-NEXT: v_cmp_ge_f64_e64 s0, |v[4:5]|, 0.5752; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)753; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v4, 0, 0x3ff00000, s0754; GFX11-GISEL-NEXT: v_and_or_b32 v1, 0x80000000, v1, v4755; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)756; GFX11-GISEL-NEXT: v_add_f64 v[0:1], v[2:3], v[0:1]757; GFX11-GISEL-NEXT: v_trunc_f64_e32 v[0:1], v[0:1]758; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)759; GFX11-GISEL-NEXT: v_mul_f64 v[2:3], 0x3df00000, v[0:1]760; GFX11-GISEL-NEXT: v_floor_f64_e32 v[2:3], v[2:3]761; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)762; GFX11-GISEL-NEXT: v_fma_f64 v[0:1], 0xc1f00000, v[2:3], v[0:1]763; GFX11-GISEL-NEXT: v_cvt_u32_f64_e32 v0, v[0:1]764; GFX11-GISEL-NEXT: v_cvt_i32_f64_e32 v1, v[2:3]765; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]766entry:767 %res = tail call i64 @llvm.llround.i64.f64(double %arg)768 ret i64 %res769}770 771define half @intrinsic_fround_half(half %arg) {772; GFX9-SDAG-LABEL: intrinsic_fround_half:773; GFX9-SDAG: ; %bb.0: ; %entry774; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)775; GFX9-SDAG-NEXT: v_trunc_f16_e32 v1, v0776; GFX9-SDAG-NEXT: v_sub_f16_e32 v2, v0, v1777; GFX9-SDAG-NEXT: v_mov_b32_e32 v3, 0x3c00778; GFX9-SDAG-NEXT: v_cmp_ge_f16_e64 vcc, |v2|, 0.5779; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v2, 0, v3, vcc780; GFX9-SDAG-NEXT: s_movk_i32 s4, 0x7fff781; GFX9-SDAG-NEXT: v_bfi_b32 v0, s4, v2, v0782; GFX9-SDAG-NEXT: v_add_f16_e32 v0, v1, v0783; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]784;785; GFX9-GISEL-LABEL: intrinsic_fround_half:786; GFX9-GISEL: ; %bb.0: ; %entry787; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)788; GFX9-GISEL-NEXT: v_trunc_f16_e32 v1, v0789; GFX9-GISEL-NEXT: v_sub_f16_e32 v2, v0, v1790; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, 0x3c00791; GFX9-GISEL-NEXT: v_cmp_ge_f16_e64 vcc, |v2|, 0.5792; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v2, 0, v3, vcc793; GFX9-GISEL-NEXT: v_and_b32_e32 v0, 0xffff8000, v0794; GFX9-GISEL-NEXT: v_or_b32_e32 v0, v2, v0795; GFX9-GISEL-NEXT: v_add_f16_e32 v0, v1, v0796; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]797;798; GFX10-SDAG-LABEL: intrinsic_fround_half:799; GFX10-SDAG: ; %bb.0: ; %entry800; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)801; GFX10-SDAG-NEXT: v_trunc_f16_e32 v1, v0802; GFX10-SDAG-NEXT: v_sub_f16_e32 v2, v0, v1803; GFX10-SDAG-NEXT: v_cmp_ge_f16_e64 s4, |v2|, 0.5804; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v2, 0, 0x3c00, s4805; GFX10-SDAG-NEXT: v_bfi_b32 v0, 0x7fff, v2, v0806; GFX10-SDAG-NEXT: v_add_f16_e32 v0, v1, v0807; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]808;809; GFX10-GISEL-LABEL: intrinsic_fround_half:810; GFX10-GISEL: ; %bb.0: ; %entry811; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)812; GFX10-GISEL-NEXT: v_trunc_f16_e32 v1, v0813; GFX10-GISEL-NEXT: v_sub_f16_e32 v2, v0, v1814; GFX10-GISEL-NEXT: v_and_b32_e32 v0, 0xffff8000, v0815; GFX10-GISEL-NEXT: v_cmp_ge_f16_e64 s4, |v2|, 0.5816; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v2, 0, 0x3c00, s4817; GFX10-GISEL-NEXT: v_or_b32_e32 v0, v2, v0818; GFX10-GISEL-NEXT: v_add_f16_e32 v0, v1, v0819; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]820;821; GFX11-SDAG-TRUE16-LABEL: intrinsic_fround_half:822; GFX11-SDAG-TRUE16: ; %bb.0: ; %entry823; GFX11-SDAG-TRUE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)824; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v1.l, v0.l825; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)826; GFX11-SDAG-TRUE16-NEXT: v_trunc_f16_e32 v1.h, v1.l827; GFX11-SDAG-TRUE16-NEXT: v_sub_f16_e32 v1.l, v1.l, v1.h828; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)829; GFX11-SDAG-TRUE16-NEXT: v_cmp_ge_f16_e64 s0, |v1.l|, 0.5830; GFX11-SDAG-TRUE16-NEXT: v_cndmask_b16 v1.l, 0, 0x3c00, s0831; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)832; GFX11-SDAG-TRUE16-NEXT: v_bfi_b32 v0, 0x7fff, v1, v0833; GFX11-SDAG-TRUE16-NEXT: v_add_f16_e32 v0.l, v1.h, v0.l834; GFX11-SDAG-TRUE16-NEXT: s_setpc_b64 s[30:31]835;836; GFX11-SDAG-FAKE16-LABEL: intrinsic_fround_half:837; GFX11-SDAG-FAKE16: ; %bb.0: ; %entry838; GFX11-SDAG-FAKE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)839; GFX11-SDAG-FAKE16-NEXT: v_trunc_f16_e32 v1, v0840; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)841; GFX11-SDAG-FAKE16-NEXT: v_sub_f16_e32 v2, v0, v1842; GFX11-SDAG-FAKE16-NEXT: v_cmp_ge_f16_e64 s0, |v2|, 0.5843; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)844; GFX11-SDAG-FAKE16-NEXT: v_cndmask_b32_e64 v2, 0, 0x3c00, s0845; GFX11-SDAG-FAKE16-NEXT: v_bfi_b32 v0, 0x7fff, v2, v0846; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1)847; GFX11-SDAG-FAKE16-NEXT: v_add_f16_e32 v0, v1, v0848; GFX11-SDAG-FAKE16-NEXT: s_setpc_b64 s[30:31]849;850; GFX11-GISEL-TRUE16-LABEL: intrinsic_fround_half:851; GFX11-GISEL-TRUE16: ; %bb.0: ; %entry852; GFX11-GISEL-TRUE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)853; GFX11-GISEL-TRUE16-NEXT: v_trunc_f16_e32 v0.h, v0.l854; GFX11-GISEL-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)855; GFX11-GISEL-TRUE16-NEXT: v_sub_f16_e32 v1.l, v0.l, v0.h856; GFX11-GISEL-TRUE16-NEXT: v_and_b16 v0.l, 0x8000, v0.l857; GFX11-GISEL-TRUE16-NEXT: v_cmp_ge_f16_e64 s0, |v1.l|, 0.5858; GFX11-GISEL-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)859; GFX11-GISEL-TRUE16-NEXT: v_cndmask_b16 v1.l, 0, 0x3c00, s0860; GFX11-GISEL-TRUE16-NEXT: v_or_b16 v0.l, v1.l, v0.l861; GFX11-GISEL-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1)862; GFX11-GISEL-TRUE16-NEXT: v_add_f16_e32 v0.l, v0.h, v0.l863; GFX11-GISEL-TRUE16-NEXT: s_setpc_b64 s[30:31]864;865; GFX11-GISEL-FAKE16-LABEL: intrinsic_fround_half:866; GFX11-GISEL-FAKE16: ; %bb.0: ; %entry867; GFX11-GISEL-FAKE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)868; GFX11-GISEL-FAKE16-NEXT: v_trunc_f16_e32 v1, v0869; GFX11-GISEL-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)870; GFX11-GISEL-FAKE16-NEXT: v_sub_f16_e32 v2, v0, v1871; GFX11-GISEL-FAKE16-NEXT: v_and_b32_e32 v0, 0xffff8000, v0872; GFX11-GISEL-FAKE16-NEXT: v_cmp_ge_f16_e64 s0, |v2|, 0.5873; GFX11-GISEL-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)874; GFX11-GISEL-FAKE16-NEXT: v_cndmask_b32_e64 v2, 0, 0x3c00, s0875; GFX11-GISEL-FAKE16-NEXT: v_or_b32_e32 v0, v2, v0876; GFX11-GISEL-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1)877; GFX11-GISEL-FAKE16-NEXT: v_add_f16_e32 v0, v1, v0878; GFX11-GISEL-FAKE16-NEXT: s_setpc_b64 s[30:31]879entry:880 %res = tail call half @llvm.round.f16(half %arg)881 ret half %res882}883 884define i32 @intrinsic_lround_i32_f16(half %arg) {885; GFX9-SDAG-LABEL: intrinsic_lround_i32_f16:886; GFX9-SDAG: ; %bb.0: ; %entry887; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)888; GFX9-SDAG-NEXT: v_trunc_f16_e32 v1, v0889; GFX9-SDAG-NEXT: v_sub_f16_e32 v2, v0, v1890; GFX9-SDAG-NEXT: v_mov_b32_e32 v3, 0x3c00891; GFX9-SDAG-NEXT: v_cmp_ge_f16_e64 vcc, |v2|, 0.5892; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v2, 0, v3, vcc893; GFX9-SDAG-NEXT: s_movk_i32 s4, 0x7fff894; GFX9-SDAG-NEXT: v_bfi_b32 v0, s4, v2, v0895; GFX9-SDAG-NEXT: v_add_f16_e32 v0, v1, v0896; GFX9-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0897; GFX9-SDAG-NEXT: v_cvt_i32_f32_e32 v0, v0898; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]899;900; GFX9-GISEL-LABEL: intrinsic_lround_i32_f16:901; GFX9-GISEL: ; %bb.0: ; %entry902; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)903; GFX9-GISEL-NEXT: v_trunc_f16_e32 v1, v0904; GFX9-GISEL-NEXT: v_sub_f16_e32 v2, v0, v1905; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, 0x3c00906; GFX9-GISEL-NEXT: v_cmp_ge_f16_e64 vcc, |v2|, 0.5907; GFX9-GISEL-NEXT: v_cndmask_b32_e32 v2, 0, v3, vcc908; GFX9-GISEL-NEXT: v_and_b32_e32 v0, 0xffff8000, v0909; GFX9-GISEL-NEXT: v_or_b32_e32 v0, v2, v0910; GFX9-GISEL-NEXT: v_add_f16_e32 v0, v1, v0911; GFX9-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0912; GFX9-GISEL-NEXT: v_cvt_i32_f32_e32 v0, v0913; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]914;915; GFX10-SDAG-LABEL: intrinsic_lround_i32_f16:916; GFX10-SDAG: ; %bb.0: ; %entry917; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)918; GFX10-SDAG-NEXT: v_trunc_f16_e32 v1, v0919; GFX10-SDAG-NEXT: v_sub_f16_e32 v2, v0, v1920; GFX10-SDAG-NEXT: v_cmp_ge_f16_e64 s4, |v2|, 0.5921; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v2, 0, 0x3c00, s4922; GFX10-SDAG-NEXT: v_bfi_b32 v0, 0x7fff, v2, v0923; GFX10-SDAG-NEXT: v_add_f16_e32 v0, v1, v0924; GFX10-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0925; GFX10-SDAG-NEXT: v_cvt_i32_f32_e32 v0, v0926; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]927;928; GFX10-GISEL-LABEL: intrinsic_lround_i32_f16:929; GFX10-GISEL: ; %bb.0: ; %entry930; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)931; GFX10-GISEL-NEXT: v_trunc_f16_e32 v1, v0932; GFX10-GISEL-NEXT: v_sub_f16_e32 v2, v0, v1933; GFX10-GISEL-NEXT: v_and_b32_e32 v0, 0xffff8000, v0934; GFX10-GISEL-NEXT: v_cmp_ge_f16_e64 s4, |v2|, 0.5935; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v2, 0, 0x3c00, s4936; GFX10-GISEL-NEXT: v_or_b32_e32 v0, v2, v0937; GFX10-GISEL-NEXT: v_add_f16_e32 v0, v1, v0938; GFX10-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0939; GFX10-GISEL-NEXT: v_cvt_i32_f32_e32 v0, v0940; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]941;942; GFX11-SDAG-TRUE16-LABEL: intrinsic_lround_i32_f16:943; GFX11-SDAG-TRUE16: ; %bb.0: ; %entry944; GFX11-SDAG-TRUE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)945; GFX11-SDAG-TRUE16-NEXT: v_mov_b16_e32 v1.l, v0.l946; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)947; GFX11-SDAG-TRUE16-NEXT: v_trunc_f16_e32 v1.h, v1.l948; GFX11-SDAG-TRUE16-NEXT: v_sub_f16_e32 v1.l, v1.l, v1.h949; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)950; GFX11-SDAG-TRUE16-NEXT: v_cmp_ge_f16_e64 s0, |v1.l|, 0.5951; GFX11-SDAG-TRUE16-NEXT: v_cndmask_b16 v1.l, 0, 0x3c00, s0952; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)953; GFX11-SDAG-TRUE16-NEXT: v_bfi_b32 v0, 0x7fff, v1, v0954; GFX11-SDAG-TRUE16-NEXT: v_add_f16_e32 v0.l, v1.h, v0.l955; GFX11-SDAG-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)956; GFX11-SDAG-TRUE16-NEXT: v_cvt_f32_f16_e32 v0, v0.l957; GFX11-SDAG-TRUE16-NEXT: v_cvt_i32_f32_e32 v0, v0958; GFX11-SDAG-TRUE16-NEXT: s_setpc_b64 s[30:31]959;960; GFX11-SDAG-FAKE16-LABEL: intrinsic_lround_i32_f16:961; GFX11-SDAG-FAKE16: ; %bb.0: ; %entry962; GFX11-SDAG-FAKE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)963; GFX11-SDAG-FAKE16-NEXT: v_trunc_f16_e32 v1, v0964; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)965; GFX11-SDAG-FAKE16-NEXT: v_sub_f16_e32 v2, v0, v1966; GFX11-SDAG-FAKE16-NEXT: v_cmp_ge_f16_e64 s0, |v2|, 0.5967; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)968; GFX11-SDAG-FAKE16-NEXT: v_cndmask_b32_e64 v2, 0, 0x3c00, s0969; GFX11-SDAG-FAKE16-NEXT: v_bfi_b32 v0, 0x7fff, v2, v0970; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)971; GFX11-SDAG-FAKE16-NEXT: v_add_f16_e32 v0, v1, v0972; GFX11-SDAG-FAKE16-NEXT: v_cvt_f32_f16_e32 v0, v0973; GFX11-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1)974; GFX11-SDAG-FAKE16-NEXT: v_cvt_i32_f32_e32 v0, v0975; GFX11-SDAG-FAKE16-NEXT: s_setpc_b64 s[30:31]976;977; GFX11-GISEL-TRUE16-LABEL: intrinsic_lround_i32_f16:978; GFX11-GISEL-TRUE16: ; %bb.0: ; %entry979; GFX11-GISEL-TRUE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)980; GFX11-GISEL-TRUE16-NEXT: v_trunc_f16_e32 v0.h, v0.l981; GFX11-GISEL-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)982; GFX11-GISEL-TRUE16-NEXT: v_sub_f16_e32 v1.l, v0.l, v0.h983; GFX11-GISEL-TRUE16-NEXT: v_and_b16 v0.l, 0x8000, v0.l984; GFX11-GISEL-TRUE16-NEXT: v_cmp_ge_f16_e64 s0, |v1.l|, 0.5985; GFX11-GISEL-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)986; GFX11-GISEL-TRUE16-NEXT: v_cndmask_b16 v1.l, 0, 0x3c00, s0987; GFX11-GISEL-TRUE16-NEXT: v_or_b16 v0.l, v1.l, v0.l988; GFX11-GISEL-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)989; GFX11-GISEL-TRUE16-NEXT: v_add_f16_e32 v0.l, v0.h, v0.l990; GFX11-GISEL-TRUE16-NEXT: v_cvt_f32_f16_e32 v0, v0.l991; GFX11-GISEL-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1)992; GFX11-GISEL-TRUE16-NEXT: v_cvt_i32_f32_e32 v0, v0993; GFX11-GISEL-TRUE16-NEXT: s_setpc_b64 s[30:31]994;995; GFX11-GISEL-FAKE16-LABEL: intrinsic_lround_i32_f16:996; GFX11-GISEL-FAKE16: ; %bb.0: ; %entry997; GFX11-GISEL-FAKE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)998; GFX11-GISEL-FAKE16-NEXT: v_trunc_f16_e32 v1, v0999; GFX11-GISEL-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)1000; GFX11-GISEL-FAKE16-NEXT: v_sub_f16_e32 v2, v0, v11001; GFX11-GISEL-FAKE16-NEXT: v_and_b32_e32 v0, 0xffff8000, v01002; GFX11-GISEL-FAKE16-NEXT: v_cmp_ge_f16_e64 s0, |v2|, 0.51003; GFX11-GISEL-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1004; GFX11-GISEL-FAKE16-NEXT: v_cndmask_b32_e64 v2, 0, 0x3c00, s01005; GFX11-GISEL-FAKE16-NEXT: v_or_b32_e32 v0, v2, v01006; GFX11-GISEL-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1007; GFX11-GISEL-FAKE16-NEXT: v_add_f16_e32 v0, v1, v01008; GFX11-GISEL-FAKE16-NEXT: v_cvt_f32_f16_e32 v0, v01009; GFX11-GISEL-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1)1010; GFX11-GISEL-FAKE16-NEXT: v_cvt_i32_f32_e32 v0, v01011; GFX11-GISEL-FAKE16-NEXT: s_setpc_b64 s[30:31]1012entry:1013 %res = tail call i32 @llvm.lround.i32.f16(half %arg)1014 ret i32 %res1015}1016 1017define <2 x i32> @intrinsic_lround_v2i32_v2f32(<2 x float> %arg) {1018; GFX9-SDAG-LABEL: intrinsic_lround_v2i32_v2f32:1019; GFX9-SDAG: ; %bb.0: ; %entry1020; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1021; GFX9-SDAG-NEXT: v_trunc_f32_e32 v2, v01022; GFX9-SDAG-NEXT: v_sub_f32_e32 v3, v0, v21023; GFX9-SDAG-NEXT: v_cmp_ge_f32_e64 s[4:5], |v3|, 0.51024; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v3, 0, 1.0, s[4:5]1025; GFX9-SDAG-NEXT: s_brev_b32 s6, -21026; GFX9-SDAG-NEXT: v_bfi_b32 v0, s6, v3, v01027; GFX9-SDAG-NEXT: v_add_f32_e32 v0, v2, v01028; GFX9-SDAG-NEXT: v_trunc_f32_e32 v2, v11029; GFX9-SDAG-NEXT: v_sub_f32_e32 v3, v1, v21030; GFX9-SDAG-NEXT: v_cmp_ge_f32_e64 s[4:5], |v3|, 0.51031; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v3, 0, 1.0, s[4:5]1032; GFX9-SDAG-NEXT: v_bfi_b32 v1, s6, v3, v11033; GFX9-SDAG-NEXT: v_add_f32_e32 v1, v2, v11034; GFX9-SDAG-NEXT: v_cvt_i32_f32_e32 v0, v01035; GFX9-SDAG-NEXT: v_cvt_i32_f32_e32 v1, v11036; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]1037;1038; GFX9-GISEL-LABEL: intrinsic_lround_v2i32_v2f32:1039; GFX9-GISEL: ; %bb.0: ; %entry1040; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1041; GFX9-GISEL-NEXT: v_trunc_f32_e32 v2, v01042; GFX9-GISEL-NEXT: v_sub_f32_e32 v3, v0, v21043; GFX9-GISEL-NEXT: v_cmp_ge_f32_e64 s[4:5], |v3|, 0.51044; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v3, 0, 1.0, s[4:5]1045; GFX9-GISEL-NEXT: v_bfrev_b32_e32 v4, 11046; GFX9-GISEL-NEXT: v_and_or_b32 v0, v0, v4, v31047; GFX9-GISEL-NEXT: v_add_f32_e32 v0, v2, v01048; GFX9-GISEL-NEXT: v_trunc_f32_e32 v2, v11049; GFX9-GISEL-NEXT: v_sub_f32_e32 v3, v1, v21050; GFX9-GISEL-NEXT: v_cmp_ge_f32_e64 s[4:5], |v3|, 0.51051; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v3, 0, 1.0, s[4:5]1052; GFX9-GISEL-NEXT: v_and_or_b32 v1, v1, v4, v31053; GFX9-GISEL-NEXT: v_add_f32_e32 v1, v2, v11054; GFX9-GISEL-NEXT: v_cvt_i32_f32_e32 v0, v01055; GFX9-GISEL-NEXT: v_cvt_i32_f32_e32 v1, v11056; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]1057;1058; GFX10-SDAG-LABEL: intrinsic_lround_v2i32_v2f32:1059; GFX10-SDAG: ; %bb.0: ; %entry1060; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1061; GFX10-SDAG-NEXT: v_trunc_f32_e32 v2, v01062; GFX10-SDAG-NEXT: v_trunc_f32_e32 v3, v11063; GFX10-SDAG-NEXT: v_sub_f32_e32 v4, v0, v21064; GFX10-SDAG-NEXT: v_sub_f32_e32 v5, v1, v31065; GFX10-SDAG-NEXT: v_cmp_ge_f32_e64 s4, |v4|, 0.51066; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v4, 0, 1.0, s41067; GFX10-SDAG-NEXT: v_cmp_ge_f32_e64 s4, |v5|, 0.51068; GFX10-SDAG-NEXT: v_bfi_b32 v0, 0x7fffffff, v4, v01069; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v5, 0, 1.0, s41070; GFX10-SDAG-NEXT: v_add_f32_e32 v0, v2, v01071; GFX10-SDAG-NEXT: v_bfi_b32 v1, 0x7fffffff, v5, v11072; GFX10-SDAG-NEXT: v_cvt_i32_f32_e32 v0, v01073; GFX10-SDAG-NEXT: v_add_f32_e32 v1, v3, v11074; GFX10-SDAG-NEXT: v_cvt_i32_f32_e32 v1, v11075; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]1076;1077; GFX10-GISEL-LABEL: intrinsic_lround_v2i32_v2f32:1078; GFX10-GISEL: ; %bb.0: ; %entry1079; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1080; GFX10-GISEL-NEXT: v_trunc_f32_e32 v2, v01081; GFX10-GISEL-NEXT: v_trunc_f32_e32 v3, v11082; GFX10-GISEL-NEXT: v_sub_f32_e32 v4, v0, v21083; GFX10-GISEL-NEXT: v_sub_f32_e32 v5, v1, v31084; GFX10-GISEL-NEXT: v_cmp_ge_f32_e64 s4, |v4|, 0.51085; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v4, 0, 1.0, s41086; GFX10-GISEL-NEXT: v_cmp_ge_f32_e64 s4, |v5|, 0.51087; GFX10-GISEL-NEXT: v_and_or_b32 v0, 0x80000000, v0, v41088; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v5, 0, 1.0, s41089; GFX10-GISEL-NEXT: v_add_f32_e32 v0, v2, v01090; GFX10-GISEL-NEXT: v_and_or_b32 v1, 0x80000000, v1, v51091; GFX10-GISEL-NEXT: v_cvt_i32_f32_e32 v0, v01092; GFX10-GISEL-NEXT: v_add_f32_e32 v1, v3, v11093; GFX10-GISEL-NEXT: v_cvt_i32_f32_e32 v1, v11094; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]1095;1096; GFX11-SDAG-LABEL: intrinsic_lround_v2i32_v2f32:1097; GFX11-SDAG: ; %bb.0: ; %entry1098; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1099; GFX11-SDAG-NEXT: v_trunc_f32_e32 v2, v01100; GFX11-SDAG-NEXT: v_trunc_f32_e32 v3, v11101; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1102; GFX11-SDAG-NEXT: v_dual_sub_f32 v4, v0, v2 :: v_dual_sub_f32 v5, v1, v31103; GFX11-SDAG-NEXT: v_cmp_ge_f32_e64 s0, |v4|, 0.51104; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)1105; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v4, 0, 1.0, s01106; GFX11-SDAG-NEXT: v_cmp_ge_f32_e64 s0, |v5|, 0.51107; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)1108; GFX11-SDAG-NEXT: v_bfi_b32 v0, 0x7fffffff, v4, v01109; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v5, 0, 1.0, s01110; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1111; GFX11-SDAG-NEXT: v_bfi_b32 v1, 0x7fffffff, v5, v11112; GFX11-SDAG-NEXT: v_dual_add_f32 v0, v2, v0 :: v_dual_add_f32 v1, v3, v11113; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)1114; GFX11-SDAG-NEXT: v_cvt_i32_f32_e32 v0, v01115; GFX11-SDAG-NEXT: v_cvt_i32_f32_e32 v1, v11116; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]1117;1118; GFX11-GISEL-LABEL: intrinsic_lround_v2i32_v2f32:1119; GFX11-GISEL: ; %bb.0: ; %entry1120; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1121; GFX11-GISEL-NEXT: v_trunc_f32_e32 v2, v01122; GFX11-GISEL-NEXT: v_trunc_f32_e32 v3, v11123; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1124; GFX11-GISEL-NEXT: v_dual_sub_f32 v4, v0, v2 :: v_dual_sub_f32 v5, v1, v31125; GFX11-GISEL-NEXT: v_cmp_ge_f32_e64 s0, |v4|, 0.51126; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)1127; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v4, 0, 1.0, s01128; GFX11-GISEL-NEXT: v_cmp_ge_f32_e64 s0, |v5|, 0.51129; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)1130; GFX11-GISEL-NEXT: v_and_or_b32 v0, 0x80000000, v0, v41131; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v5, 0, 1.0, s01132; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1133; GFX11-GISEL-NEXT: v_and_or_b32 v1, 0x80000000, v1, v51134; GFX11-GISEL-NEXT: v_dual_add_f32 v0, v2, v0 :: v_dual_add_f32 v1, v3, v11135; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)1136; GFX11-GISEL-NEXT: v_cvt_i32_f32_e32 v0, v01137; GFX11-GISEL-NEXT: v_cvt_i32_f32_e32 v1, v11138; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]1139entry:1140 %res = tail call <2 x i32> @llvm.lround.v2i32.v2f32(<2 x float> %arg)1141 ret <2 x i32> %res1142}1143 1144define <2 x i64> @intrinsic_lround_v2i64_v2f32(<2 x float> %arg) {1145; GFX9-SDAG-LABEL: intrinsic_lround_v2i64_v2f32:1146; GFX9-SDAG: ; %bb.0: ; %entry1147; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1148; GFX9-SDAG-NEXT: v_trunc_f32_e32 v2, v01149; GFX9-SDAG-NEXT: v_sub_f32_e32 v3, v0, v21150; GFX9-SDAG-NEXT: v_cmp_ge_f32_e64 s[4:5], |v3|, 0.51151; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v3, 0, 1.0, s[4:5]1152; GFX9-SDAG-NEXT: s_brev_b32 s6, -21153; GFX9-SDAG-NEXT: v_bfi_b32 v0, s6, v3, v01154; GFX9-SDAG-NEXT: v_add_f32_e32 v0, v2, v01155; GFX9-SDAG-NEXT: v_trunc_f32_e32 v0, v01156; GFX9-SDAG-NEXT: s_mov_b32 s7, 0x2f8000001157; GFX9-SDAG-NEXT: v_mul_f32_e64 v2, |v0|, s71158; GFX9-SDAG-NEXT: v_floor_f32_e32 v2, v21159; GFX9-SDAG-NEXT: s_mov_b32 s8, 0xcf8000001160; GFX9-SDAG-NEXT: v_fma_f32 v3, v2, s8, |v0|1161; GFX9-SDAG-NEXT: v_cvt_u32_f32_e32 v3, v31162; GFX9-SDAG-NEXT: v_ashrrev_i32_e32 v4, 31, v01163; GFX9-SDAG-NEXT: v_cvt_u32_f32_e32 v2, v21164; GFX9-SDAG-NEXT: v_xor_b32_e32 v0, v3, v41165; GFX9-SDAG-NEXT: v_trunc_f32_e32 v3, v11166; GFX9-SDAG-NEXT: v_sub_f32_e32 v5, v1, v31167; GFX9-SDAG-NEXT: v_cmp_ge_f32_e64 s[4:5], |v5|, 0.51168; GFX9-SDAG-NEXT: v_cndmask_b32_e64 v5, 0, 1.0, s[4:5]1169; GFX9-SDAG-NEXT: v_bfi_b32 v1, s6, v5, v11170; GFX9-SDAG-NEXT: v_add_f32_e32 v1, v3, v11171; GFX9-SDAG-NEXT: v_trunc_f32_e32 v3, v11172; GFX9-SDAG-NEXT: v_mul_f32_e64 v1, |v3|, s71173; GFX9-SDAG-NEXT: v_floor_f32_e32 v1, v11174; GFX9-SDAG-NEXT: v_fma_f32 v5, v1, s8, |v3|1175; GFX9-SDAG-NEXT: v_cvt_u32_f32_e32 v5, v51176; GFX9-SDAG-NEXT: v_cvt_u32_f32_e32 v6, v11177; GFX9-SDAG-NEXT: v_xor_b32_e32 v2, v2, v41178; GFX9-SDAG-NEXT: v_sub_co_u32_e32 v0, vcc, v0, v41179; GFX9-SDAG-NEXT: v_ashrrev_i32_e32 v3, 31, v31180; GFX9-SDAG-NEXT: v_subb_co_u32_e32 v1, vcc, v2, v4, vcc1181; GFX9-SDAG-NEXT: v_xor_b32_e32 v2, v5, v31182; GFX9-SDAG-NEXT: v_xor_b32_e32 v4, v6, v31183; GFX9-SDAG-NEXT: v_sub_co_u32_e32 v2, vcc, v2, v31184; GFX9-SDAG-NEXT: v_subb_co_u32_e32 v3, vcc, v4, v3, vcc1185; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]1186;1187; GFX9-GISEL-LABEL: intrinsic_lround_v2i64_v2f32:1188; GFX9-GISEL: ; %bb.0: ; %entry1189; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1190; GFX9-GISEL-NEXT: v_trunc_f32_e32 v2, v01191; GFX9-GISEL-NEXT: v_sub_f32_e32 v3, v0, v21192; GFX9-GISEL-NEXT: v_cmp_ge_f32_e64 s[4:5], |v3|, 0.51193; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v3, 0, 1.0, s[4:5]1194; GFX9-GISEL-NEXT: v_bfrev_b32_e32 v4, 11195; GFX9-GISEL-NEXT: v_and_or_b32 v0, v0, v4, v31196; GFX9-GISEL-NEXT: v_add_f32_e32 v0, v2, v01197; GFX9-GISEL-NEXT: v_trunc_f32_e32 v2, v01198; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, 0x2f8000001199; GFX9-GISEL-NEXT: v_mul_f32_e64 v5, |v2|, v31200; GFX9-GISEL-NEXT: v_floor_f32_e32 v5, v51201; GFX9-GISEL-NEXT: v_mov_b32_e32 v6, 0xcf8000001202; GFX9-GISEL-NEXT: v_fma_f32 v2, v5, v6, |v2|1203; GFX9-GISEL-NEXT: v_cvt_u32_f32_e32 v2, v21204; GFX9-GISEL-NEXT: v_cvt_u32_f32_e32 v5, v51205; GFX9-GISEL-NEXT: v_ashrrev_i32_e32 v7, 31, v01206; GFX9-GISEL-NEXT: v_xor_b32_e32 v0, v2, v71207; GFX9-GISEL-NEXT: v_xor_b32_e32 v2, v5, v71208; GFX9-GISEL-NEXT: v_trunc_f32_e32 v5, v11209; GFX9-GISEL-NEXT: v_sub_f32_e32 v8, v1, v51210; GFX9-GISEL-NEXT: v_cmp_ge_f32_e64 s[4:5], |v8|, 0.51211; GFX9-GISEL-NEXT: v_cndmask_b32_e64 v8, 0, 1.0, s[4:5]1212; GFX9-GISEL-NEXT: v_and_or_b32 v1, v1, v4, v81213; GFX9-GISEL-NEXT: v_add_f32_e32 v4, v5, v11214; GFX9-GISEL-NEXT: v_trunc_f32_e32 v1, v41215; GFX9-GISEL-NEXT: v_mul_f32_e64 v3, |v1|, v31216; GFX9-GISEL-NEXT: v_floor_f32_e32 v3, v31217; GFX9-GISEL-NEXT: v_fma_f32 v1, v3, v6, |v1|1218; GFX9-GISEL-NEXT: v_cvt_u32_f32_e32 v5, v11219; GFX9-GISEL-NEXT: v_cvt_u32_f32_e32 v3, v31220; GFX9-GISEL-NEXT: v_sub_co_u32_e32 v0, vcc, v0, v71221; GFX9-GISEL-NEXT: v_ashrrev_i32_e32 v4, 31, v41222; GFX9-GISEL-NEXT: v_subb_co_u32_e32 v1, vcc, v2, v7, vcc1223; GFX9-GISEL-NEXT: v_xor_b32_e32 v2, v5, v41224; GFX9-GISEL-NEXT: v_xor_b32_e32 v3, v3, v41225; GFX9-GISEL-NEXT: v_sub_co_u32_e32 v2, vcc, v2, v41226; GFX9-GISEL-NEXT: v_subb_co_u32_e32 v3, vcc, v3, v4, vcc1227; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]1228;1229; GFX10-SDAG-LABEL: intrinsic_lround_v2i64_v2f32:1230; GFX10-SDAG: ; %bb.0: ; %entry1231; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1232; GFX10-SDAG-NEXT: v_trunc_f32_e32 v2, v01233; GFX10-SDAG-NEXT: v_trunc_f32_e32 v3, v11234; GFX10-SDAG-NEXT: v_sub_f32_e32 v4, v0, v21235; GFX10-SDAG-NEXT: v_sub_f32_e32 v5, v1, v31236; GFX10-SDAG-NEXT: v_cmp_ge_f32_e64 s4, |v4|, 0.51237; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v4, 0, 1.0, s41238; GFX10-SDAG-NEXT: v_cmp_ge_f32_e64 s4, |v5|, 0.51239; GFX10-SDAG-NEXT: v_bfi_b32 v0, 0x7fffffff, v4, v01240; GFX10-SDAG-NEXT: v_cndmask_b32_e64 v5, 0, 1.0, s41241; GFX10-SDAG-NEXT: v_add_f32_e32 v0, v2, v01242; GFX10-SDAG-NEXT: v_bfi_b32 v1, 0x7fffffff, v5, v11243; GFX10-SDAG-NEXT: v_trunc_f32_e32 v0, v01244; GFX10-SDAG-NEXT: v_add_f32_e32 v1, v3, v11245; GFX10-SDAG-NEXT: v_mul_f32_e64 v2, 0x2f800000, |v0|1246; GFX10-SDAG-NEXT: v_trunc_f32_e32 v1, v11247; GFX10-SDAG-NEXT: v_ashrrev_i32_e32 v5, 31, v01248; GFX10-SDAG-NEXT: v_floor_f32_e32 v2, v21249; GFX10-SDAG-NEXT: v_mul_f32_e64 v3, 0x2f800000, |v1|1250; GFX10-SDAG-NEXT: v_ashrrev_i32_e32 v6, 31, v11251; GFX10-SDAG-NEXT: v_fma_f32 v4, 0xcf800000, v2, |v0|1252; GFX10-SDAG-NEXT: v_floor_f32_e32 v3, v31253; GFX10-SDAG-NEXT: v_cvt_u32_f32_e32 v2, v21254; GFX10-SDAG-NEXT: v_fma_f32 v0, 0xcf800000, v3, |v1|1255; GFX10-SDAG-NEXT: v_cvt_u32_f32_e32 v1, v41256; GFX10-SDAG-NEXT: v_cvt_u32_f32_e32 v3, v31257; GFX10-SDAG-NEXT: v_xor_b32_e32 v2, v2, v51258; GFX10-SDAG-NEXT: v_cvt_u32_f32_e32 v0, v01259; GFX10-SDAG-NEXT: v_xor_b32_e32 v1, v1, v51260; GFX10-SDAG-NEXT: v_xor_b32_e32 v3, v3, v61261; GFX10-SDAG-NEXT: v_xor_b32_e32 v4, v0, v61262; GFX10-SDAG-NEXT: v_sub_co_u32 v0, vcc_lo, v1, v51263; GFX10-SDAG-NEXT: v_sub_co_ci_u32_e32 v1, vcc_lo, v2, v5, vcc_lo1264; GFX10-SDAG-NEXT: v_sub_co_u32 v2, vcc_lo, v4, v61265; GFX10-SDAG-NEXT: v_sub_co_ci_u32_e32 v3, vcc_lo, v3, v6, vcc_lo1266; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]1267;1268; GFX10-GISEL-LABEL: intrinsic_lround_v2i64_v2f32:1269; GFX10-GISEL: ; %bb.0: ; %entry1270; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1271; GFX10-GISEL-NEXT: v_trunc_f32_e32 v2, v01272; GFX10-GISEL-NEXT: v_trunc_f32_e32 v3, v11273; GFX10-GISEL-NEXT: v_sub_f32_e32 v4, v0, v21274; GFX10-GISEL-NEXT: v_sub_f32_e32 v5, v1, v31275; GFX10-GISEL-NEXT: v_cmp_ge_f32_e64 s4, |v4|, 0.51276; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v4, 0, 1.0, s41277; GFX10-GISEL-NEXT: v_cmp_ge_f32_e64 s4, |v5|, 0.51278; GFX10-GISEL-NEXT: v_and_or_b32 v0, 0x80000000, v0, v41279; GFX10-GISEL-NEXT: v_cndmask_b32_e64 v5, 0, 1.0, s41280; GFX10-GISEL-NEXT: v_add_f32_e32 v0, v2, v01281; GFX10-GISEL-NEXT: v_and_or_b32 v1, 0x80000000, v1, v51282; GFX10-GISEL-NEXT: v_trunc_f32_e32 v2, v01283; GFX10-GISEL-NEXT: v_add_f32_e32 v1, v3, v11284; GFX10-GISEL-NEXT: v_ashrrev_i32_e32 v6, 31, v01285; GFX10-GISEL-NEXT: v_mul_f32_e64 v4, 0x2f800000, |v2|1286; GFX10-GISEL-NEXT: v_trunc_f32_e32 v3, v11287; GFX10-GISEL-NEXT: v_floor_f32_e32 v4, v41288; GFX10-GISEL-NEXT: v_mul_f32_e64 v5, 0x2f800000, |v3|1289; GFX10-GISEL-NEXT: v_fma_f32 v2, 0xcf800000, v4, |v2|1290; GFX10-GISEL-NEXT: v_floor_f32_e32 v5, v51291; GFX10-GISEL-NEXT: v_fma_f32 v0, 0xcf800000, v5, |v3|1292; GFX10-GISEL-NEXT: v_ashrrev_i32_e32 v3, 31, v11293; GFX10-GISEL-NEXT: v_cvt_u32_f32_e32 v1, v21294; GFX10-GISEL-NEXT: v_cvt_u32_f32_e32 v2, v41295; GFX10-GISEL-NEXT: v_cvt_u32_f32_e32 v4, v51296; GFX10-GISEL-NEXT: v_cvt_u32_f32_e32 v0, v01297; GFX10-GISEL-NEXT: v_xor_b32_e32 v1, v1, v61298; GFX10-GISEL-NEXT: v_xor_b32_e32 v2, v2, v61299; GFX10-GISEL-NEXT: v_xor_b32_e32 v4, v4, v31300; GFX10-GISEL-NEXT: v_xor_b32_e32 v5, v0, v31301; GFX10-GISEL-NEXT: v_sub_co_u32 v0, vcc_lo, v1, v61302; GFX10-GISEL-NEXT: v_sub_co_ci_u32_e32 v1, vcc_lo, v2, v6, vcc_lo1303; GFX10-GISEL-NEXT: v_sub_co_u32 v2, vcc_lo, v5, v31304; GFX10-GISEL-NEXT: v_sub_co_ci_u32_e32 v3, vcc_lo, v4, v3, vcc_lo1305; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]1306;1307; GFX11-SDAG-LABEL: intrinsic_lround_v2i64_v2f32:1308; GFX11-SDAG: ; %bb.0: ; %entry1309; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1310; GFX11-SDAG-NEXT: v_trunc_f32_e32 v2, v01311; GFX11-SDAG-NEXT: v_trunc_f32_e32 v3, v11312; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1313; GFX11-SDAG-NEXT: v_dual_sub_f32 v4, v0, v2 :: v_dual_sub_f32 v5, v1, v31314; GFX11-SDAG-NEXT: v_cmp_ge_f32_e64 s0, |v4|, 0.51315; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)1316; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v4, 0, 1.0, s01317; GFX11-SDAG-NEXT: v_cmp_ge_f32_e64 s0, |v5|, 0.51318; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)1319; GFX11-SDAG-NEXT: v_bfi_b32 v0, 0x7fffffff, v4, v01320; GFX11-SDAG-NEXT: v_cndmask_b32_e64 v5, 0, 1.0, s01321; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1322; GFX11-SDAG-NEXT: v_bfi_b32 v1, 0x7fffffff, v5, v11323; GFX11-SDAG-NEXT: v_dual_add_f32 v0, v2, v0 :: v_dual_add_f32 v1, v3, v11324; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)1325; GFX11-SDAG-NEXT: v_trunc_f32_e32 v0, v01326; GFX11-SDAG-NEXT: v_trunc_f32_e32 v1, v11327; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)1328; GFX11-SDAG-NEXT: v_mul_f32_e64 v2, 0x2f800000, |v0|1329; GFX11-SDAG-NEXT: v_ashrrev_i32_e32 v5, 31, v01330; GFX11-SDAG-NEXT: v_mul_f32_e64 v3, 0x2f800000, |v1|1331; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_3)1332; GFX11-SDAG-NEXT: v_floor_f32_e32 v2, v21333; GFX11-SDAG-NEXT: v_ashrrev_i32_e32 v6, 31, v11334; GFX11-SDAG-NEXT: v_floor_f32_e32 v3, v31335; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_3)1336; GFX11-SDAG-NEXT: v_fma_f32 v4, 0xcf800000, v2, |v0|1337; GFX11-SDAG-NEXT: v_cvt_u32_f32_e32 v2, v21338; GFX11-SDAG-NEXT: v_fma_f32 v0, 0xcf800000, v3, |v1|1339; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_4)1340; GFX11-SDAG-NEXT: v_cvt_u32_f32_e32 v1, v41341; GFX11-SDAG-NEXT: v_cvt_u32_f32_e32 v3, v31342; GFX11-SDAG-NEXT: v_xor_b32_e32 v2, v2, v51343; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)1344; GFX11-SDAG-NEXT: v_cvt_u32_f32_e32 v0, v01345; GFX11-SDAG-NEXT: v_xor_b32_e32 v1, v1, v51346; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)1347; GFX11-SDAG-NEXT: v_xor_b32_e32 v3, v3, v61348; GFX11-SDAG-NEXT: v_xor_b32_e32 v4, v0, v61349; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)1350; GFX11-SDAG-NEXT: v_sub_co_u32 v0, vcc_lo, v1, v51351; GFX11-SDAG-NEXT: v_sub_co_ci_u32_e64 v1, null, v2, v5, vcc_lo1352; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)1353; GFX11-SDAG-NEXT: v_sub_co_u32 v2, vcc_lo, v4, v61354; GFX11-SDAG-NEXT: v_sub_co_ci_u32_e64 v3, null, v3, v6, vcc_lo1355; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]1356;1357; GFX11-GISEL-LABEL: intrinsic_lround_v2i64_v2f32:1358; GFX11-GISEL: ; %bb.0: ; %entry1359; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1360; GFX11-GISEL-NEXT: v_trunc_f32_e32 v2, v01361; GFX11-GISEL-NEXT: v_trunc_f32_e32 v3, v11362; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1363; GFX11-GISEL-NEXT: v_dual_sub_f32 v4, v0, v2 :: v_dual_sub_f32 v5, v1, v31364; GFX11-GISEL-NEXT: v_cmp_ge_f32_e64 s0, |v4|, 0.51365; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)1366; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v4, 0, 1.0, s01367; GFX11-GISEL-NEXT: v_cmp_ge_f32_e64 s0, |v5|, 0.51368; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)1369; GFX11-GISEL-NEXT: v_and_or_b32 v0, 0x80000000, v0, v41370; GFX11-GISEL-NEXT: v_cndmask_b32_e64 v5, 0, 1.0, s01371; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)1372; GFX11-GISEL-NEXT: v_and_or_b32 v1, 0x80000000, v1, v51373; GFX11-GISEL-NEXT: v_dual_add_f32 v0, v2, v0 :: v_dual_add_f32 v1, v3, v11374; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_3)1375; GFX11-GISEL-NEXT: v_trunc_f32_e32 v2, v01376; GFX11-GISEL-NEXT: v_ashrrev_i32_e32 v6, 31, v01377; GFX11-GISEL-NEXT: v_trunc_f32_e32 v3, v11378; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)1379; GFX11-GISEL-NEXT: v_mul_f32_e64 v4, 0x2f800000, |v2|1380; GFX11-GISEL-NEXT: v_mul_f32_e64 v5, 0x2f800000, |v3|1381; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)1382; GFX11-GISEL-NEXT: v_floor_f32_e32 v4, v41383; GFX11-GISEL-NEXT: v_floor_f32_e32 v5, v51384; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)1385; GFX11-GISEL-NEXT: v_fma_f32 v2, 0xcf800000, v4, |v2|1386; GFX11-GISEL-NEXT: v_fma_f32 v0, 0xcf800000, v5, |v3|1387; GFX11-GISEL-NEXT: v_ashrrev_i32_e32 v3, 31, v11388; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_3) | instid1(VALU_DEP_4)1389; GFX11-GISEL-NEXT: v_cvt_u32_f32_e32 v1, v21390; GFX11-GISEL-NEXT: v_cvt_u32_f32_e32 v2, v41391; GFX11-GISEL-NEXT: v_cvt_u32_f32_e32 v4, v51392; GFX11-GISEL-NEXT: v_cvt_u32_f32_e32 v0, v01393; GFX11-GISEL-NEXT: v_xor_b32_e32 v1, v1, v61394; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)1395; GFX11-GISEL-NEXT: v_xor_b32_e32 v2, v2, v61396; GFX11-GISEL-NEXT: v_xor_b32_e32 v4, v4, v31397; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)1398; GFX11-GISEL-NEXT: v_xor_b32_e32 v5, v0, v31399; GFX11-GISEL-NEXT: v_sub_co_u32 v0, vcc_lo, v1, v61400; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)1401; GFX11-GISEL-NEXT: v_sub_co_ci_u32_e64 v1, null, v2, v6, vcc_lo1402; GFX11-GISEL-NEXT: v_sub_co_u32 v2, vcc_lo, v5, v31403; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)1404; GFX11-GISEL-NEXT: v_sub_co_ci_u32_e64 v3, null, v4, v3, vcc_lo1405; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]1406entry:1407 %res = tail call <2 x i64> @llvm.lround.v2i64.v2f32(<2 x float> %arg)1408 ret <2 x i64> %res1409}1410