llvm/llvm/test/CodeGen/AMDGPU/fp-atomic-to-s_denormmode.mir

# RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -verify-machineinstrs -run-pass post-RA-hazard-rec -o - %s | FileCheck -check-prefixes=GCN,GFX10 %s
# RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -verify-machineinstrs -run-pass post-RA-hazard-rec -o - %s | FileCheck -check-prefixes=GCN %s

# GCN-LABEL: name: flat_atomic_fcmpswap_to_s_denorm_mode
# GCN:      FLAT_ATOMIC_FCMPSWAP
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            flat_atomic_fcmpswap_to_s_denorm_mode
body:            |
  bb.0:
    FLAT_ATOMIC_FCMPSWAP undef %0:vreg_64, undef %1:vreg_64, 0, 0, implicit $exec, implicit $flat_scr :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: flat_atomic_fcmpswap_x2_to_s_denorm_mode
# GCN:      FLAT_ATOMIC_FCMPSWAP_X2
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            flat_atomic_fcmpswap_x2_to_s_denorm_mode
body:            |
  bb.0:
    FLAT_ATOMIC_FCMPSWAP_X2 undef %0:vreg_64, undef %1:vreg_128, 0, 0, implicit $exec, implicit $flat_scr :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: flat_atomic_fmax_to_s_denorm_mode
# GCN:      FLAT_ATOMIC_FMAX
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            flat_atomic_fmax_to_s_denorm_mode
body:            |
  bb.0:
    FLAT_ATOMIC_FMAX undef %0:vreg_64, undef %1:vgpr_32, 0, 0, implicit $exec, implicit $flat_scr :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: flat_atomic_fmax_x2_to_s_denorm_mode
# GCN:      FLAT_ATOMIC_MAX_F64
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            flat_atomic_fmax_x2_to_s_denorm_mode
body:            |
  bb.0:
    FLAT_ATOMIC_MAX_F64 undef %0:vreg_64, undef %1:vreg_64, 0, 0, implicit $exec, implicit $flat_scr :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: flat_atomic_fmin_to_s_denorm_mode
# GCN:      FLAT_ATOMIC_FMIN
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            flat_atomic_fmin_to_s_denorm_mode
body:            |
  bb.0:
    FLAT_ATOMIC_FMIN undef %0:vreg_64, undef %1:vgpr_32, 0, 0, implicit $exec, implicit $flat_scr :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: flat_atomic_fmin_x2_to_s_denorm_mode
# GCN:      FLAT_ATOMIC_MIN_F64
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            flat_atomic_fmin_x2_to_s_denorm_mode
body:            |
  bb.0:
    FLAT_ATOMIC_MIN_F64 undef %0:vreg_64, undef %1:vreg_64, 0, 0, implicit $exec, implicit $flat_scr :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: flat_atomic_fcmpswap_x2_rtn_to_s_denorm_mode
# GCN:      FLAT_ATOMIC_FCMPSWAP_X2_RTN
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            flat_atomic_fcmpswap_x2_rtn_to_s_denorm_mode
body:            |
  bb.0:
    %2:vreg_64 = FLAT_ATOMIC_FCMPSWAP_X2_RTN undef %0:vreg_64, undef %1:vreg_128, 0, 1, implicit $exec, implicit $flat_scr :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: flat_atomic_fmax_rtn_to_s_denorm_mode
# GCN:      FLAT_ATOMIC_FMAX_RTN
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            flat_atomic_fmax_rtn_to_s_denorm_mode
body:            |
  bb.0:
    %2:vgpr_32 = FLAT_ATOMIC_FMAX_RTN undef %0:vreg_64, undef %1:vgpr_32, 0, 1, implicit $exec, implicit $flat_scr :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: flat_atomic_fmax_x2_rtn_to_s_denorm_mode
# GCN:      FLAT_ATOMIC_MAX_F64_RTN
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            flat_atomic_fmax_x2_rtn_to_s_denorm_mode
body:            |
  bb.0:
    %2:vreg_64 = FLAT_ATOMIC_MAX_F64_RTN undef %0:vreg_64, undef %1:vreg_64, 0, 1, implicit $exec, implicit $flat_scr :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: flat_atomic_fmin_rtn_to_s_denorm_mode
# GCN:      FLAT_ATOMIC_FMIN_RTN
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            flat_atomic_fmin_rtn_to_s_denorm_mode
body:            |
  bb.0:
    %2:vgpr_32 = FLAT_ATOMIC_FMIN_RTN undef %0:vreg_64, undef %1:vgpr_32, 0, 1, implicit $exec, implicit $flat_scr :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: flat_atomic_fmin_x2_rtn_to_s_denorm_mode
# GCN:      FLAT_ATOMIC_MIN_F64_RTN
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            flat_atomic_fmin_x2_rtn_to_s_denorm_mode
body:            |
  bb.0:
    %2:vreg_64 = FLAT_ATOMIC_MIN_F64_RTN undef %0:vreg_64, undef %1:vreg_64, 0, 1, implicit $exec, implicit $flat_scr :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: flat_atomic_fcmpswap_rtn_to_s_denorm_mode
# GCN:      FLAT_ATOMIC_FCMPSWAP_RTN
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            flat_atomic_fcmpswap_rtn_to_s_denorm_mode
body:            |
  bb.0:
    %2:vgpr_32 = FLAT_ATOMIC_FCMPSWAP_RTN undef %0:vreg_64, undef %1:vreg_64, 0, 1, implicit $exec, implicit $flat_scr :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: global_atomic_fcmpswap_to_s_denorm_mode
# GCN:      GLOBAL_ATOMIC_FCMPSWAP
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            global_atomic_fcmpswap_to_s_denorm_mode
body:            |
  bb.0:
    GLOBAL_ATOMIC_FCMPSWAP undef %0:vreg_64, undef %1:vreg_64, 0, 0, implicit $exec :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: global_atomic_fcmpswap_x2_to_s_denorm_mode
# GCN:      GLOBAL_ATOMIC_FCMPSWAP_X2
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            global_atomic_fcmpswap_x2_to_s_denorm_mode
body:            |
  bb.0:
    GLOBAL_ATOMIC_FCMPSWAP_X2 undef %0:vreg_64, undef %1:vreg_128, 0, 0, implicit $exec :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: global_atomic_fmax_to_s_denorm_mode
# GCN:      GLOBAL_ATOMIC_FMAX
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            global_atomic_fmax_to_s_denorm_mode
body:            |
  bb.0:
    GLOBAL_ATOMIC_FMAX undef %0:vreg_64, undef %1:vgpr_32, 0, 0, implicit $exec :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: global_atomic_fmax_x2_to_s_denorm_mode
# GCN:      GLOBAL_ATOMIC_MAX_F64
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            global_atomic_fmax_x2_to_s_denorm_mode
body:            |
  bb.0:
    GLOBAL_ATOMIC_MAX_F64 undef %0:vreg_64, undef %1:vreg_64, 0, 0, implicit $exec :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: global_atomic_fmin_to_s_denorm_mode
# GCN:      GLOBAL_ATOMIC_FMIN
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            global_atomic_fmin_to_s_denorm_mode
body:            |
  bb.0:
    GLOBAL_ATOMIC_FMIN undef %0:vreg_64, undef %1:vgpr_32, 0, 0, implicit $exec :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: global_atomic_fmin_x2_to_s_denorm_mode
# GCN:      GLOBAL_ATOMIC_MIN_F64
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            global_atomic_fmin_x2_to_s_denorm_mode
body:            |
  bb.0:
    GLOBAL_ATOMIC_MIN_F64 undef %0:vreg_64, undef %1:vreg_64, 0, 0, implicit $exec :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: global_atomic_fcmpswap_rtn_to_s_denorm_mode
# GCN:      GLOBAL_ATOMIC_FCMPSWAP_RTN
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            global_atomic_fcmpswap_rtn_to_s_denorm_mode
body:            |
  bb.0:
    %2:vgpr_32 = GLOBAL_ATOMIC_FCMPSWAP_RTN undef %0:vreg_64, undef %1:vreg_64, 0, 1, implicit $exec :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: global_atomic_fcmpswap_x2_rtn_to_s_denorm_mode
# GCN:      GLOBAL_ATOMIC_FCMPSWAP_X2_RTN
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            global_atomic_fcmpswap_x2_rtn_to_s_denorm_mode
body:            |
  bb.0:
    %2:vreg_64 = GLOBAL_ATOMIC_FCMPSWAP_X2_RTN undef %0:vreg_64, undef %1:vreg_128, 0, 1, implicit $exec :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: global_atomic_fmax_rtn_to_s_denorm_mode
# GCN:      GLOBAL_ATOMIC_FMAX_RTN
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            global_atomic_fmax_rtn_to_s_denorm_mode
body:            |
  bb.0:
    %2:vgpr_32 = GLOBAL_ATOMIC_FMAX_RTN undef %0:vreg_64, undef %1:vgpr_32, 0, 1, implicit $exec :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: global_atomic_fmax_x2_rtn_to_s_denorm_mode
# GCN:      GLOBAL_ATOMIC_MAX_F64_RTN
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            global_atomic_fmax_x2_rtn_to_s_denorm_mode
body:            |
  bb.0:
    %2:vreg_64 = GLOBAL_ATOMIC_MAX_F64_RTN undef %0:vreg_64, undef %1:vreg_64, 0, 1, implicit $exec :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: global_atomic_fmin_rtn_to_s_denorm_mode
# GCN:      GLOBAL_ATOMIC_FMIN_RTN
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            global_atomic_fmin_rtn_to_s_denorm_mode
body:            |
  bb.0:
    %2:vgpr_32 = GLOBAL_ATOMIC_FMIN_RTN undef %0:vreg_64, undef %1:vgpr_32, 0, 1, implicit $exec :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: global_atomic_fmin_x2_rtn_to_s_denorm_mode
# GCN:      GLOBAL_ATOMIC_MIN_F64_RTN
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            global_atomic_fmin_x2_rtn_to_s_denorm_mode
body:            |
  bb.0:
    %2:vreg_64 = GLOBAL_ATOMIC_MIN_F64_RTN undef %0:vreg_64, undef %1:vreg_64, 0, 1, implicit $exec :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: global_atomic_fcmpswap_saddr_to_s_denorm_mode
# GCN:      GLOBAL_ATOMIC_FCMPSWAP_SADDR
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            global_atomic_fcmpswap_saddr_to_s_denorm_mode
body:            |
  bb.0:
    GLOBAL_ATOMIC_FCMPSWAP_SADDR undef %0:vgpr_32, undef %1:vreg_64, undef %3:sgpr_64, 0, 0, implicit $exec :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: global_atomic_fcmpswap_x2_saddr_rtn_to_s_denorm_mode
# GCN:      GLOBAL_ATOMIC_FCMPSWAP_X2_SADDR_RTN
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            global_atomic_fcmpswap_x2_saddr_rtn_to_s_denorm_mode
body:            |
  bb.0:
    %2:vreg_64 = GLOBAL_ATOMIC_FCMPSWAP_X2_SADDR_RTN undef %0:vgpr_32, undef %1:vreg_128, undef %3:sgpr_64, 0, 1, implicit $exec :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: global_atomic_fmax_saddr_rtn_to_s_denorm_mode
# GCN:      GLOBAL_ATOMIC_FMAX_SADDR_RTN
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            global_atomic_fmax_saddr_rtn_to_s_denorm_mode
body:            |
  bb.0:
    %2:vgpr_32 = GLOBAL_ATOMIC_FMAX_SADDR_RTN undef %0:vgpr_32, undef %1:vgpr_32, undef %3:sgpr_64, 0, 1, implicit $exec :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: global_atomic_fmax_x2_saddr_rtn_to_s_denorm_mode
# GCN:      GLOBAL_ATOMIC_MAX_F64_SADDR_RTN
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            global_atomic_fmax_x2_saddr_rtn_to_s_denorm_mode
body:            |
  bb.0:
    %2:vreg_64 = GLOBAL_ATOMIC_MAX_F64_SADDR_RTN undef %0:vgpr_32, undef %1:vreg_64, undef %3:sgpr_64, 0, 1, implicit $exec :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: global_atomic_fmin_saddr_rtn_to_s_denorm_mode
# GCN:      GLOBAL_ATOMIC_FMIN_SADDR_RTN
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            global_atomic_fmin_saddr_rtn_to_s_denorm_mode
body:            |
  bb.0:
    %2:vgpr_32 = GLOBAL_ATOMIC_FMIN_SADDR_RTN undef %0:vgpr_32, undef %1:vgpr_32, undef %3:sgpr_64, 0, 1, implicit $exec :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: global_atomic_fmin_x2_saddr_rtn_to_s_denorm_mode
# GCN:      GLOBAL_ATOMIC_MIN_F64_SADDR_RTN
# GFX10-NEXT: S_NOP 2
# GCN-NEXT: S_DENORM_MODE
---
name:            global_atomic_fmin_x2_saddr_rtn_to_s_denorm_mode
body:            |
  bb.0:
    %2:vreg_64 = GLOBAL_ATOMIC_MIN_F64_SADDR_RTN undef %0:vgpr_32, undef %1:vreg_64, undef %3:sgpr_64, 0, 1, implicit $exec :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: flat_fp_atomic_to_s_denorm_mode_waitcnt
# GCN:      FLAT_ATOMIC_FMIN
# GCN-NEXT: S_WAITCNT
# GCN-NEXT: S_DENORM_MODE
---
name:            flat_fp_atomic_to_s_denorm_mode_waitcnt
body:            |
  bb.0:
    FLAT_ATOMIC_FMIN undef %0:vreg_64, undef %1:vgpr_32, 0, 0, implicit $exec, implicit $flat_scr :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    S_WAITCNT 0
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...

# GCN-LABEL: name: flat_fp_atomic_to_s_denorm_mode_valu
# GCN:      FLAT_ATOMIC_FMIN
# GCN-NEXT: V_ADD_F32_e32
# GCN-NEXT: S_DENORM_MODE
---
name:            flat_fp_atomic_to_s_denorm_mode_valu
body:            |
  bb.0:
    FLAT_ATOMIC_FMIN undef %0:vreg_64, undef %1:vgpr_32, 0, 0, implicit $exec, implicit $flat_scr :: (volatile load store seq_cst seq_cst (s32) on `ptr addrspace(1) undef`)
    %2:vgpr_32 = V_ADD_F32_e32 undef %1:vgpr_32, undef %1:vgpr_32, implicit $mode, implicit $exec
    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
...