Skip to content

Commit

Permalink
Merge pull request #142 from schung-amd/device-libs-compile-test-fix-…
Browse files Browse the repository at this point in the history
…rocm6.2

Update device-libs tests for current clang
  • Loading branch information
schung-amd authored Aug 16, 2024
2 parents fa1653b + 8197933 commit 7e4638a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 34 deletions.
44 changes: 24 additions & 20 deletions amd/device-libs/test/compile/fract.cl
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
#pragma OPENCL EXTENSION cl_khr_fp16 : enable

// CHECK-LABEL: test_fract_f16
// GFX600: v_cvt_f32_f16
// GFX600-DAG: v_floor_f32
// GFX600-DAG: v_sub_f32
// GFX600-DAG: v_min_f32_e32 v{{[0-9]+}}, 0x3f7fe000,
// GFX600-DAG: v_cmp_u_f32
// GFX600-DAG: v_cmp_neq_f32
// GFX600-DAG: v_cndmask_b32
// GFX600-DAG: v_cvt_f16_f32
// GFX600-DAG: v_cvt_f16_f32
// GFX600-DAG: s_add_u32
// GFX600-DAG: s_addc_u32
// GFX600: buffer_load_ushort
// GFX600-DAG: v_lshlrev_b32
// GFX600-DAG: v_mov_b32
// GFX600-DAG: s_mov_b32
// GFX600-DAG: s_mov_b32
// GFX600: s_waitcnt
// GFX600: buffer_store_short


// TODO: Could promote the f16 pattern to f32
// GFX700: flat_load_ushort [[VAL:v[0-9]+]]
// GFX700: v_cvt_f32_f16_e32 [[VAL_F32:v[0-9]+]]
// GFX700-DAG: v_floor_f32_e32 [[FLOOR:v[0-9]+]], [[VAL_F32]]
// GFX700: v_sub_f32_e32 [[SUB:v[0-9]+]], [[VAL_F32]], [[FLOOR]]

// GFX700-DAG: v_min_f32_e32 [[CLAMP:v[0-9]+]], 0x3f7fe000, [[SUB]]
// GFX700-DAG: v_cmp_u_f32
// GFX700-DAG: v_cmp_neq_f32
// GFX700-DAG: v_cndmask_b32
// GFX700-DAG: v_cvt_f16_f32
// GFX700-DAG: v_cvt_f16_f32
// GFX700-DAG: s_add_i32
// GFX700-DAG: s_lshr_b32
// GFX700-DAG: s_add_u32
// GFX700-DAG: s_addc_u32
// GFX700: buffer_load_ushort
// GFX700-DAG: s_load_dwordx2
// GFX700-DAG: v_lshlrev_b32
// GFX700-DAG: s_mov_b32
// GFX700-DAG: s_waitcnt
// GFX700-DAG: v_mov_b32
// GFX700-DAG: v_add_i32
// GFX700-DAG: v_addc_u32
// GFX700: s_waitcnt
// GFX700: flat_store_short


// GFX803: flat_load_ushort [[VAL:v[0-9]+]]
// GFX803-DAG: v_floor_f16_e32 [[FLOOR:v[0-9]+]], [[VAL]]
Expand Down
22 changes: 8 additions & 14 deletions amd/device-libs/test/compile/frexp.cl
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@
// later.

// GCN-LABEL: {{^}}test_frexp_f32:
// GFX600-DAG: s_mov_b32 [[INF:s[0-9]+]], 0x7f80000
// GFX600-DAG: v_frexp_mant_f32{{(_e32)?}} [[MANT:v[0-9]+]], [[SRC:v[0-9]+]]
// GFX600-DAG: v_frexp_exp_i32_f32{{(_e32)?}} [[EXP:v[0-9]+]], [[SRC:v[0-9]+]]

// GFX600-DAG: v_cmp_lt_f32{{(_e64)?}} [[CMP:(vcc|s{{\[[0-9]+:[0-9]+\]}})]], |[[SRC]]|, [[INF]]

// GFX600-DAG: s_movk_i32 [[INF:s[0-9]+]], 0x1f8
// GFX600-DAG: v_frexp_mant_f32{{(_e32)?}} [[MANT:v[0-9]+]], [[SRC:v[0-9]+]]
// GFX600-DAG: v_cmp_class_f32{{(_e64)?}} [[CMP:(vcc|s{{\[[0-9]+:[0-9]+\]}})]], [[SRC]], [[INF]]
// GFX600-DAG: v_frexp_exp_i32_f32{{(_e32)?}} [[EXP:v[0-9]+]], [[SRC]]
// GFX600-DAG: v_cndmask_b32{{(_e32)?|(e64)?}} v{{[0-9]+}}, [[SRC]], [[MANT]], [[CMP]]
// GFX600-DAG: v_cndmask_b32{{(_e32)?|(e64)?}} v{{[0-9]+}}, 0, [[EXP]], [[CMP]]


// GFX700-NOT: v_cmp_class
// GFX700-DAG: v_frexp_mant_f32{{(_e32)?}} [[MANT:v[0-9]+]], [[SRC:v[0-9]+]]
// GFX700-DAG: v_frexp_exp_i32_f32{{(_e32)?}} [[EXP:v[0-9]+]], [[SRC:v[0-9]+]]
Expand All @@ -32,18 +30,14 @@ kernel void test_frexp_f32(global float* restrict out0,
// GCN-LABEL: {{^}}test_frexp_f64:
// GFX600: s_mov_b32 s{{[0-9]+}}, 0{{$}}

// GFX600-DAG: s_mov_b32 s[[INF_LO:[0-9]+]], 0{{$}}
// GFX600-DAG: s_mov_b32 s[[INF_HI:[0-9]+]], 0x7ff00000{{$}}
// GFX600-DAG: s_movk_i32 [[INF:s[0-9]+]], 0x1f8
// GFX600-DAG: v_frexp_mant_f64{{(_e32)?}} v{{\[}}[[MANT_LO:[0-9]+]]:[[MANT_HI:[0-9]+]]{{\]}}, [[SRC:v\[[0-9]+:[0-9]+\]]]
// GFX600-DAG: v_frexp_exp_i32_f64{{(_e32)?}} [[EXP:v[0-9]+]], [[SRC:v\[[0-9]+:[0-9]+\]]]

// GFX600-DAG: v_cmp_lt_f64{{(_e64)?}} [[CMP:(vcc|s{{\[[0-9]+:[0-9]+\]}})]], |[[SRC]]|, s{{\[}}[[INF_LO]]:[[INF_HI]]{{\]}}

// GFX600-DAG: v_cndmask_b32{{(_e32)?|(e64)?}} v{{[0-9]+}}, v{{[0-9]+}}, v[[MANT_LO]], [[CMP]]
// GFX600-DAG: v_cmp_class_f64{{(_e64)?}} [[CMP:(vcc|s{{\[[0-9]+:[0-9]+\]}})]], [[SRC]], [[INF]]
// GFX600-DAG: v_frexp_exp_i32_f64{{(_e32)?}} [[EXP:v[0-9]+]], [[SRC]]
// GFX600-DAG: v_cndmask_b32{{(_e32)?|(e64)?}} v{{[0-9]+}}, v{{[0-9]+}}, v[[MANT_HI]], [[CMP]]
// GFX600-DAG: v_cndmask_b32{{(_e32)?|(e64)?}} v{{[0-9]+}}, v{{[0-9]+}}, v[[MANT_LO]], [[CMP]]
// GFX600-DAG: v_cndmask_b32{{(_e32)?|(e64)?}} v{{[0-9]+}}, 0, [[EXP]], [[CMP]]


// GFX700-NOT: v_cmp_class
// GFX700-DAG: v_frexp_mant_f64
// GFX700-DAG: v_frexp_exp_i32_f64
Expand Down

0 comments on commit 7e4638a

Please sign in to comment.