; TONGA-NEXT: s_waitcnt lgkmcnt(0)
; TONGA-NEXT: s_mov_b32 s0, s14
; TONGA-NEXT: s_mov_b32 s1, s15
-; TONGA-NEXT: buffer_load_dwordx4 v[4:7], off, s[0:3], 0 offset:16
; TONGA-NEXT: buffer_load_dwordx4 v[0:3], off, s[0:3], 0
+; TONGA-NEXT: buffer_load_dwordx4 v[4:7], off, s[0:3], 0 offset:16
; TONGA-NEXT: s_mov_b32 s14, 0x4f800000
; TONGA-NEXT: s_mov_b32 s8, s12
; TONGA-NEXT: s_mov_b32 s9, s13
; TONGA-NEXT: s_waitcnt vmcnt(1)
+; TONGA-NEXT: v_ashrrev_i32_e32 v8, 31, v0
+; TONGA-NEXT: s_waitcnt vmcnt(0)
; TONGA-NEXT: v_ashrrev_i32_e32 v9, 31, v4
; TONGA-NEXT: v_add_u32_e32 v4, vcc, v9, v4
-; TONGA-NEXT: s_waitcnt vmcnt(0)
-; TONGA-NEXT: v_ashrrev_i32_e32 v8, 31, v0
; TONGA-NEXT: v_xor_b32_e32 v4, v4, v9
; TONGA-NEXT: v_xor_b32_e32 v15, v8, v9
; TONGA-NEXT: v_cvt_f32_u32_e32 v9, v4
; GFX9-NEXT: s_waitcnt lgkmcnt(0)
; GFX9-NEXT: s_mov_b32 s0, s10
; GFX9-NEXT: s_mov_b32 s1, s11
-; GFX9-NEXT: buffer_load_dwordx4 v[4:7], off, s[0:3], 0 offset:16
; GFX9-NEXT: buffer_load_dwordx4 v[0:3], off, s[0:3], 0
+; GFX9-NEXT: buffer_load_dwordx4 v[4:7], off, s[0:3], 0 offset:16
; GFX9-NEXT: s_mov_b32 s4, 0x4f800000
; GFX9-NEXT: s_mov_b32 s12, s8
; GFX9-NEXT: s_mov_b32 s13, s9
; GFX9-NEXT: s_waitcnt vmcnt(1)
-; GFX9-NEXT: v_ashrrev_i32_e32 v9, 31, v4
-; GFX9-NEXT: s_waitcnt vmcnt(0)
; GFX9-NEXT: v_ashrrev_i32_e32 v8, 31, v0
+; GFX9-NEXT: s_waitcnt vmcnt(0)
+; GFX9-NEXT: v_ashrrev_i32_e32 v9, 31, v4
; GFX9-NEXT: v_add_u32_e32 v4, v4, v9
; GFX9-NEXT: v_add_u32_e32 v0, v0, v8
; GFX9-NEXT: v_xor_b32_e32 v4, v4, v9
; TONGA-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
; TONGA-NEXT: s_mov_b32 s3, 0xf000
; TONGA-NEXT: s_mov_b32 s2, -1
+; TONGA-NEXT: s_mov_b32 s10, s2
+; TONGA-NEXT: s_mov_b32 s11, s3
; TONGA-NEXT: s_waitcnt lgkmcnt(0)
+; TONGA-NEXT: s_mov_b32 s8, s6
+; TONGA-NEXT: s_mov_b32 s9, s7
+; TONGA-NEXT: buffer_load_sbyte v0, off, s[8:11], 0
+; TONGA-NEXT: buffer_load_sbyte v1, off, s[8:11], 0 offset:1
; TONGA-NEXT: s_mov_b32 s0, s4
; TONGA-NEXT: s_mov_b32 s1, s5
-; TONGA-NEXT: s_mov_b32 s4, s6
-; TONGA-NEXT: s_mov_b32 s5, s7
-; TONGA-NEXT: s_mov_b32 s6, s2
-; TONGA-NEXT: s_mov_b32 s7, s3
-; TONGA-NEXT: buffer_load_sbyte v0, off, s[4:7], 0 offset:1
-; TONGA-NEXT: buffer_load_sbyte v2, off, s[4:7], 0
; TONGA-NEXT: s_waitcnt vmcnt(1)
-; TONGA-NEXT: v_cvt_f32_i32_e32 v1, v0
+; TONGA-NEXT: v_cvt_f32_i32_e32 v3, v0
; TONGA-NEXT: s_waitcnt vmcnt(0)
-; TONGA-NEXT: v_cvt_f32_i32_e32 v3, v2
-; TONGA-NEXT: v_xor_b32_e32 v0, v2, v0
+; TONGA-NEXT: v_cvt_f32_i32_e32 v2, v1
+; TONGA-NEXT: v_xor_b32_e32 v0, v0, v1
; TONGA-NEXT: v_ashrrev_i32_e32 v0, 30, v0
-; TONGA-NEXT: v_rcp_iflag_f32_e32 v4, v1
; TONGA-NEXT: v_or_b32_e32 v0, 1, v0
-; TONGA-NEXT: v_mul_f32_e32 v2, v3, v4
-; TONGA-NEXT: v_trunc_f32_e32 v2, v2
-; TONGA-NEXT: v_mad_f32 v3, -v2, v1, v3
-; TONGA-NEXT: v_cvt_i32_f32_e32 v2, v2
-; TONGA-NEXT: v_cmp_ge_f32_e64 vcc, |v3|, |v1|
+; TONGA-NEXT: v_rcp_iflag_f32_e32 v4, v2
+; TONGA-NEXT: v_mul_f32_e32 v1, v3, v4
+; TONGA-NEXT: v_trunc_f32_e32 v1, v1
+; TONGA-NEXT: v_mad_f32 v3, -v1, v2, v3
+; TONGA-NEXT: v_cvt_i32_f32_e32 v1, v1
+; TONGA-NEXT: v_cmp_ge_f32_e64 vcc, |v3|, |v2|
; TONGA-NEXT: v_cndmask_b32_e32 v0, 0, v0, vcc
-; TONGA-NEXT: v_add_u32_e32 v0, vcc, v0, v2
+; TONGA-NEXT: v_add_u32_e32 v0, vcc, v0, v1
; TONGA-NEXT: v_bfe_i32 v0, v0, 0, 8
; TONGA-NEXT: buffer_store_dword v0, off, s[0:3], 0
; TONGA-NEXT: s_endpgm
; GFX9-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
; GFX9-NEXT: s_mov_b32 s3, 0xf000
; GFX9-NEXT: s_mov_b32 s2, -1
+; GFX9-NEXT: s_mov_b32 s10, s2
+; GFX9-NEXT: s_mov_b32 s11, s3
; GFX9-NEXT: s_waitcnt lgkmcnt(0)
+; GFX9-NEXT: s_mov_b32 s8, s6
+; GFX9-NEXT: s_mov_b32 s9, s7
+; GFX9-NEXT: buffer_load_sbyte v0, off, s[8:11], 0
+; GFX9-NEXT: buffer_load_sbyte v1, off, s[8:11], 0 offset:1
; GFX9-NEXT: s_mov_b32 s0, s4
; GFX9-NEXT: s_mov_b32 s1, s5
-; GFX9-NEXT: s_mov_b32 s4, s6
-; GFX9-NEXT: s_mov_b32 s5, s7
-; GFX9-NEXT: s_mov_b32 s6, s2
-; GFX9-NEXT: s_mov_b32 s7, s3
-; GFX9-NEXT: buffer_load_sbyte v0, off, s[4:7], 0 offset:1
-; GFX9-NEXT: buffer_load_sbyte v2, off, s[4:7], 0
; GFX9-NEXT: s_waitcnt vmcnt(1)
-; GFX9-NEXT: v_cvt_f32_i32_e32 v1, v0
+; GFX9-NEXT: v_cvt_f32_i32_e32 v3, v0
; GFX9-NEXT: s_waitcnt vmcnt(0)
-; GFX9-NEXT: v_cvt_f32_i32_e32 v3, v2
-; GFX9-NEXT: v_xor_b32_e32 v0, v2, v0
+; GFX9-NEXT: v_cvt_f32_i32_e32 v2, v1
+; GFX9-NEXT: v_xor_b32_e32 v0, v0, v1
; GFX9-NEXT: v_ashrrev_i32_e32 v0, 30, v0
-; GFX9-NEXT: v_rcp_iflag_f32_e32 v4, v1
; GFX9-NEXT: v_or_b32_e32 v0, 1, v0
-; GFX9-NEXT: v_mul_f32_e32 v2, v3, v4
-; GFX9-NEXT: v_trunc_f32_e32 v2, v2
-; GFX9-NEXT: v_cvt_i32_f32_e32 v4, v2
-; GFX9-NEXT: v_mad_f32 v2, -v2, v1, v3
-; GFX9-NEXT: v_cmp_ge_f32_e64 vcc, |v2|, |v1|
+; GFX9-NEXT: v_rcp_iflag_f32_e32 v4, v2
+; GFX9-NEXT: v_mul_f32_e32 v1, v3, v4
+; GFX9-NEXT: v_trunc_f32_e32 v1, v1
+; GFX9-NEXT: v_cvt_i32_f32_e32 v4, v1
+; GFX9-NEXT: v_mad_f32 v1, -v1, v2, v3
+; GFX9-NEXT: v_cmp_ge_f32_e64 vcc, |v1|, |v2|
; GFX9-NEXT: v_cndmask_b32_e32 v0, 0, v0, vcc
; GFX9-NEXT: v_add_u32_e32 v0, v4, v0
; GFX9-NEXT: v_bfe_i32 v0, v0, 0, 8
; GCN-NEXT: s_mov_b32 s10, s6
; GCN-NEXT: s_mov_b32 s11, s7
; GCN-NEXT: s_waitcnt lgkmcnt(0)
-; GCN-NEXT: s_mov_b32 s4, s0
-; GCN-NEXT: s_mov_b32 s5, s1
; GCN-NEXT: s_mov_b32 s8, s2
; GCN-NEXT: s_mov_b32 s9, s3
; GCN-NEXT: buffer_load_ubyte v1, off, s[8:11], 0 offset:2
; GCN-NEXT: buffer_load_ubyte v3, off, s[8:11], 0 offset:6
; GCN-NEXT: buffer_load_ushort v0, off, s[8:11], 0
; GCN-NEXT: buffer_load_ushort v2, off, s[8:11], 0 offset:4
+; GCN-NEXT: s_mov_b32 s4, s0
+; GCN-NEXT: s_mov_b32 s5, s1
; GCN-NEXT: s_waitcnt vmcnt(3)
; GCN-NEXT: v_lshlrev_b32_e32 v1, 16, v1
; GCN-NEXT: s_waitcnt vmcnt(2)
; TONGA-NEXT: s_mov_b32 s5, s7
; TONGA-NEXT: s_mov_b32 s6, s2
; TONGA-NEXT: s_mov_b32 s7, s3
-; TONGA-NEXT: buffer_load_ubyte v0, off, s[4:7], 0 offset:2
-; TONGA-NEXT: buffer_load_ushort v1, off, s[4:7], 0 offset:4
-; TONGA-NEXT: buffer_load_ubyte v2, off, s[4:7], 0 offset:6
-; TONGA-NEXT: buffer_load_ushort v3, off, s[4:7], 0
-; TONGA-NEXT: s_waitcnt vmcnt(3)
-; TONGA-NEXT: v_lshlrev_b32_e32 v0, 16, v0
-; TONGA-NEXT: s_waitcnt vmcnt(1)
-; TONGA-NEXT: v_lshlrev_b32_e32 v2, 16, v2
-; TONGA-NEXT: v_or_b32_e32 v1, v1, v2
-; TONGA-NEXT: v_bfe_i32 v1, v1, 0, 23
-; TONGA-NEXT: v_cvt_f32_i32_e32 v2, v1
+; TONGA-NEXT: buffer_load_ushort v0, off, s[4:7], 0
+; TONGA-NEXT: buffer_load_ubyte v1, off, s[4:7], 0 offset:2
+; TONGA-NEXT: buffer_load_ushort v2, off, s[4:7], 0 offset:4
+; TONGA-NEXT: buffer_load_ubyte v3, off, s[4:7], 0 offset:6
+; TONGA-NEXT: s_waitcnt vmcnt(2)
+; TONGA-NEXT: v_lshlrev_b32_e32 v1, 16, v1
+; TONGA-NEXT: v_or_b32_e32 v0, v0, v1
; TONGA-NEXT: s_waitcnt vmcnt(0)
-; TONGA-NEXT: v_or_b32_e32 v0, v3, v0
+; TONGA-NEXT: v_lshlrev_b32_e32 v3, 16, v3
+; TONGA-NEXT: v_or_b32_e32 v2, v2, v3
+; TONGA-NEXT: v_bfe_i32 v2, v2, 0, 23
+; TONGA-NEXT: v_cvt_f32_i32_e32 v3, v2
; TONGA-NEXT: v_bfe_i32 v0, v0, 0, 23
-; TONGA-NEXT: v_cvt_f32_i32_e32 v3, v0
-; TONGA-NEXT: v_rcp_iflag_f32_e32 v4, v2
-; TONGA-NEXT: v_xor_b32_e32 v0, v0, v1
+; TONGA-NEXT: v_cvt_f32_i32_e32 v1, v0
+; TONGA-NEXT: v_xor_b32_e32 v0, v0, v2
+; TONGA-NEXT: v_rcp_iflag_f32_e32 v4, v3
; TONGA-NEXT: v_ashrrev_i32_e32 v0, 30, v0
; TONGA-NEXT: v_or_b32_e32 v0, 1, v0
-; TONGA-NEXT: v_mul_f32_e32 v1, v3, v4
-; TONGA-NEXT: v_trunc_f32_e32 v1, v1
-; TONGA-NEXT: v_mad_f32 v3, -v1, v2, v3
-; TONGA-NEXT: v_cvt_i32_f32_e32 v1, v1
-; TONGA-NEXT: v_cmp_ge_f32_e64 vcc, |v3|, |v2|
+; TONGA-NEXT: v_mul_f32_e32 v2, v1, v4
+; TONGA-NEXT: v_trunc_f32_e32 v2, v2
+; TONGA-NEXT: v_mad_f32 v1, -v2, v3, v1
+; TONGA-NEXT: v_cvt_i32_f32_e32 v2, v2
+; TONGA-NEXT: v_cmp_ge_f32_e64 vcc, |v1|, |v3|
; TONGA-NEXT: v_cndmask_b32_e32 v0, 0, v0, vcc
-; TONGA-NEXT: v_add_u32_e32 v0, vcc, v0, v1
+; TONGA-NEXT: v_add_u32_e32 v0, vcc, v0, v2
; TONGA-NEXT: v_bfe_i32 v0, v0, 0, 23
; TONGA-NEXT: buffer_store_dword v0, off, s[0:3], 0
; TONGA-NEXT: s_endpgm
; GFX9-NEXT: s_mov_b32 s5, s7
; GFX9-NEXT: s_mov_b32 s6, s2
; GFX9-NEXT: s_mov_b32 s7, s3
-; GFX9-NEXT: buffer_load_ubyte v0, off, s[4:7], 0 offset:2
-; GFX9-NEXT: buffer_load_ushort v1, off, s[4:7], 0 offset:4
-; GFX9-NEXT: buffer_load_ubyte v2, off, s[4:7], 0 offset:6
-; GFX9-NEXT: buffer_load_ushort v3, off, s[4:7], 0
-; GFX9-NEXT: s_waitcnt vmcnt(3)
-; GFX9-NEXT: v_lshlrev_b32_e32 v0, 16, v0
-; GFX9-NEXT: s_waitcnt vmcnt(1)
-; GFX9-NEXT: v_lshlrev_b32_e32 v2, 16, v2
-; GFX9-NEXT: v_or_b32_e32 v1, v1, v2
-; GFX9-NEXT: v_bfe_i32 v1, v1, 0, 23
-; GFX9-NEXT: v_cvt_f32_i32_e32 v2, v1
+; GFX9-NEXT: buffer_load_ushort v0, off, s[4:7], 0
+; GFX9-NEXT: buffer_load_ubyte v1, off, s[4:7], 0 offset:2
+; GFX9-NEXT: buffer_load_ushort v2, off, s[4:7], 0 offset:4
+; GFX9-NEXT: buffer_load_ubyte v3, off, s[4:7], 0 offset:6
+; GFX9-NEXT: s_waitcnt vmcnt(2)
+; GFX9-NEXT: v_lshlrev_b32_e32 v1, 16, v1
+; GFX9-NEXT: v_or_b32_e32 v0, v0, v1
; GFX9-NEXT: s_waitcnt vmcnt(0)
-; GFX9-NEXT: v_or_b32_e32 v0, v3, v0
+; GFX9-NEXT: v_lshlrev_b32_e32 v3, 16, v3
+; GFX9-NEXT: v_or_b32_e32 v2, v2, v3
+; GFX9-NEXT: v_bfe_i32 v2, v2, 0, 23
+; GFX9-NEXT: v_cvt_f32_i32_e32 v3, v2
; GFX9-NEXT: v_bfe_i32 v0, v0, 0, 23
-; GFX9-NEXT: v_cvt_f32_i32_e32 v3, v0
-; GFX9-NEXT: v_rcp_iflag_f32_e32 v4, v2
-; GFX9-NEXT: v_xor_b32_e32 v0, v0, v1
+; GFX9-NEXT: v_cvt_f32_i32_e32 v1, v0
+; GFX9-NEXT: v_xor_b32_e32 v0, v0, v2
+; GFX9-NEXT: v_rcp_iflag_f32_e32 v4, v3
; GFX9-NEXT: v_ashrrev_i32_e32 v0, 30, v0
; GFX9-NEXT: v_or_b32_e32 v0, 1, v0
-; GFX9-NEXT: v_mul_f32_e32 v1, v3, v4
-; GFX9-NEXT: v_trunc_f32_e32 v1, v1
-; GFX9-NEXT: v_cvt_i32_f32_e32 v4, v1
-; GFX9-NEXT: v_mad_f32 v1, -v1, v2, v3
-; GFX9-NEXT: v_cmp_ge_f32_e64 vcc, |v1|, |v2|
+; GFX9-NEXT: v_mul_f32_e32 v2, v1, v4
+; GFX9-NEXT: v_trunc_f32_e32 v2, v2
+; GFX9-NEXT: v_cvt_i32_f32_e32 v4, v2
+; GFX9-NEXT: v_mad_f32 v1, -v2, v3, v1
+; GFX9-NEXT: v_cmp_ge_f32_e64 vcc, |v1|, |v3|
; GFX9-NEXT: v_cndmask_b32_e32 v0, 0, v0, vcc
; GFX9-NEXT: v_add_u32_e32 v0, v4, v0
; GFX9-NEXT: v_bfe_i32 v0, v0, 0, 23
; GCN-NEXT: s_mov_b32 s10, s6
; GCN-NEXT: s_mov_b32 s11, s7
; GCN-NEXT: s_waitcnt lgkmcnt(0)
-; GCN-NEXT: s_mov_b32 s4, s0
-; GCN-NEXT: s_mov_b32 s5, s1
; GCN-NEXT: s_mov_b32 s8, s2
; GCN-NEXT: s_mov_b32 s9, s3
; GCN-NEXT: buffer_load_sbyte v1, off, s[8:11], 0 offset:2
; GCN-NEXT: buffer_load_sbyte v3, off, s[8:11], 0 offset:6
; GCN-NEXT: buffer_load_ushort v0, off, s[8:11], 0
; GCN-NEXT: buffer_load_ushort v2, off, s[8:11], 0 offset:4
+; GCN-NEXT: s_mov_b32 s4, s0
+; GCN-NEXT: s_mov_b32 s5, s1
; GCN-NEXT: s_waitcnt vmcnt(3)
; GCN-NEXT: v_lshlrev_b32_e32 v1, 16, v1
; GCN-NEXT: s_waitcnt vmcnt(2)
; TONGA-NEXT: s_mov_b32 s5, s7
; TONGA-NEXT: s_mov_b32 s6, s2
; TONGA-NEXT: s_mov_b32 s7, s3
-; TONGA-NEXT: buffer_load_sbyte v0, off, s[4:7], 0 offset:2
-; TONGA-NEXT: buffer_load_ushort v1, off, s[4:7], 0 offset:4
-; TONGA-NEXT: buffer_load_sbyte v2, off, s[4:7], 0 offset:6
-; TONGA-NEXT: buffer_load_ushort v3, off, s[4:7], 0
-; TONGA-NEXT: s_waitcnt vmcnt(3)
-; TONGA-NEXT: v_lshlrev_b32_e32 v0, 16, v0
-; TONGA-NEXT: s_waitcnt vmcnt(1)
-; TONGA-NEXT: v_lshlrev_b32_e32 v2, 16, v2
-; TONGA-NEXT: v_or_b32_e32 v1, v1, v2
-; TONGA-NEXT: v_cvt_f32_i32_e32 v1, v1
+; TONGA-NEXT: buffer_load_ushort v0, off, s[4:7], 0
+; TONGA-NEXT: buffer_load_sbyte v1, off, s[4:7], 0 offset:2
+; TONGA-NEXT: buffer_load_ushort v2, off, s[4:7], 0 offset:4
+; TONGA-NEXT: buffer_load_sbyte v3, off, s[4:7], 0 offset:6
+; TONGA-NEXT: s_waitcnt vmcnt(2)
+; TONGA-NEXT: v_lshlrev_b32_e32 v1, 16, v1
+; TONGA-NEXT: v_or_b32_e32 v0, v0, v1
; TONGA-NEXT: s_waitcnt vmcnt(0)
-; TONGA-NEXT: v_or_b32_e32 v3, v3, v0
-; TONGA-NEXT: v_cvt_f32_i32_e32 v3, v3
-; TONGA-NEXT: v_xor_b32_e32 v0, v0, v2
-; TONGA-NEXT: v_rcp_iflag_f32_e32 v4, v1
-; TONGA-NEXT: v_ashrrev_i32_e32 v0, 30, v0
-; TONGA-NEXT: v_or_b32_e32 v0, 1, v0
-; TONGA-NEXT: v_mul_f32_e32 v2, v3, v4
-; TONGA-NEXT: v_trunc_f32_e32 v2, v2
-; TONGA-NEXT: v_mad_f32 v3, -v2, v1, v3
-; TONGA-NEXT: v_cvt_i32_f32_e32 v2, v2
-; TONGA-NEXT: v_cmp_ge_f32_e64 vcc, |v3|, |v1|
-; TONGA-NEXT: v_cndmask_b32_e32 v0, 0, v0, vcc
-; TONGA-NEXT: v_add_u32_e32 v0, vcc, v0, v2
+; TONGA-NEXT: v_lshlrev_b32_e32 v3, 16, v3
+; TONGA-NEXT: v_or_b32_e32 v2, v2, v3
+; TONGA-NEXT: v_cvt_f32_i32_e32 v2, v2
+; TONGA-NEXT: v_cvt_f32_i32_e32 v0, v0
+; TONGA-NEXT: v_xor_b32_e32 v1, v1, v3
+; TONGA-NEXT: v_ashrrev_i32_e32 v1, 30, v1
+; TONGA-NEXT: v_rcp_iflag_f32_e32 v4, v2
+; TONGA-NEXT: v_or_b32_e32 v1, 1, v1
+; TONGA-NEXT: v_mul_f32_e32 v3, v0, v4
+; TONGA-NEXT: v_trunc_f32_e32 v3, v3
+; TONGA-NEXT: v_mad_f32 v0, -v3, v2, v0
+; TONGA-NEXT: v_cvt_i32_f32_e32 v3, v3
+; TONGA-NEXT: v_cmp_ge_f32_e64 vcc, |v0|, |v2|
+; TONGA-NEXT: v_cndmask_b32_e32 v0, 0, v1, vcc
+; TONGA-NEXT: v_add_u32_e32 v0, vcc, v0, v3
; TONGA-NEXT: v_bfe_i32 v0, v0, 0, 24
; TONGA-NEXT: buffer_store_dword v0, off, s[0:3], 0
; TONGA-NEXT: s_endpgm