Home | History | Annotate | Download | only in AMDGPU
      1 // RUN: llvm-mc -arch=amdgcn -mcpu=gfx904 -show-encoding %s | FileCheck -check-prefix=GFX9-FMAMIX %s
      2 // RUN: llvm-mc -arch=amdgcn -mcpu=gfx906 -show-encoding %s | FileCheck -check-prefix=GFX9-FMAMIX %s
      3 // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck -check-prefix=GFX9-MADMIX-ERR %s
      4 
      5 v_fma_mix_f32 v0, v1, v2, v3
      6 // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x04]
      7 // GFX9-MADMIX-ERR: error: instruction not supported on this GPU
      8 
      9 v_fma_mixlo_f16 v0, v1, v2, v3
     10 // GFX9-FMAMIX: v_fma_mixlo_f16 v0, v1, v2, v3 ; encoding: [0x00,0x00,0xa1,0xd3,0x01,0x05,0x0e,0x04]
     11 // GFX9-MADMIX-ERR: error: instruction not supported on this GPU
     12 
     13 v_fma_mixhi_f16 v0, v1, v2, v3
     14 // GFX9-FMAMIX: v_fma_mixhi_f16 v0, v1, v2, v3 ; encoding: [0x00,0x00,0xa2,0xd3,0x01,0x05,0x0e,0x04]
     15 // GFX9-MADMIX-ERR: error: instruction not supported on this GPU
     16 
     17 //
     18 // Regular source modifiers on non-packed instructions
     19 //
     20 
     21 v_fma_mix_f32 v0, abs(v1), v2, v3
     22 // GFX9-FMAMIX: v_fma_mix_f32 v0, |v1|, v2, v3 ; encoding: [0x00,0x01,0xa0,0xd3,0x01,0x05,0x0e,0x04]
     23 
     24 // FIXME: Better error
     25 // GFX9-MADMIX-ERR: error: invalid operand for instruction
     26 
     27 v_fma_mix_f32 v0, v1, abs(v2), v3
     28 // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, |v2|, v3 ; encoding: [0x00,0x02,0xa0,0xd3,0x01,0x05,0x0e,0x04]
     29 
     30 v_fma_mix_f32 v0, v1, v2, abs(v3)
     31 // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, |v3| ; encoding: [0x00,0x04,0xa0,0xd3,0x01,0x05,0x0e,0x04]
     32 
     33 v_fma_mix_f32 v0, -v1, v2, v3
     34 // GFX9-FMAMIX: v_fma_mix_f32 v0, -v1, v2, v3 ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x24]
     35 
     36 v_fma_mix_f32 v0, v1, -v2, v3
     37 // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, -v2, v3 ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x44]
     38 
     39 v_fma_mix_f32 v0, v1, v2, -v3
     40 // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, -v3 ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x84]
     41 
     42 v_fma_mix_f32 v0, -abs(v1), v2, v3
     43 // GFX9-FMAMIX: v_fma_mix_f32 v0, -|v1|, v2, v3 ; encoding: [0x00,0x01,0xa0,0xd3,0x01,0x05,0x0e,0x24]
     44 
     45 v_fma_mix_f32 v0, v1, -abs(v2), v3
     46 // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, -|v2|, v3 ; encoding: [0x00,0x02,0xa0,0xd3,0x01,0x05,0x0e,0x44]
     47 
     48 v_fma_mix_f32 v0, v1, v2, -abs(v3)
     49 // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, -|v3| ; encoding: [0x00,0x04,0xa0,0xd3,0x01,0x05,0x0e,0x84]
     50 
     51 v_fma_mixlo_f16 v0, abs(v1), -v2, abs(v3)
     52 // GFX9-FMAMIX: v_fma_mixlo_f16 v0, |v1|, -v2, |v3| ; encoding: [0x00,0x05,0xa1,0xd3,0x01,0x05,0x0e,0x44]
     53 
     54 v_fma_mixhi_f16 v0, -v1, abs(v2), -abs(v3)
     55 // GFX9-FMAMIX: v_fma_mixhi_f16 v0, -v1, |v2|, -|v3| ; encoding: [0x00,0x06,0xa2,0xd3,0x01,0x05,0x0e,0xa4]
     56 
     57 v_fma_mixlo_f16 v0, v1, v2, v3 clamp
     58 // GFX9-FMAMIX: v_fma_mixlo_f16 v0, v1, v2, v3  clamp ; encoding: [0x00,0x80,0xa1,0xd3,0x01,0x05,0x0e,0x04]
     59 
     60 v_fma_mixhi_f16 v0, v1, v2, v3 clamp
     61 // GFX9-FMAMIX: v_fma_mixhi_f16 v0, v1, v2, v3  clamp ; encoding: [0x00,0x80,0xa2,0xd3,0x01,0x05,0x0e,0x04]
     62 
     63 //
     64 // op_sel with non-packed instructions
     65 //
     66 
     67 v_fma_mix_f32 v0, v1, v2, v3 op_sel:[0,0,0]
     68 // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x04]
     69 // FIXME: Better error
     70 // GFX-MADMIX-ERR: error: unknown token in expression
     71 
     72 v_fma_mix_f32 v0, v1, v2, v3 op_sel:[1,0,0]
     73 // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 op_sel:[1,0,0] ; encoding: [0x00,0x08,0xa0,0xd3,0x01,0x05,0x0e,0x04]
     74 
     75 v_fma_mix_f32 v0, v1, v2, v3 op_sel:[0,1,0]
     76 // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 op_sel:[0,1,0] ; encoding: [0x00,0x10,0xa0,0xd3,0x01,0x05,0x0e,0x04]
     77 
     78 v_fma_mix_f32 v0, v1, v2, v3 op_sel:[0,0,1]
     79 // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 op_sel:[0,0,1] ; encoding: [0x00,0x20,0xa0,0xd3,0x01,0x05,0x0e,0x04]
     80 
     81 v_fma_mix_f32 v0, v1, v2, v3 op_sel:[1,1,1]
     82 // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 op_sel:[1,1,1] ; encoding: [0x00,0x38,0xa0,0xd3,0x01,0x05,0x0e,0x04]
     83 
     84 v_fma_mix_f32 v0, v1, v2, v3
     85 // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x04]
     86 
     87 v_fma_mix_f32 v0, v1, v2, v3 op_sel_hi:[1,0,0]
     88 // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 op_sel_hi:[1,0,0] ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x0c]
     89 
     90 v_fma_mix_f32 v0, v1, v2, v3 op_sel_hi:[0,1,0]
     91 // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 op_sel_hi:[0,1,0] ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x14]
     92 
     93 v_fma_mix_f32 v0, v1, v2, v3 op_sel_hi:[0,0,1]
     94 // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 op_sel_hi:[0,0,1] ; encoding: [0x00,0x40,0xa0,0xd3,0x01,0x05,0x0e,0x04]
     95 
     96 v_fma_mix_f32 v0, v1, v2, v3 op_sel_hi:[1,1,1]
     97 // GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 op_sel_hi:[1,1,1] ; encoding: [0x00,0x40,0xa0,0xd3,0x01,0x05,0x0e,0x1c]
     98 
     99 v_fma_mixlo_f16 v0, v1, v2, v3 op_sel_hi:[1,0,1] clamp
    100 // GFX9-FMAMIX: v_fma_mixlo_f16 v0, v1, v2, v3 op_sel_hi:[1,0,1] clamp ; encoding: [0x00,0xc0,0xa1,0xd3,0x01,0x05,0x0e,0x0c]
    101 
    102 v_fma_mixhi_f16 v0, v1, v2, v3 op_sel_hi:[1,0,1] clamp
    103 // GFX9-FMAMIX: v_fma_mixhi_f16 v0, v1, v2, v3 op_sel_hi:[1,0,1] clamp ; encoding: [0x00,0xc0,0xa2,0xd3,0x01,0x05,0x0e,0x0c]
    104