/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
////                                                               //////////////////////////////////////
////   THIS FILE DESCRIBES NEGATIVE TESTS FOR HSAIL 0.95 FEATURES  //////////////////////////////////////
////                                                               //////////////////////////////////////
////   THESE DESCRIPTIONS REQUIRE TESTGEN.PL FOR HSAIL GENERATION  //////////////////////////////////////
////                                                               //////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// add.su

add_b32    $s1, 42, $s2;
add_pp_s32 $s1, 42, $s2;
add_ps_s32 $s1, 42, $s2;
add_sp_s32 $s1, 42, $s2;
add_ss_s32 $s1, 42, $s2;
add_pp_sat_s32 $s1, 42, $s2;
add_ps_sat_s32 $s1, 42, $s2;
add_sp_sat_s32 $s1, 42, $s2;
add_ss_sat_s32 $s1, 42, $s2;

add_s32 $s1, 42;

add_s32 $d1, $s1, $s2;
add_s32 $s1, $d1, $s2;
add_s32 $s1, $s1, $d2;

add_s32 $c1, $s1, $s2;
add_s32 $s1, $c1, $s2;
add_s32 $s1, $s1, $c2;

add_s32 $q1, $s1, $s2;
add_s32 $s1, $q1, $s2;
add_s32 $s1, $s1, $q2;

add_s32 $s1, $s1, [$d2];
add_s32 [$d1], $s1, $s2;
add_s32 $s1, [$d2], $s1;

add_s32 $s1, $s1, @lab;         @lab: ret;
add_s32 @lab, $s1, $s2;         @lab: ret;
add_s32 $s1, @lab, $s1;         @lab: ret;

add_ftz_s32 $s1, $s0, $s2;
add_pp_s32 $s1, $s0, $s2;


// add.f

add_f32 $d1, $s1, $s2;
add_f32 $s1, $d1, $s2;
add_f32 $s1, $s1, $d2;

add_f32 WAVESIZE, $s1, $s2;
add_f32 $s1, WAVESIZE, $s2;
add_f32 $s1, $s1, WAVESIZE;

///add_f32 $s1, $s1, 1.0f;

add_pp_f32 $s1, $s1, $s2;

// add.sxux

add_ftz_pp_u16x2 $s1, $s1, $s2;
add_ftz_pp_sat_f16x2 $s1, $s1, $s2;
add_near_pp_u16x2 $s1, $s1, $s2;
add_neari_pp_u16x2 $s1, $s1, $s2;

add_u16x4           $d1, $d0, $d3;

// add.fx

add_f16x2           $s3,$s2,$s1;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// mulhi

mulhi_f32           $s1, $s3, $s3;
mulhi_ftz_u32       $s1, $s3, $s3;
mulhi_pp_u32        $s1, $s3, $s3;
mulhi_zero_u32      $s1, $s3, $s3;
mulhi_zeroi_u32     $s1, $s3, $s3;

mulhi_near_u32      $s1, $s3, $s3;
mulhi_neari_u32     $s1, $s3, $s3;

mulhi_ftz_pp_u8x8   $d1, $d3, $d4;
mulhi_near_pp_u8x8  $d1, $d3, $d4;
mulhi_pp_f16x4      $d1, $d3, $d4;

mulhi_u8x8          $d1, $d3, $d4;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// neg.s

neg_s16             $s1, 100;
neg_u32             $s1, 100;
neg_b64             $d1, $d2;

neg_p_s32           $s1, 100;
neg_pp_s64          $d1, $d2;
neg_ps_s32          $s1, 100;
neg_pp_sat_s64      $d1, $d2;

neg_ftz_s32         $s1, 100;
neg_near_s64        $d1, $d2;
neg_neari_s32       $s1, 100;

neg_s64             $d1;
neg_s64             WAVESIZE, $d2;
neg_s64             $d1, $d2, $d3;

// neg.f

neg_p_f32           $s3,1.0f;
neg_ps_f64          $d3,1.0;

neg_ftz_f32         $s3,1.0f;
neg_near_f64        $d3,1.0;

neg_f32        $s3,1.0;
neg_f64        $d3,1.0F;

// neg.sx

neg_s8x4            $s1, $s2;
neg_pp_s8x4         $s1, $s2;
neg_ps_sat_s8x4     $s1, $s2;

neg_ftz_s8x4        $s1, $s2;
neg_near_s8x4       $s1, $s2;
neg_neari_s8x4      $s1, $s2;

// neg.fx

neg_f16x2           $s1, $s2;
neg_pp_f16x2        $s1, $s2;
neg_ps_sat_f16x2    $s1, $s2;

neg_ftz_f16x2       $s1, $s2;
neg_near_f16x2      $s1, $s2;
neg_neari_f16x2     $s1, $s2;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// sqrt

sqrt_u32            $s0, 3.2f;
sqrt_p_f32          $s0, 3.2f;
sqrt_s_f64          $d0, 3.2;
sqrt_neari_f32      $s0, 3.2f;

sqrt_p_s16x2        $s0, $s0;
sqrt_f32x2          $d0, $d0;
sqrt_pp_f64x2       $q0, $q0;
sqrt_ftz_ss_f16x2   $s0, $s0;
sqrt_neari_p_f32x2  $d0, $d0;
sqrt_zeroi_p_f32x2  $d0, $d0;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// ceil

ceil_u32            $s0, 3.2f;
ceil_p_f32          $s0, 3.2f;
ceil_s_f64          $d0, 3.2;
ceil_neari_f32      $s0, 3.2f;

ceil_p_s16x2        $s0, $s0;
ceil_f32x2          $d0, $d0;
ceil_pp_f64x2       $q0, $q0;
ceil_ftz_ss_f16x2   $s0, $s0;
ceil_near_p_f32x2   $d0, $d0;
ceil_zeroi_p_f32x2  $d0, $d0;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// mul24

mul24_f32           $s1, $s2, $s2;
mul24_b32           $s1, $s2, $s2;

mul24_neari_s32     $s1, $s2, -12;
mul24_ftz_u32       $s1, $s2, 12;
mul24_pp_u32        $s1, $s2, 12;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// shl

shl_u32             $s1, $s2, u32x2(0,0);
shl_u32             $s1, $s2, $d2;
shl_u64             $d1, $d2, 1.0;
shl_u64             $d1, $d2, $d2;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// bitmask

bitmask_b32         $s0, $s1, 0.0f;
bitmask_b64         $d0, $s1, u32x2(0,0);
bitmask_b64         $d0, 1.0, 2;

bitmask_b64         $d0, 0.1, 2;
bitmask_b64         $d0, 0, 0.2;

bitmask_b64         $d0, $d1, $s2;
bitmask_b64         $d0, $s1, $d2;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// bitextract

bitextract_u64      $d1, $d1, $d1, $s2;
bitextract_u64      $d1, $d1, $s1, $d2;
bitextract_u64      $d1, $d1, $s1, 0.0;
bitextract_u64      $d1, $d1, u32x2(0,0), $s1;
bitextract_u64      $d1, $d1, $s1, 0.1;
bitextract_u64      $d1, $d1, 0.1, $s1;
bitextract_u64      $d1, $d1, $s1, 0.1f;
bitextract_u64      $d1, $d1, 0.1f, $s1;


/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// bitinsert

bitinsert_s32       $s1, $s1, $s2, 2.0, 3;
bitinsert_s32       $s1, $s1, $s2, 2, 3.0;
bitinsert_s32       $s1, $s1, 2.0, 2, 3;

bitinsert_u64       $d1, $d2, $d3, $d1, $s2;
bitinsert_u64       $d1, $d2, $d3, $s1, $d2;
bitinsert_u64       $d1, $d2, $d3, u32x2(0,0), $s2;
bitinsert_u64       $d1, $d2, $d3, $s1, 0.0;


/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// firstbit

firstbit_u32_s32    $d0, $s0;
firstbit_u64_s32    $d0, $s0;
firstbit_b32_s32    $s0, $s0;


firstbit_u32_u64    $s0, $s6;
firstbit_u32_s32    $s0, u32x2(0,0);
firstbit_u32_s32    $s0, $d0;
firstbit_u32_u64    $s0, $s0;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// combine

// combine.missing.v: missing 'v' suffix

combine_b64_b32;
combine_b64_b32         $d0,                    ($s0, $s1);          
combine_b128_b32        $q0,                    ($s0, $s1, $s2, $s3);
combine_b128_b64        $q0,                    ($d0, $d1);          

// combine.invalid.v: invalid 'v' suffix

combine_v4_b64_b32      $d0,                    ($s0, $s1);             
combine_v2_b128_b32     $q0,                    ($s0, $s1, $s2, $s3);   
combine_v4_b128_b64     $q0,                    ($d0, $d1);             
combine_v3_b128_b32     $q0,                    ($s0, $s1, $s2, $s3);   

// combine.misc: misc

combine_v2_b64_b32      $d0,                    ($s0, $s1, $s2, $s3);
combine_v2_b64_b32      $d0,                    ($s0, $s1, $s2);
combine_v4_b128_b32     $q0,                    ($s0, $s1);
combine_v4_b128_b32     $q0,                    ($s0, $s1, $s2);
combine_v2_b128_b64     $q0,                    ($d0, $d1, $d2);

combine_v1_b64_b32      $d0,                    ($s0, $s1);
combine_v5_b128_b64     $q0,                    ($d0, $d1);

combine_v2_b64_b32      $s0,                    ($s0, $s1);
combine_v2_b64_b32      $q0,                    ($s0, $s1);
combine_v4_b128_b32     $s0,                    ($s0, $s1, $s2, $s3);
combine_v4_b128_b32     $d0,                    ($s0, $s1, $s2, $s3);
combine_v2_b128_b64     $s0,                    ($d0, $d1);
combine_v2_b128_b64     $d0,                    ($d0, $d1);

combine_v4_b64_b32      $d0,                    ($s0, $s1, $s2, $s3);
combine_v3_b64_b32      $d0,                    ($s0, $s1, $s2);
combine_v2_b128_b32     $q0,                    ($s0, $s1);
combine_v3_b128_b32     $q0,                    ($s0, $s1, $s2);
combine_v3_b128_b64     $q0,                    ($d0, $d1, $d2);

combine_v2_b64_b64      $d0,                    ($d0, $d1);
combine_v4_b64_b32      $d0,                    ($s0, $s1, $s2, $s3);

combine_v2_b64_b32      $d0,                    $s0;
combine_v4_b128_b32     $q0,                    $s0;
combine_b128_b64        $q0,                    $d0;

combine_v2_b128_b64     $q0,                    ($s0, $s1);
combine_v4_b128_b32     $q0,                    ($d0, $d1, $d2, $d3);

combine_v2_b64_b32      $d0,                    ($d0, $s1);
combine_v2_b64_b32      $d0,                    ($s0, $d1);
combine_v4_b128_b32     $q0,                    ($d0, $s1, $s2, $s3);
combine_v4_b128_b32     $q0,                    ($s0, $d1, $s2, $s3);
combine_v4_b128_b32     $q0,                    ($s0, $s1, $d2, $s3);
combine_v4_b128_b32     $q0,                    ($s0, $s1, $s2, $d3);
combine_v2_b128_b64     $q0,                    ($d0, $s1);
combine_v2_b128_b64     $q0,                    ($s0, $d1);

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////

// expand.missing.v: missing 'v' suffix

expand_b32_b64       ($s0, $s1),             $d0;                 
expand_b32_b128      ($s0, $s1, $s2, $s3),   $q0;                 
expand_b64_b128      ($d0, $d1),             $q0;                 
expand_b32_b64       ($s0, $s1),             0xFFFFFFFFFFFFFFFF;  
expand_b32_b64       ;

// expand.invalid.v: invalid 'v' suffix

expand_v2_b32_b64    ;
expand_v3_b32_b64    ;
expand_v4_b32_b128   ;

expand_v3_b32_b64       ($s0, $s1),             $d0;                 
expand_v4_b32_b64       ($s0, $s1),             $d0;                 
expand_v2_b32_b128      ($s0, $s1, $s2, $s3),   $q0;                 
expand_v3_b32_b128      ($s0, $s1, $s2, $s3),   $q0;                 
expand_v3_b64_b128      ($d0, $d1),             $q0;                 
expand_v4_b32_b64       ($s0, $s1),             0xFFFFFFFFFFFFFFFF;  

// expand.const.dst

expand_v2_b32_b64       (1, $s1),             $d0;
expand_v4_b32_b128      ($s0, 0.0f, $s2, $s3),$q0;
expand_v2_b64_b128      ($d0, 0),             $q0;

expand_v2_b32_b64       (WAVESIZE, $s1),      $d0;
expand_v2_b64_b128      ($d0, WAVESIZE),      $q0;

// expand.misc: misc

expand_v2_b32_b64       ($d0, $d1),             $d0;
expand_v4_b32_b128      ($d0, $d1, $d2, $d3),   $q0;
expand_v2_b64_b128      ($s0, $s1),             $q0;
expand_v2_b32_b64       ($d0, $d1),             0xFFFFFFFFFFFFFFFF;
expand_v2_b32_b64       ($c0, $c1),             $d0;

expand_v2_b32_b64       ($s0, $s1),             $s0;
expand_v2_b32_b64       ($s0, $s1),             $q0;
expand_v4_b32_b128      ($s0, $s1, $s2, $s3),   $c0;
expand_v4_b32_b128      ($s0, $s1, $s2, $s3),   $s0;
expand_v2_b64_b128      ($d0, $d1),             $s0;
expand_v2_b64_b128      ($d0, $d1),             $d0;

expand_v2_b32_b128      ($s0, $s1),             $q0;
expand_v4_b32_b64       ($s0, $s1, $s2, $s3),   $d0;
expand_v2_b64_b64       ($d0, $d1),             $d0;
expand_v2_b32_b128      ($s0, $s1),             $q0;
expand_v2_b32_b128      ($s0, $s1),             0xFFFFFFFFFFFFFFFF;

expand_v2_b32_b64       ($s0, $s1, $s2, $s3),   $d0;
expand_v4_b32_b128      ($s0, $s1),             $q0;
expand_v2_b64_b128      ($s0, $s1),             $q0;
expand_v2_b32_b64       ($d0, $d1),             0xFFFFFFFFFFFFFFFF;

expand_v2_b32_b64       ($s0, $s0),             $d0;
expand_v4_b32_b128      ($s0, $s1, $s0, $s3),   $q0;
expand_v4_b32_b128      ($s0, $s1, $s2, $s0),   $q0;
expand_v4_b32_b128      ($s0, $s1, $s2, $s1),   $q0;
expand_v4_b32_b128      ($s0, $s1, $s2, $s2),   $q0;
expand_v4_b32_b128      ($s3, $s1, $s2, $s3),   $q0;
expand_v2_b64_b128      ($d0, $d0),             $q0;

expand_v2_b32_b64       ($s0, $s0),             0xFFFFFFFFFFFFFFFF;

// expand.b128.ws

expand_v4_b32_b128      ($s0, $s1, $s2, $s3), WAVESIZE;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// mov

mov_f16             $s1, $c7;
mov_f16             $s1, $d8;
mov_f16             $d1, $s8;
mov_f16             $d1, $d8;

[[ extension "IMAGE"; ]] mov_samp            $d1, $s8;
[[ extension "IMAGE"; ]] mov_roimg           $s1, $d8;
[[ extension "IMAGE"; ]] mov_rwimg           $s1, $s8;
[[ extension "IMAGE"; ]] mov_samp            $d1, $c7;
[[ extension "IMAGE"; ]] mov_roimg           $d1, $q8;
[[ extension "IMAGE"; ]] mov_rwimg           $q1, $d8;
[[ extension "IMAGE"; ]] mov_rwimg           $c1, $d8;
[[ extension "IMAGE"; ]] mov_samp            $d1, 8;
[[ extension "IMAGE"; ]] mov_roimg           $d1, 8;
[[ extension "IMAGE"; ]] mov_rwimg           $d1, 8;
[[ extension "IMAGE"; ]] mov_rwimg           $d1, WAVESIZE;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// lda

{ arg_b8      %argVar[8];      lda_arg_u32      $s4, [%argVar]; }

global_b8   %globalVar[8];   lda_global_u32   $d4, [%globalVar];
readonly_b8 %readonlyVar[8]; lda_readonly_u32 $d4, [%readonlyVar];

global_b8   %globalVar[8];   lda_global_u32   $s4, [%globalVar];
readonly_b8 %readonlyVar[8]; lda_readonly_u32 $s4, [%readonlyVar];

global_b8   %globalVar[8];   lda_group_u32    $s4, [%globalVar];
group_b8    %groupVar[8];    lda_global_u64   $d4, [%groupVar];
private_b8  %privateVar[8];  lda_readonly_u64 $d4, [%privateVar];
readonly_b8 %readonlyVar[8]; lda_private_u32  $s4, [%readonlyVar];
spill_b8    %spillVar[8];    lda_arg_u32      $s4, [%spillVar];
                             lda_spill_u32    $s4, [%arg];

lda_global_u32   $s4, [$d0];
lda_readonly_u32 $s4, [$d0];

lda_global_u32   $s4, [$s0];
lda_readonly_u32 $s4, [$s0];

lda_global_u64   $s4, [$d0];
lda_group_u32    $d4, [$s0];
lda_private_u32  $d4, [$s0];
lda_readonly_u64 $s4, [$d0];
lda_spill_u32    $d4, [$s0];
lda_arg_u32      $d4, [$s0];

lda_global_u64   $d4, [$s0];
lda_readonly_u64 $d4, [$s0];


global_b8   %globalVar[8];   lda_u64   $d4, [%globalVar];
group_b8    %groupVar[8];    lda_u32   $s4, [%groupVar];
private_b8  %privateVar[8];  lda_u32   $s4, [%privateVar];
readonly_b8 %readonlyVar[8]; lda_u64   $d4, [%readonlyVar];
spill_b8    %spillVar[8];    lda_u32   $s4, [%spillVar];
                             lda_u32   $s4, [%arg];

global_b8   %globalVar[8];   lda_u64   $d4, [%globalVar];
group_b8    %groupVar[8];    lda_u64   $d4, [%groupVar];
private_b8  %privateVar[8];  lda_u64   $d4, [%privateVar];
readonly_b8 %readonlyVar[8]; lda_u64   $d4, [%readonlyVar];
spill_b8    %spillVar[8];    lda_u64   $d4, [%spillVar];
                             lda_u64   $d4, [%arg];

!small

global_b8   %globalVar[8];   lda_global_u64   $d4, [%globalVar];

// lda.small.seg

group_b8    %groupVar[8];    lda_group_u64    $d4, [%groupVar];
private_b8  %privateVar[8];  lda_private_u64  $d4, [%privateVar];
spill_b8    %spillVar[8];    lda_spill_u64    $d4, [%spillVar];
                             lda_arg_u64      $d4, [%arg];

group_b8    %groupVar[8];    lda_group_u64    $s4, [%groupVar];
private_b8  %privateVar[8];  lda_private_u64  $s4, [%privateVar];
spill_b8    %spillVar[8];    lda_spill_u64    $s4, [%spillVar];
                             lda_arg_u64      $s4, [%arg];

lda_group_u64    $d4, [$s0];
lda_private_u64  $d4, [$s0];
lda_spill_u64    $d4, [$s0];
lda_arg_u64      $d4, [$s0];

lda_group_u64    $d4, [$d0];
lda_private_u64  $d4, [$d0];
lda_spill_u64    $d4, [$d0];
lda_arg_u64      $d4, [$d0];

lda_group_u32    $s4, [$d0];
lda_private_u32  $s4, [$d0];
lda_spill_u32    $s4, [$d0];
lda_arg_u32      $s4, [$d0];

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// pack

pack_f16x2_u16      $s1, $s2, $s3, $s1;
pack_f16x4_s16      $d1, $d2, $s3, $s3;
pack_f16x8_f32      $q1, $q2, $s3, $s3;

pack_f32x2_u32      $d1, $d1, $s2, $s0;
pack_f32x4_s32      $q1, $q1, $s2, $s0;

pack_f64x2_u64      $q1, $q1, $d2, $s0;

pack_u8x4_f32       $s1, $s2, $s3, $s0;
pack_u8x8_f32       $d1, $d2, $s3, $s0;
pack_u8x16_f32      $q1, $q2, $s3, $s0;
pack_u16x2_f32      $s1, $s2, $s3, $s0;
pack_u16x4_f32      $d1, $d2, $s3, $s0;
pack_u16x8_f32      $q1, $q2, $s3, $s0;
pack_u32x2_f32      $d1, $d1, $s1, $s0;
pack_u32x4_f32      $q1, $q1, $s1, $s0;

pack_u64x2_f64      $q1, $q1, $d1, $s0;

pack_f16x2_f32      $s1, $s2, $s3, $s1;
pack_f16x4_f32      $d1, $d2, $s3, $s3;
pack_f16x8_f64      $q1, $q2, $d3, $s3;

pack_f32x4_f16      $q1, $q1, $s2, $s0;

pack_u64x2_u32      $q1, $q1, $s1, $s0;

pack_f32x2_s32      $d1, $d1, $s2, $s0;
pack_f32x4_s32      $q1, $q1, $s2, $s0;
pack_f64x2_s64      $q1, $q1, $d2, $s0;
    
pack_u16x2_f16      $s1, $s2, $s3, $s1;
pack_u16x4_f16      $d1, $d2, $s3, $s3;
pack_u16x8_f16      $q1, $q2, $s3, $s3;
pack_u32x2_f32      $d1, $d1, $s2, $s0;
pack_u32x4_f32      $q1, $q1, $s2, $s0;
pack_u64x2_f64      $q1, $q1, $d2, $s0;

pack_s8x4_u32       $s1, $s2, $s3, $s0;
pack_s8x8_u32       $d1, $d2, $s3, $s0;
pack_s8x16_u32      $q1, $q2, $s3, $s0;
pack_s16x2_u32      $s1, $s2, $s3, $s0;
pack_s16x4_u32      $d1, $d2, $s3, $s0;
pack_s16x8_u32      $q1, $q2, $s3, $s0;
pack_s32x2_u32      $d1, $d1, $s1, $s0;
pack_s32x4_u32      $q1, $q1, $s1, $s0;

pack_f16x2_f16      $s1, $s2, $s3, $d1;
pack_f16x4_f16      $d1, $d2, $s3, $d3;
pack_f16x8_f16      $q1, $q2, $s3, $d3;
pack_f32x2_f32      $d1, $d1, $s2, $d0;
pack_f32x4_f32      $q1, $q1, $s2, $d0;
pack_f64x2_f64      $q1, $q1, $d2, $d0;
pack_u8x4_u32       $s1, $s2, $s3, $d0;
pack_u8x8_u32       $d1, $d2, $s3, $d0;
pack_u8x16_u32      $q1, $q2, $s3, $d0;
pack_u16x2_u32      $s1, $s2, $s3, $d0;
pack_u16x4_u32      $d1, $d2, $s3, $d0;
pack_u16x8_u32      $q1, $q2, $s3, $d0;
pack_u32x2_u32      $d1, $d1, $s1, $d0;
pack_u32x4_u32      $q1, $q1, $s1, $d0;
pack_u64x2_u64      $q1, $q1, $d1, $d0;
pack_s8x4_s32       $s1, $s2, $s3, $d0;
pack_s8x8_s32       $d1, $d2, $s3, $d0;
pack_s8x16_s32      $q1, $q2, $s3, $d0;
pack_s16x2_s32      $s1, $s2, $s3, $d0;
pack_s16x4_s32      $d1, $d2, $s3, $d0;
pack_s16x8_s32      $q1, $q2, $s3, $d0;
pack_s32x2_s32      $d1, $d1, $s1, $d0;
pack_s32x4_s32      $q1, $q1, $s1, $d0;
pack_s64x2_s64      $q1, $q1, $d1, $d0;

pack_f16x2_f16      $s1, $s2, $d3, $s1;
pack_f16x4_f16      $d1, $d2, $d3, $s3;
pack_f16x8_f16      $q1, $q2, $d3, $s3;
pack_f32x2_f32      $d1, $d1, $d2, $s0;
pack_f32x4_f32      $q1, $q1, $d2, $s0;
pack_f64x2_f64      $q1, $q1, $s2, $s0;
pack_u8x4_u32       $s1, $s2, $d3, $s0;
pack_u8x8_u32       $d1, $d2, $d3, $s0;
pack_u8x16_u32      $q1, $q2, $d3, $s0;
pack_u16x2_u32      $s1, $s2, $d3, $s0;
pack_u16x4_u32      $d1, $d2, $d3, $s0;
pack_u16x8_u32      $q1, $q2, $d3, $s0;
pack_u32x2_u32      $d1, $d1, $d1, $s0;
pack_u32x4_u32      $q1, $q1, $d1, $s0;
pack_u64x2_u64      $q1, $q1, $s1, $s0;
pack_s8x4_s32       $s1, $s2, $d3, $s0;
pack_s8x8_s32       $d1, $d2, $d3, $s0;
pack_s8x16_s32      $q1, $q2, $d3, $s0;
pack_s16x2_s32      $s1, $s2, $d3, $s0;
pack_s16x4_s32      $d1, $d2, $d3, $s0;
pack_s16x8_s32      $q1, $q2, $d3, $s0;
pack_s32x2_s32      $d1, $d1, $d1, $s0;
pack_s32x4_s32      $q1, $q1, $d1, $s0;
pack_s64x2_s64      $q1, $q1, $s1, $s0;

pack_f16x2_f16      $s1, $d2, $s3, $s1;
pack_f16x4_f16      $d1, $s2, $s3, $s3;
pack_f16x8_f16      $q1, $d2, $s3, $s3;
pack_f32x2_f32      $d1, $s1, $s2, $s0;
pack_f32x4_f32      $q1, $s1, $s2, $s0;
pack_f64x2_f64      $q1, $s1, $d2, $s0;
pack_u8x4_u32       $s1, $d2, $s3, $s0;
pack_u8x8_u32       $d1, $s2, $s3, $s0;
pack_u8x16_u32      $q1, $s2, $s3, $s0;
pack_u16x2_u32      $s1, $d2, $s3, $s0;
pack_u16x4_u32      $d1, $s2, $s3, $s0;
pack_u16x8_u32      $q1, $s2, $s3, $s0;
pack_u32x2_u32      $d1, $s1, $s1, $s0;
pack_u32x4_u32      $q1, $s1, $s1, $s0;
pack_u64x2_u64      $q1, $s1, $d1, $s0;
pack_s8x4_s32       $s1, $d2, $s3, $s0;
pack_s8x8_s32       $d1, $s2, $s3, $s0;
pack_s8x16_s32      $q1, $s2, $s3, $s0;
pack_s16x2_s32      $s1, $d2, $s3, $s0;
pack_s16x4_s32      $d1, $s2, $s3, $s0;
pack_s16x8_s32      $q1, $s2, $s3, $s0;
pack_s32x2_s32      $d1, $s1, $s1, $s0;
pack_s32x4_s32      $q1, $s1, $s1, $s0;
pack_s64x2_s64      $q1, $s1, $d1, $s0;

pack_f16x2_f16      $d2, $s2, $s3, $s1;
pack_f16x4_f16      $s2, $d2, $s3, $s3;
pack_f16x8_f16      $d2, $q2, $s3, $s3;
pack_f32x2_f32      $s1, $d1, $s2, $s0;
pack_f32x4_f32      $s1, $q1, $s2, $s0;
pack_f64x2_f64      $s1, $q1, $d2, $s0;
pack_u8x4_u32       $d2, $s2, $s3, $s0;
pack_u8x8_u32       $s2, $d2, $s3, $s0;
pack_u8x16_u32      $s2, $q2, $s3, $s0;
pack_u16x2_u32      $d2, $s2, $s3, $s0;
pack_u16x4_u32      $s2, $d2, $s3, $s0;
pack_u16x8_u32      $s2, $q2, $s3, $s0;
pack_u32x2_u32      $s1, $d1, $s1, $s0;
pack_u32x4_u32      $s1, $q1, $s1, $s0;
pack_u64x2_u64      $s1, $q1, $d1, $s0;
pack_s8x4_s32       $d2, $s2, $s3, $s0;
pack_s8x8_s32       $s2, $d2, $s3, $s0;
pack_s8x16_s32      $s2, $q2, $s3, $s0;
pack_s16x2_s32      $d2, $s2, $s3, $s0;
pack_s16x4_s32      $s2, $d2, $s3, $s0;
pack_s16x8_s32      $s2, $q2, $s3, $s0;
pack_s32x2_s32      $s1, $d1, $s1, $s0;
pack_s32x4_s32      $s1, $q1, $s1, $s0;
pack_s64x2_s64      $s1, $q1, $d1, $s0;

// pack.noexp

pack_u8x4_u64       $s1, $s2, $d3, $s0;
pack_u8x8_u64       $d1, $d2, $d3, $s0;
pack_u8x16_u64      $q1, $q2, $d3, $s0;
pack_u16x2_u64      $s1, $s2, $d3, $s0;
pack_u16x4_u64      $d1, $d2, $d3, $s0;
pack_u16x8_u64      $q1, $q2, $d3, $s0;
pack_u32x2_u64      $d1, $d1, $d1, $s0;
pack_u32x4_u64      $q1, $q1, $d1, $s0;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// unpack

    unpack_f16_s16x2    $s1, $s2, $s1;
    unpack_f16_s16x4    $s1, $d2, $s3;
    unpack_f16_s16x8    $s1, $q2, $s3;
    unpack_f32_s32x2    $s1, $d2, $s1;
    unpack_f32_s32x4    $s1, $q2, $s3;
    unpack_f64_s64x2    $d1, $q2, $s3;

    unpack_f16_u16x2    $s1, $s2, $s1;
    unpack_f16_u16x4    $s1, $d2, $s3;
    unpack_f16_u16x8    $s1, $q2, $s3;
    unpack_f32_u32x2    $s1, $d2, $s1;
    unpack_f32_u32x4    $s1, $q2, $s3;
    unpack_f64_u64x2    $d1, $q2, $s3;

    unpack_s16_f16x2    $s1, $s2, $s1;
    unpack_s16_f16x4    $s1, $d2, $s3;
    unpack_s16_f16x8    $s1, $q2, $s3;
    unpack_s32_f32x2    $s1, $d2, $s1;
    unpack_s32_f32x4    $s1, $q2, $s3;
    unpack_s64_f64x2    $d1, $q2, $s3;

    unpack_u16_f16x2    $s1, $s2, $s1;
    unpack_u16_f16x4    $s1, $d2, $s3;
    unpack_u16_f16x8    $s1, $q2, $s3;
    unpack_u32_f32x2    $s1, $d2, $s1;
    unpack_u32_f32x4    $s1, $q2, $s3;
    unpack_u64_f64x2    $d1, $q2, $s3;

    unpack_s32_u32x2    $s1, $d1, $s2;
    unpack_s32_u32x4    $s1, $q1, $s2;
    unpack_s32_u16x2    $s1, $s1, $s2;
    unpack_s32_u16x4    $s1, $d1, $s2;
    unpack_s32_u16x8    $s1, $q1, $s2;
    unpack_s32_u8x4     $s1, $s1, $s2;
    unpack_s32_u8x8     $s1, $d1, $s2;
    unpack_s32_u8x16    $s1, $q1, $s2;
    unpack_s64_u64x2    $d1, $q1, $s2;

    unpack_s32_u32x2    $s1, $d1, $s2;
    unpack_s32_u32x4    $s1, $q1, $s2;
    unpack_s32_u16x2    $s1, $s1, $s2;
    unpack_s32_u16x4    $s1, $d1, $s2;
    unpack_s32_u16x8    $s1, $q1, $s2;
    unpack_s32_u8x4     $s1, $s1, $s2;
    unpack_s32_u8x8     $s1, $d1, $s2;
    unpack_s32_u8x16    $s1, $q1, $s2;
    unpack_s64_u64x2    $d1, $q1, $s2;

    unpack_f32_f16x2    $s1, $s2, $s1;
    unpack_f32_f16x4    $s1, $d2, $s3;
    unpack_f32_f16x8    $s1, $q2, $s3;
    unpack_f32_f64x2    $s1, $q2, $s1;
    unpack_f32_f16x4    $s1, $d2, $s3;
    unpack_f64_f32x2    $d1, $d2, $s3;

    unpack_u32_u64x2    $s1, $q1, $s2;
    unpack_s32_s64x2    $s1, $q1, $s2;


    unpack_f16_f16x2    $s1, $s2, $d1;
    unpack_f16_f16x4    $s1, $d2, $d3;
    unpack_f16_f16x8    $s1, $q2, $d3;
    unpack_f32_f32x2    $s1, $d2, $d1;
    unpack_f32_f32x4    $s1, $q2, $d3;
    unpack_f64_f64x2    $d1, $q2, $d3;
    unpack_u32_u32x2    $s1, $d1, $d2;
    unpack_u32_u32x4    $s1, $q1, $d2;
    unpack_u32_u16x2    $s1, $s1, $d2;
    unpack_u32_u16x4    $s1, $d1, $d2;
    unpack_u32_u16x8    $s1, $q1, $d2;
    unpack_u32_u8x4     $s1, $s1, $d2;
    unpack_u32_u8x8     $s1, $d1, $d2;
    unpack_u32_u8x16    $s1, $q1, $d2;
    unpack_u64_u64x2    $d1, $q1, $d2;
    unpack_s32_s32x2    $s1, $d1, $d2;
    unpack_s32_s32x4    $s1, $q1, $d2;
    unpack_s32_s16x2    $s1, $s1, $d2;
    unpack_s32_s16x4    $s1, $d1, $d2;
    unpack_s32_s16x8    $s1, $q1, $d2;
    unpack_s32_s8x4     $s1, $s1, $d2;
    unpack_s32_s8x8     $s1, $d1, $d2;
    unpack_s32_s8x16    $s1, $q1, $d2;
    unpack_s64_s64x2    $d1, $q1, $d2;


    unpack_f16_f16x2    $s1, $d2, $s1;
    unpack_f16_f16x4    $s1, $s2, $s3;
    unpack_f16_f16x8    $s1, $s2, $s3;
    unpack_f32_f32x2    $s1, $s2, $s1;
    unpack_f32_f32x4    $s1, $s2, $s3;
    unpack_f64_f64x2    $d1, $s2, $s3;
    unpack_u32_u32x2    $s1, $s1, $s2;
    unpack_u32_u32x4    $s1, $s1, $s2;
    unpack_u32_u16x2    $s1, $d1, $s2;
    unpack_u32_u16x4    $s1, $s1, $s2;
    unpack_u32_u16x8    $s1, $s1, $s2;
    unpack_u32_u8x4     $s1, $d1, $s2;
    unpack_u32_u8x8     $s1, $s1, $s2;
    unpack_u32_u8x16    $s1, $s1, $s2;
    unpack_u64_u64x2    $d1, $s1, $s2;
    unpack_s32_s32x2    $s1, $s1, $s2;
    unpack_s32_s32x4    $s1, $s1, $s2;
    unpack_s32_s16x2    $s1, $d1, $s2;
    unpack_s32_s16x4    $s1, $s1, $s2;
    unpack_s32_s16x8    $s1, $s1, $s2;
    unpack_s32_s8x4     $s1, $d1, $s2;
    unpack_s32_s8x8     $s1, $s1, $s2;
    unpack_s32_s8x16    $s1, $s1, $s2;
    unpack_s64_s64x2    $d1, $s1, $s2;

    unpack_f16_f16x2    $q2, $s2, $s1;
    unpack_f16_f16x4    $q2, $d2, $s3;
    unpack_f16_f16x8    $q2, $q2, $s3;
    unpack_f32_f32x2    $q2, $d2, $s1;
    unpack_f32_f32x4    $q2, $q2, $s3;
    unpack_f64_f64x2    $q2, $q2, $s3;
    unpack_u32_u32x2    $q1, $d1, $s2;
    unpack_u32_u32x4    $q1, $q1, $s2;
    unpack_u32_u16x2    $q1, $s1, $s2;
    unpack_u32_u16x4    $q1, $d1, $s2;
    unpack_u32_u16x8    $q1, $q1, $s2;
    unpack_u32_u8x4     $q1, $s1, $s2;
    unpack_u32_u8x8     $q1, $d1, $s2;
    unpack_u32_u8x16    $q1, $q1, $s2;
    unpack_u64_u64x2    $q1, $q1, $s2;
    unpack_s32_s32x2    $q1, $d1, $s2;
    unpack_s32_s32x4    $q1, $q1, $s2;
    unpack_s32_s16x2    $q1, $s1, $s2;
    unpack_s32_s16x4    $q1, $d1, $s2;
    unpack_s32_s16x8    $q1, $q1, $s2;
    unpack_s32_s8x4     $q1, $s1, $s2;
    unpack_s32_s8x8     $q1, $d1, $s2;
    unpack_s32_s8x16    $q1, $q1, $s2;
    unpack_s64_s64x2    $q1, $q1, $s2;

// unpack.noexp

    unpack_u64_u32x2    $d1, $d1, $s2;
    unpack_u64_u32x4    $d1, $q1, $s2;
    unpack_u64_u16x2    $d1, $s1, $s2;
    unpack_u64_u16x4    $d1, $d1, $s2;
    unpack_u64_u16x8    $d1, $q1, $s2;
    unpack_u64_u8x4     $d1, $s1, $s2;
    unpack_u64_u8x8     $d1, $d1, $s2;
    unpack_u64_u8x16    $d1, $q1, $s2;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// cmov

    cmov_b32            $s1, $s3, $s1, $s2;
    cmov_b32            $s1, 0.0, $s1, $s2;
    cmov_b64            $d1, $d3, $d1, $d2;
    cmov_b32            $s1, $q0, $s1, $s2;
    cmov_u8x4           $d1, $s0, $s1, $s2;
    cmov_s8x4           $s1, $d0, $s1, $s2;
    cmov_s8x8           $d1, $d0, $s1, $d2;
    cmov_s8x8           $d1, $d0, $d1, $s2;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// shuffle

    shuffle_u8x4        $s10, $s12, $s12, WAVESIZE;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// class

    class_b1_f16        $c1, $s1, WAVESIZE;
    class_b1_f32        $c1, $s1, WAVESIZE;
    class_b1_f32        $c1, 1.0f, WAVESIZE;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// stof

    stof_spill_u64_u32         $d1, $s1;
    stof_readonly_u64_u64      $d1, $d1;
    stof_kernarg_u64_u64       $d1, $d1;
    stof_arg_u64_u32           $d1, $s1;
                               
    stof_global_u32_u64        $s1, $d1;
    stof_global_u64_u32        $d1, $s1;
    stof_global_u64_u64        $d1, WAVESIZE;
                               
    stof_group_u32_u32         $s1, $s1;

    stof_nonull_global_u64_u64 $d1, $d1;
    stof_nonull_u64_u64        $d1, $d1;
    stof_global_u64            $d1, $d1;
                               
    stof_flat_u64_u64          $d1, 64;
    stof_u64_u64               $d1, 64;

    stof_group_u64_u64         $d1, $d1;
    stof_private_u64_u64       $d1, $d1;

!large

    stof_global_nonull_u64_u64      $d1, $d1;
    stof_global_u64_u64             $d1, 64;

!base

    stof_global_nonull_u64_u64      $d1, $d1;
    stof_global_u64_u64             $d1, 64;

!small

    stof_global_u32_u32     $s1, $s1;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// ftos

    ftos_spill_u32_u64         $s1, $d1;
    ftos_readonly_u64_u64      $d1, $d1;
    ftos_kernarg_u64_u64       $d1, $d1;
    ftos_arg_u32_u64           $s1, $d1;
                               
    ftos_global_u64_u32        $d1, $s1;
    ftos_global_u32_u64        $s1, $d1;
    ftos_global_u64_u64        $d1, WAVESIZE;
                               
    ftos_group_u32_u32         $s1, $s1;

    ftos_nonull_global_u64_u64 $d1, $d1;
    ftos_nonull_u64_u64        $d1, $d1;
    ftos_global_u64            $d1, $d1;
                               
    ftos_flat_u64_u64          $d1, 64;
    ftos_u64_u64               $d1, 64;

    ftos_group_u64_u64         $d1, $d1;
    ftos_private_u64_u64       $d1, $d1;

!large

    ftos_global_nonull_u64_u64      $d1, $d2;
    ftos_global_u64_u64             $d1, 0;

!base

    ftos_global_nonull_u64_u64      $d1, $d2;
    ftos_global_u64_u64             $d1, 0;

!small

    ftos_global_u32_u32     $s1, $s2;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// segmentp

    segmentp_b1_u64               $c1, $d0;
    segmentp_nonull_global_b1_u64 $c1, $d0;
    segmentp_flat_b1_u64          $c1, $d0;
    segmentp_global_b1_nonull_u64 $c1, $d0;

    segmentp_readonly_b1_u64      $c1, $d1;
    segmentp_kernarg_b1_u64       $c1, $d1;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// cmp

    cmp_pp_eq_b1_b1             $c1, $c2, 0;
    cmp_eq_pp_b1_b1             $c1, $c2, 0;
    cmp_lt_ps_f32_f32           $s1, $s2, 0.0f;
    cmp_lt_p_f32_f32            $s1, 1.0f, 0.0f;
    cmp_lt_near_f32_f32         $s1, 1.0f, 0.0f;
    cmp_lt_zero_f32_f32         $s1, 1.0f, 0.0f;
    cmp_gt_upi_s32_u32          $s1, $s2, 0;
    cmp_near_lt_f32_f32         $s1, 1.0f, 0.0f;
    cmp_zero_lt_f32_f32         $s1, 1.0f, 0.0f;
    cmp_upi_gt_s32_u32          $s1, $s2, 0;
    cmp_gt_ftz_s32_u32          $s1, $s2, 0;

    cmp_lt_f32_b32              $s1, $s2, $s2;
    cmp_le_f32_b32              $s1, $s2, $s2;
    cmp_gt_f32_b32              $s1, $s2, $s2;
    cmp_ge_f32_b32              $s1, $s2, $s2;
    cmp_equ_f32_b32             $s1, $s2, $s2;
    cmp_neu_f32_b32             $s1, $s2, $s2;
    cmp_num_f32_b32             $s1, $s2, $s2;
    cmp_nan_f32_b32             $s1, $s2, $s2;
    cmp_sequ_f32_b32            $s1, $s2, $s2;
    cmp_sneu_f32_b32            $s1, $s2, $s2;
    cmp_snum_f32_b32            $s1, $s2, $s2;
    cmp_snan_f32_b32            $s1, $s2, $s2;

    cmp_ltu_f32_u32             $s1, $s2, $s2;
    cmp_leu_f32_u32             $s1, $s2, $s2;
    cmp_gtu_f32_u32             $s1, $s2, $s2;
    cmp_geu_f32_u32             $s1, $s2, $s2;
    cmp_equ_f32_s32             $s1, $s2, $s2;
    cmp_neu_f32_s32             $s1, $s2, $s2;
    cmp_num_f32_s32             $s1, $s2, $s2;
    cmp_nan_f32_s32             $s1, $s2, $s2;
    cmp_sequ_f32_u32            $s1, $s2, $s2;
    cmp_sneu_f32_u32            $s1, $s2, $s2;
    cmp_snum_f32_u32            $s1, $s2, $s2;
    cmp_snan_f32_u32            $s1, $s2, $s2;

    cmp_lt_b1_u16x2             $c1, $s2, $s0;
    cmp_lt_u32_s16x2            $s1, $s2, $s0;
    cmp_lt_f32_f16x2            $s1, $s2, $s0;
    cmp_gt_b16x2_u32            $s1, $s2, $s0;
    cmp_gt_f16x2_s32            $s1, $s2, $s0;

    cmp_lt_pp_s16x2_f16x2       $s1, $s2, $s3;
    cmp_lt_pp_f16x4_f16x4       $d1, $d2, $d3;
    cmp_lt_pp_u16x4_f32x2       $d1, $d2, $d3;
    cmp_lt_pp_u32x4_f16x8       $q1, $q2, $q3;
    cmp_lt_pp_u16x8_f32x4       $q1, $q2, $q3;
    cmp_lt_pp_u32x4_f64x2       $q1, $q2, $q3;

    cmp_lt_ftz_u16x2_f16x2      $s1, $s2, $s3;
    cmp_lt_ftz_u16x4_f16x4      $d1, $d2, $d3;
    cmp_lt_ftz_u32x2_f32x2      $d1, $d2, $d3;
    cmp_lt_ftz_u16x8_f16x8      $q1, $q2, $q3;
    cmp_lt_ftz_u32x4_f32x4      $q1, $q2, $q3;
    cmp_lt_ftz_u64x2_f64x2      $q1, $q2, $q3;

    cmp_lt_ftz_u8x4_s8x4        $s1, $s2, $s3;
    cmp_lt_ftz_u16x2_s16x2      $s1, $s2, $s3;
    cmp_lt_ftz_u8x8_s8x8        $d1, $d2, $d3;
    cmp_lt_ftz_u16x4_s16x4      $d1, $d2, $d3;
    cmp_lt_ftz_u32x2_s32x2      $d1, $d2, $d3;
    cmp_lt_ftz_u8x16_s8x16      $q1, $q2, $q3;
    cmp_lt_ftz_u16x8_s16x8      $q1, $q2, $q3;
    cmp_lt_ftz_u32x4_s32x4      $q1, $q2, $q3;
    cmp_lt_ftz_u64x2_s64x2      $q1, $q2, $q3;

    cmp_ltu_pp_u8x4_s8x4        $s1, $s2, $s3;
    cmp_leu_pp_u16x2_s16x2      $s1, $s2, $s3;
    cmp_gtu_pp_u8x8_s8x8        $d1, $d2, $d3;
    cmp_geu_pp_u16x4_s16x4      $d1, $d2, $d3;
    cmp_equ_pp_u32x2_s32x2      $d1, $d2, $d3;
    cmp_neu_pp_u8x16_s8x16      $q1, $q2, $q3;
    cmp_num_pp_u16x8_s16x8      $q1, $q2, $q3;
    cmp_nan_pp_u32x4_s32x4      $q1, $q2, $q3;
    cmp_sequ_pp_u64x2_s64x2     $q1, $q2, $q3;
    cmp_sneu_pp_u32x2_s32x2     $d1, $d2, $d3;
    cmp_snum_pp_u8x16_s8x16     $q1, $q2, $q3;
    cmp_snan_pp_u16x8_s16x8     $q1, $q2, $q3;

// cmp.btype

    cmp_eq_b32_b1           $s1, $c2, 0;
    cmp_eq_b64_b1           $d1, $c2, 0;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// cvt.dest.expansion: dest expansion

    cvt_f16_f32             $d1, 1.0f;
    cvt_f16_f32             $d1, $s2;
    cvt_b1_f32              $q1, $s2;

    cvt_u8_f32              $q1, $s2;
    cvt_f16_f32             $d1, $s2;

    cvt_u16_f32             $q1, $s2;
    cvt_f16_f32             $d1, $s2;

    cvt_u32_f32             $q1, $s2;
    cvt_f64_f32             $q1, $s2;

    cvt_s32_f16             $q1, $s2;
    cvt_f32_f16             $d1, $s2;
    cvt_f32_f16             $q1, $s2;

    cvt_b1_f32             $s1, $s2;
    cvt_b1_f32             $d1, $s2;
    cvt_u8_f32             $d1, $s2;
    cvt_s8_f32             $d1, $s2;
    cvt_u16_f32             $d1, $s2;
    cvt_s16_f32             $d1, $s2;
    cvt_u32_f32             $d1, $s2;
    cvt_s32_f32             $d1, $s2;

// cvt.src.expansion: src expansion

    cvt_f32_b1              $s2, $q1;
    cvt_f32_f16             $s2, $d1;
    cvt_f32_u8              $s2, $q1;
    cvt_f32_s8              $s2, $q1;
    cvt_f32_u16             $s2, $q1;
    cvt_f32_s16             $s2, $q1;

    cvt_f32_b1              $s2, $s1;
    cvt_f32_b1              $s2, $d1;
    cvt_f32_u8              $s2, $d1;
    cvt_f32_s8              $s2, $d1;
    cvt_f32_u16             $s2, $d1;
    cvt_f32_s16             $s2, $d1;
    cvt_f32_u32             $s2, $d1;
    cvt_f32_s32             $s2, $d1;
    cvt_s32_b1              $d1, $s2;

// cvt.f2s: f->s/u int rounding

    cvt_ftz_up_s8_f16        $s1, $s2;
    cvt_up_sat_s8_f32        $s1, $s2;
    cvt_ftz_zero_s8_f64      $s1, $d2;
    cvt_zero_sat_s8_f64      $s1, $d2;
    cvt_ftz_down_s8_f64      $s1, $d2;
    cvt_down_sat_s8_f64      $s1, $d2;
    cvt_ftz_near_s8_f64      $s1, $d2;
    cvt_near_sat_s8_f64      $s1, $d2;

// cvt.s2f: s/u->f fp rounding

    cvt_neari_f32_s32        $s2, $s1;
    cvt_upi_f32_s32          $s2, $d1;
    cvt_downi_f32_s32        $s2, $s1;
    cvt_zeroi_f32_s32        $s2, $d1;

    cvt_sneari_f32_s32        $s2, $s1;
    cvt_supi_f32_s32          $s2, $d1;
    cvt_sdowni_f32_s32        $s2, $s1;
    cvt_szeroi_f32_s32        $s2, $d1;

    cvt_sneari_sat_f32_s32        $s2, $s1;
    cvt_supi_sat_f32_s32          $s2, $d1;
    cvt_sdowni_sat_f32_s32        $s2, $s1;
    cvt_szeroi_sat_f32_s32        $s2, $d1;

// cvt.f32.to.f64: f32->f64 no rounding, ftz supported

    cvt_zero_f64_f32         $d2, $s1;
    cvt_zeroi_f64_f32        $d2, $s1;
    cvt_szeroi_f64_f32       $d2, $s1;
    cvt_szeroi_sat_f64_f32   $d2, $s1;

// cvt.f64.to.f32: f64->f32 fp rounding, ftz supported

    cvt_ftz_neari_f32_f64    $s2, $d1;

// cvt.disabled.type.combinations: disabled combinations of types

    cvt_u64_s64             $d1, $d2;
    cvt_s64_s64             $d1, $d2;
    cvt_s64_u64             $d1, $d2;
    cvt_u64_u64             $d1, $d2;

    cvt_u32_u32             $s1, $s2;
    cvt_u32_s32             $d1, $s2;
    cvt_s32_u32             $s1, $s1;
    cvt_s32_s32             $s1, $s1;

    cvt_u16_u16             $s1, $s2;
    cvt_s16_u16             $s1, $s2;
    cvt_s16_s16             $s1, $s2;
    cvt_u16_s16             $s1, $s2;

    cvt_u8_u8               $s1, $s2;
    cvt_s8_u8               $s1, $s2;
    cvt_s8_s8               $s1, $s2;
    cvt_u8_s8               $s1, $s2;

    cvt_b1_b1               $c1, $c2;

    cvt_f64_f64             $d1, $d2;
    cvt_f32_f32             $s1, $s2;
    cvt_f16_f16             $s1, $s2;

// cvt.no.rounding: no rounding

    cvt_near_s32_u8         $s1, $s2;
    cvt_zero_s32_s16        $s1, $s2;
    cvt_down_s16_u32        $s1, $s2;
    cvt_near_s32_b1         $s1, $c2;
    cvt_zero_s32_b1         $s1, $s2;
    cvt_down_s32_b1         $d1, $s2;

    cvt_neari_s32_u8        $s1, $s2;
    cvt_zeroi_s32_s16       $s1, $s2;
    cvt_downi_s16_u32       $s1, $s2;
    cvt_neari_s32_b1        $s1, $c2;
    cvt_zeroi_s32_b1        $s1, $s2;
    cvt_downi_s32_b1        $d1, $s2;

    cvt_downi_b1_f16        $d1, $s2;
    cvt_down_b1_f16         $d1, $s2;
    cvt_downi_f16_b1        $s1, $s2;
    cvt_down_f16_b1         $s1, $s2;

    cvt_down_f32_f16        $s1, $s2;
    cvt_down_f64_f16        $d1, $s2;
    cvt_down_f64_f32        $d1, $s2;

    cvt_downi_f32_f16       $s1, $s2;
    cvt_downi_f64_f16       $d1, $s2;
    cvt_downi_f64_f32       $d1, $s2;

// cvt.no.ftz: no ftz

    cvt_ftz_s32_u8          $s1, $s2;
    cvt_ftz_s32_s16         $s1, $s2;
    cvt_ftz_s16_u32         $s1, $s2;
    cvt_ftz_s32_b1          $s1, $c2;
    cvt_ftz_s32_b1          $s1, $s2;
    cvt_ftz_s32_b1          $d1, $s2;

    cvt_ftz_s32_u8          $s1, $s2;
    cvt_ftz_s32_s16         $s1, $s2;
    cvt_ftz_s16_u32         $s1, $s2;
    cvt_ftz_s32_b1          $s1, $c2;
    cvt_ftz_s32_b1          $s1, $s2;
    cvt_ftz_s32_b1          $d1, $s2;

    cvt_ftz_f16_b1          $s1, $s2;

    cvt_ftz_f64_u8          $d1, $s2;
    cvt_ftz_f32_s16         $s1, $s2;
    cvt_ftz_f16_u32         $s1, $s2;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// ld.dst.expansion: dst expansion

    [[ global_u32 &x; ]]    ld_global_f16               $d1, [&x];
    [[ global_u32 &x; ]]    ld_global_f16               $q1, [&x];
    [[ global_u32 &x; ]]    ld_global_f32               $q1, [&x];

                            ld_v2_f16                  ($d1,$d2), [$d3+4];
                            ld_v2_f32                  ($d1,$d2), [$d3+4];

                            ld_v4_f16                  ($d1,$d2,$d3,$d4), [$d3+4];
                            ld_v4_f32                  ($d1,$d2,$d3,$d4), [$d3+4];
                            ld_v4_f64                  ($q1,$q2,$q3,$q4), [$d3+4];

    [[ global_u32 &x; ]]    ld_global_s8                $d1, [&x][$d3+4];
    [[ global_u32 &x; ]]    ld_global_u8                $d1, [&x][$d3+4];
    [[ global_u32 &x; ]]    ld_global_s16               $d1, [&x];
    [[ global_u32 &x; ]]    ld_global_u16               $d1, [&x];
    [[ global_u32 &x; ]]    ld_global_s32               $d1, [&x];
    [[ global_u32 &x; ]]    ld_global_u32               $d1, [&x];
                            ld_v2_s8                   ($d1,$d2), [$d3+4];
                            ld_v2_u8                   ($d1,$d2), [$d3+4];
                            ld_v2_s16                  ($d1,$d2), [$d3+4];
                            ld_v2_u16                  ($d1,$d2), [$d3+4];
                            ld_v2_s32                  ($d1,$d2), [$d3+4];
                            ld_v2_u32                  ($d1,$d2), [$d3+4];
                            ld_v4_s8                   ($d1,$d2,$d3,$d4), [$d3+4];
                            ld_v4_u8                   ($d1,$d2,$d3,$d4), [$d3+4];
                            ld_v4_s16                  ($d1,$d2,$d3,$d4), [$d3+4];
                            ld_v4_u16                  ($d1,$d2,$d3,$d4), [$d3+4];
                            ld_v4_s32                  ($d1,$d2,$d3,$d4), [$d3+4];
                            ld_v4_u32                  ($d1,$d2,$d3,$d4), [$d3+4];

// ld.missing.v: missing 'v'

    ld_f64                  ($d1,$d2), [$d3+4];
    ld_f64                  ($d6,$d7,$d8), [$d3+4];
    ld_f64                  ($d6,$d7,$d8,$d9), [$d3+4];

// ld.invalid.v: invalid 'v'

    ld_f64                     ;
    ld_v2_f64                  ;
    ld_v3_f64                  ;
    ld_v4_f64                  ;

    ld_v0_f64                  ($d1,$d2), [$d3+4];
    ld_v1_f64                  ($d1,$d2), [$d3+4];
    ld_v3_f64                  ($d1,$d2), [$d3+4];
    ld_v4_f64                  ($d1,$d2), [$d3+4];
    ld_v5_f64                  ($d1,$d2), [$d3+4];

    ld_v0_f64                  ($d6,$d7,$d8), [$d3+4];
    ld_v1_f64                  ($d6,$d7,$d8), [$d3+4];
    ld_v2_f64                  ($d6,$d7,$d8), [$d3+4];
    ld_v4_f64                  ($d6,$d7,$d8), [$d3+4];
    ld_v5_f64                  ($d6,$d7,$d8), [$d3+4];

    ld_v0_f64                  ($d6,$d7,$d8,$d9), [$d3+4];
    ld_v1_f64                  ($d6,$d7,$d8,$d9), [$d3+4];
    ld_v2_f64                  ($d6,$d7,$d8,$d9), [$d3+4];
    ld_v3_f64                  ($d6,$d7,$d8,$d9), [$d3+4];
    ld_v5_f64                  ($d6,$d7,$d8,$d9), [$d3+4];

// ld.invalid.dst.vector: invalid dst vector

    ld_v2_f64                  ($d1,$d1), [$d3+4];
    ld_v4_f64                  ($d6,$d1,$d3,$d1), [$d3+4];

// ld.flat.address: flat address

                                                       ld_equiv(2)_f32             $s1, [%arg][$s0];
    [[ extension "IMAGE"; global_roimg &roimage; ]]    ld_roimg                    $d1, [&roimage];
    [[ extension "IMAGE"; global_rwimg &rwimage; ]]    ld_rwimg                    $d1, [&rwimage];

// ld.d.register.for.opaque: 'd' register for opaque

    [[ extension "IMAGE"; global_roimg &roimage; ]]    ld_global_roimg               $c1, [&roimage];
    [[ extension "IMAGE"; global_rwimg &rwimage; ]]    ld_global_rwimg               $s1, [&rwimage];
    [[ extension "IMAGE"; global_samp  &samp;    ]]    ld_global_samp                $q1, [&samp];

    [[ global_sig64 &sig;     ]]    ld_global_sig64               $c1, [&sig];
    [[ global_sig64 &sig;     ]]    ld_global_sig64               $s1, [&sig];
    [[ global_sig64 &sig;     ]]    ld_global_sig64               $q1, [&sig];

// ld.q.reg: 'q' registers

                                    ld_global_b64               $q1, [$d0];
    [[ extension "IMAGE"; ]]        ld_global_samp              $q1, [$d0];
                                    
// ld.b128: b128
                                    ld_global_b128              $d1, [$d0];
                                    ld_global_b128              $s1, [$d0];

// ld.opaque.types: opaque types

    [[ extension "IMAGE"; global_roimg &roimage; ]]    ld_global_b64               $d1, [&roimage];
    [[ extension "IMAGE"; global_rwimg &rwimage; ]]    ld_global_u64               $d1, [&rwimage];
    [[ extension "IMAGE"; global_samp  &samp;    ]]    ld_global_s64               $d1, [&samp];
                                    
    [[ extension "IMAGE"; global_rwimg &rwimage; ]]    ld_global_roimg               $d1, [&rwimage];
    [[ extension "IMAGE"; global_roimg &roimage; ]]    ld_global_rwimg               $d1, [&roimage];
    [[ extension "IMAGE"; global_rwimg &rwimage; ]]    ld_global_samp                $d1, [&rwimage];
                                    
    [[ extension "IMAGE"; global_samp  &samp;    ]]    ld_global_roimg               $d1, [&samp];
    [[ extension "IMAGE"; global_samp  &samp;    ]]    ld_global_rwimg               $d1, [&samp];
    [[ extension "IMAGE"; global_roimg &roimage; ]]    ld_global_samp                $d1, [&roimage];

    [[ extension "IMAGE"; ]] global_b8   %globalVar[8];      ld_global_roimg               $d1, [%globalVar];
    [[ extension "IMAGE"; ]] global_b8   %globalVar[8];      ld_global_rwimg               $d1, [%globalVar];
    [[ extension "IMAGE"; ]] global_b8   %globalVar[8];      ld_global_samp                $d1, [%globalVar];

// ld.mem.sem: mem sem

    ld_v2_scacq_f64                  ($d1,$d2), [$d3+4];
    ld_v2_part_scacq_f64             ($d1,$d2), [$d3+4];

// ld.eq.class: eq class

    ld_v2_equiv()_f64                   ($d1,$d2), [$d3+4];
    ld_v2_equiv(.)_f64                  ($d1,$d2), [$d3+4];
    ld_v2_equiv(1.0)_f64                ($d1,$d2), [$d3+4];

    ld_v2_equiv(-1)_f64                 ($d1,$d2), [$d3+4];
    ld_v2_equiv(-1)_f64                 ($d1,$d2), [$d3+4];
    ld_v2_equiv(256)_f64                ($d1,$d2), [$d3+4];
    ld_v2_equiv(1024)_f64               ($d1,$d2), [$d3+4];
    ld_v2_equiv(0xFFFFFFFF)_f64         ($d1,$d2), [$d3+4];
    ld_v2_equiv(0xFFFFFFFFFFFFFFFF)_f64 ($d1,$d2), [$d3+4];

// ld.width: width

    ld_width()_u64 $d6, [128];
    ld_width(.)_u64 $d6, [128];
    ld_width(0)_u64 $d6, [128];
    ld_width(3)_u64 $d6, [128];
    ld_width(5)_u64 $d6, [128];
    ld_width(6)_u64 $d6, [128];
    ld_width(7)_u64 $d6, [128];
    ld_width(9)_u64 $d6, [128];
    ld_width(10)_u64 $d6, [128];
    ld_width(11)_u64 $d6, [128];
    ld_width(12)_u64 $d6, [128];
    ld_width(13)_u64 $d6, [128];
    ld_width(14)_u64 $d6, [128];
    ld_width(15)_u64 $d6, [128];
    ld_width(2147483647)_u64 $d6, [128];
    ld_width(2147483649)_u64 $d6, [128];
    ld_width(4294967296)_u64 $d6, [128];

    ld_width(8589934592)_u64 $d6, [128];
    ld_width(0xFFFFFFFF)_u64 $d6, [128];
    ld_width(0xFFFFFFFFFFFFFFFF)_u64 $d6, [128];

// ld.align: align

    ld_align()_u64 $d6, [128];
    ld_align(-1)_u64 $d6, [128];
    ld_align(0)_u64 $d6, [128];
    ld_align(2)_global_u64 $d6, [128];
    ld_align(512)_u64 $d6, [128];

// ld.const

    [[ group_u32   &g; ]]                          ld_group_const_f64 $d1, [&g];
    [[ private_u32 &p; ]]                          ld_private_const_f64 $d1, [&p];
    [[ function &f()(arg_b32 %x)   {               ld_arg_const_f64 $d1, [%x]; }; ]]
    [[ function &f()()             { spill_b32 %x; ld_spill_const_f64 $d1, [%x]; }; ]]

// ld.const.dst

    ld_v2_u32                  ($s1,2), [$d3+4];
    ld_v4_f32                  ($s1,$s2,$s3,0.0f), [$d3+4];
    ld_v2_u32                  ($s1,WAVESIZE), [$d3+4];

// ld.malformed.addr

    [[ group_u32   &g; ]]       ld_group_f32 $s1, [&g][$d0];

// ld.addressable: cannot access arg and spill segments using flat addresses

    ld_arg_s32 $s1,   [0];
    ld_arg_s32 $s1,   [$s0-4];
    ld_spill_s32 $s1, [0];
    ld_spill_s32 $s1, [$s0-4];

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// st.src.expansion: src expansion

    [[ global_u32 &x; ]]    st_global_s8                $d1, [&x];
    [[ global_u32 &x; ]]    st_global_u8                $d1, [&x];
    [[ global_u32 &x; ]]    st_global_s16               $d1, [&x];
    [[ global_u32 &x; ]]    st_global_u16               $d1, [&x];
    [[ global_u32 &x; ]]    st_global_s32               $d1, [&x];
    [[ global_u32 &x; ]]    st_global_u32               $d1, [&x];
                            st_v2_s8                   ($d1,$d2), [$d3+4];
                            st_v2_u8                   ($d1,$d2), [$d3+4];
                            st_v2_s16                  ($d1,$d2), [$d3+4];
                            st_v2_u16                  ($d1,$d2), [$d3+4];
                            st_v2_s32                  ($d1,$d2), [$d3+4];
                            st_v2_u32                  ($d1,$d2), [$d3+4];
                            st_v4_s8                   ($d1,$d2,$d3,$d4), [$d3+4];
                            st_v4_u8                   ($d1,$d2,$d3,$d4), [$d3+4];
                            st_v4_s16                  ($d1,$d2,$d3,$d4), [$d3+4];
                            st_v4_u16                  ($d1,$d2,$d3,$d4), [$d3+4];
                            st_v4_s32                  ($d1,$d2,$d3,$d4), [$d3+4];
                            st_v4_u32                  ($d1,$d2,$d3,$d4), [$d3+4];

// st.missing.v: missing 'v'

    st_f64                  ($d1,$d2), [$d3+4];
    st_f64                  ($d6,$d7,$d8), [$d3+4];
    st_f64                  ($d6,$d7,$d8,$d9), [$d3+4];

// st.invalid.v: invalid 'v'

    st_f64                     ;
    st_v2_f64                  ;
    st_v3_f64                  ;
    st_v4_f64                  ;

    st_v0_f64                  ($d1,$d2), [$d3+4];
    st_v1_f64                  ($d1,$d2), [$d3+4];
    st_v3_f64                  ($d1,$d2), [$d3+4];
    st_v4_f64                  ($d1,$d2), [$d3+4];
    st_v5_f64                  ($d1,$d2), [$d3+4];

    st_v0_f64                  ($d6,$d7,$d8), [$d3+4];
    st_v1_f64                  ($d6,$d7,$d8), [$d3+4];
    st_v2_f64                  ($d6,$d7,$d8), [$d3+4];
    st_v4_f64                  ($d6,$d7,$d8), [$d3+4];
    st_v5_f64                  ($d6,$d7,$d8), [$d3+4];

    st_v0_f64                  ($d6,$d7,$d8,$d9), [$d3+4];
    st_v1_f64                  ($d6,$d7,$d8,$d9), [$d3+4];
    st_v2_f64                  ($d6,$d7,$d8,$d9), [$d3+4];
    st_v3_f64                  ($d6,$d7,$d8,$d9), [$d3+4];
    st_v5_f64                  ($d6,$d7,$d8,$d9), [$d3+4];

// st.align: align

    st_align()_u64              $d6, [128];
    st_align(-1)_u64            $d6, [128];
    st_align(0)_u64             $d6, [128];
    st_align(2)_global_u64      $d6, [128];
    st_align(512)_u64           $d6, [128];

// st.const

    [[ global_u32 &x; ]]    st_global_const_f64         $d1, [&x];

// st.opaque

    [[ extension "IMAGE"; global_roimg &x; ]]      st_global_roimg  $d1, [&x];
    [[ extension "IMAGE"; ]]                       st_group_roimg   $d1, [0];
    [[ extension "IMAGE"; ]]                       st_private_roimg $d1, [0];
    [[ extension "IMAGE"; ]]                       st_group_roimg   $d1, [0];
    [[ extension "IMAGE"; ]]                       st_roimg         $d1, [0];

// st.addressable: cannot access arg and spill segments using flat addresses

    st_arg_s32   $s1, [0];
    st_arg_s32   $s1, [$s0-4];
    st_spill_s32 $s1, [0];
    st_spill_s32 $s1, [$s0-4];

// st.b128.ws

st_global_b128	WAVESIZE, [0];

st_v2_global_b128	($q0, WAVESIZE), [0];
st_v3_global_b128	($q0, $q0, WAVESIZE), [0];
st_v4_global_b128	($q0, $q0, $q0, WAVESIZE), [0];


/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// atomic.segment

private_u32 %gx;    atomic_and_private_scar_system_b32    $s1, [%gx][$s0], 23;
readonly_u32 %gx;   atomic_and_readonly_scar_system_b32   $s1, [%gx][$d0], 23;
group_u32  %gx;     atomic_and_global_scar_system_b32     $s1, [%gx][$s0], 23;
global_u32 %gx;     atomic_and_group_scar_wave_b32       $s1, [%gx][$d0], 23;

[[ kernel   &k(kernarg_b32 %x) { atomic_and_kernarg_scar_wave_b32       $s1, [%x][$d0], 23; }; ]]
[[ function &f()(arg_b32 %x)   { atomic_and_arg_scar_wave_b32           $s1, [%x][$s0], 23; }; ]]
    
    
// atomic.operation

    [[ global_u32 &x; ]]    atomic_and_global_scar_system_s32    $s1, [&x][$d0], 23;
    [[ global_u32 &x; ]]    atomic_and_global_scar_system_u32       $s1, [&x], 23;
    [[ global_u32 &x; ]]    atomic_or_global_scar_system_s64     $d1, [&x], 23;
    [[ global_u32 &x; ]]    atomic_or_global_scar_system_u64        $d1, [&x], 23;
    [[ global_u32 &x; ]]    atomic_xor_global_scar_system_s64    $d1, [&x], 23;
    [[ global_u32 &x; ]]    atomic_xor_global_scar_system_u64       $d1, [&x], 23;
    [[ global_u32 &x; ]]    atomic_exch_global_scar_system_s64   $d1, [&x], 23;
    [[ global_u32 &x; ]]    atomic_exch_global_scar_system_u64      $d1, [&x], 23;

    [[ global_u32 &x; ]]    atomic_cas_global_scar_system_s64    $d1, [&x], 23, 12;
    [[ global_u32 &x; ]]    atomic_cas_global_scar_system_s64       $d1, [&x], 23, 1;
    [[ global_u32 &x; ]]    atomic_cas_global_scar_system_b64    $d1, [&x], 23;
    [[ global_u32 &x; ]]    atomic_cas_global_scar_system_b64       $d1, [&x], 23;

    [[ global_u32 &x; ]]    atomic_add_global_scar_system_b64    $d1, [&x], 23;
    [[ global_u32 &x; ]]    atomic_add_global_scar_system_b64       $d1, [&x], 23;
    [[ global_u32 &x; ]]    atomic_sub_global_scar_system_b64    $d1, [&x], 23;
    [[ global_u32 &x; ]]    atomic_sub_global_scar_system_b64       $d1, [&x], 23;
    [[ global_u32 &x; ]]    atomic_max_global_scar_system_b64    $d1, [&x], 23;
    [[ global_u32 &x; ]]    atomic_max_global_scar_system_b64       $d1, [&x], 23;
    [[ global_u32 &x; ]]    atomic_min_global_scar_system_b64    $d1, [&x], 23;
    [[ global_u32 &x; ]]    atomic_min_global_scar_system_b64       $d1, [&x], 23;

    [[ global_u32 &x; ]]    atomic_wrapinc_global_scar_system_s64    $d1, [&x], 23;
    [[ global_u32 &x; ]]    atomic_wrapinc_global_scar_system_s64       $d1, [&x], 23;
    [[ global_u32 &x; ]]    atomic_wrapdec_global_scar_system_s64    $d1, [&x], 23;
    [[ global_u32 &x; ]]    atomic_wrapdec_global_scar_system_s64       $d1, [&x], 23;

    [[ global_u32 &x; ]]    atomic_wrapinc_global_scar_system_b64    $d1, [&x], 23;
    [[ global_u32 &x; ]]    atomic_wrapinc_global_scar_system_b64       $d1, [&x], 23;
    [[ global_u32 &x; ]]    atomic_wrapdec_global_scar_system_b64    $d1, [&x], 23;
    [[ global_u32 &x; ]]    atomic_wrapdec_global_scar_system_b64       $d1, [&x], 23;

// atomic.mem.scope: Invalid memory scope

    [[ group_u32 &x; ]]    atomic_and_group_scar_agent_b64       $d1, [&x], 23;
    [[ group_u32 &x; ]]    atomic_and_group_scar_system_b64       $d1, [&x], 23;

///
/// -- DISABLED
///
/// atomic.64
///
///!small
///    [[ global_u32 &x; ]]    atomic_or_global_scar_system_b64     $d1, [&x], 23;
///    [[ global_u32 &x; ]]    atomic_add_global_scar_system_u64    $d1, [&x], 23;
///    [[ global_u32 &x; ]]    atomic_min_global_scar_system_s64    $d1, [&x], 23;

// atomic.equiv

    atomic_and_group_scar_wave_equiv()_b32     $s1, [&g][$d0], 23;
    atomic_and_group_scar_wave_equiv(-1)_b32   $s1, [&g][$d0], 23;
    atomic_and_group_scar_wave_equiv(1.)_b32   $s1, [&g][$d0], 23;
    atomic_and_group_scar_equiv(1)_wg_b32    $s1, [&g][$d0], 23;
    atomic_and_group_equiv(1)_scar_wg_b32    $s1, [&g][$d0], 23;
    atomic_and_equiv(1)_group_scar_wg_b32    $s1, [&g][$d0], 23;
    atomic_equiv(1)_and_group_scar_wg_b32    $s1, [&g][$d0], 23;

// atomic.st

    atomic_st_scar_system_b32              $s1, [$d2];

// atomic.ld.memord

    atomic_ld_scar_system_b32              $s1, [$d2];
    atomic_ld_screl_system_b32              $s1, [$d2];

// atomic.ld.type

    atomic_ld_scar_system_s32              $s1, [$d2];
    atomic_ld_scar_system_u32              $s1, [$d2];

// atomic.ld.operands

    atomic_ld_scacq_system_b32              $s1, [$d2], 1;
    atomic_ld_scacq_system_b32              $s1;
    atomic_ld_scacq_system_b32              ;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// atomicnoret.segment

private_b32 %gx;    atomicnoret_and_private_scar_system_b32    [%gx][$s0], 23;
readonly_b32 %gx;   atomicnoret_and_readonly_scar_system_b32   [%gx][$d0], 23;
group_b32  %gx;     atomicnoret_and_global_scar_system_b32     [%gx][$s0], 23;
global_b32 %gx;     atomicnoret_and_group_scar_wave_b32       [%gx][$d0], 23;

[[ kernel   &k(kernarg_b32 %x) { atomicnoret_and_kernarg_scar_wave_b32       [%x][$d0], 23; }; ]]
[[ function &f()(arg_b32 %x)   { atomicnoret_and_arg_scar_wave_b32           [%x][$s0], 23; }; ]]
    
// atomicnoret.operation

    [[ global_u32 &x; ]]    atomicnoret_and_global_scar_system_s32    [&x][$d0], 23;
    [[ global_u32 &x; ]]    atomicnoret_and_global_scar_system_u32    [&x], 23;
    [[ global_u32 &x; ]]    atomicnoret_or_global_scar_system_s64     [&x], 23;
    [[ global_u32 &x; ]]    atomicnoret_or_global_scar_system_u64     [&x], 23;
    [[ global_u32 &x; ]]    atomicnoret_xor_global_scar_system_s64    [&x], 23;
    [[ global_u32 &x; ]]    atomicnoret_xor_global_scar_system_u64    [&x], 23;
    [[ global_u32 &x; ]]    atomicnoret_exch_global_scar_system_s64   [&x], 23;
    [[ global_u32 &x; ]]    atomicnoret_exch_global_scar_system_u64   [&x], 23;

    [[ global_u32 &x; ]]    atomicnoret_cas_global_scar_system_s64    [&x], 23, 12;
    [[ global_u32 &x; ]]    atomicnoret_cas_global_scar_system_s64    [&x], 23, 1;
    [[ global_u32 &x; ]]    atomicnoret_cas_global_scar_system_b64    [&x], 23;
    [[ global_u32 &x; ]]    atomicnoret_cas_global_scar_system_b64    [&x], 23;

    [[ global_u32 &x; ]]    atomicnoret_add_global_scar_system_b64    [&x], 23;
    [[ global_u32 &x; ]]    atomicnoret_add_global_scar_system_b64    [&x], 23;
    [[ global_u32 &x; ]]    atomicnoret_sub_global_scar_system_b64    [&x], 23;
    [[ global_u32 &x; ]]    atomicnoret_sub_global_scar_system_b64    [&x], 23;
    [[ global_u32 &x; ]]    atomicnoret_max_global_scar_system_b64    [&x], 23;
    [[ global_u32 &x; ]]    atomicnoret_max_global_scar_system_b64    [&x], 23;
    [[ global_u32 &x; ]]    atomicnoret_min_global_scar_system_b64    [&x], 23;
    [[ global_u32 &x; ]]    atomicnoret_min_global_scar_system_b64    [&x], 23;

    [[ global_u32 &x; ]]    atomicnoret_wrapinc_global_scar_system_s64    [&x], 23;
    [[ global_u32 &x; ]]    atomicnoret_wrapinc_global_scar_system_s64    [&x], 23;
    [[ global_u32 &x; ]]    atomicnoret_wrapdec_global_scar_system_s64    [&x], 23;
    [[ global_u32 &x; ]]    atomicnoret_wrapdec_global_scar_system_s64    [&x], 23;

    [[ global_u32 &x; ]]    atomicnoret_wrapinc_global_scar_system_b64    [&x], 23;
    [[ global_u32 &x; ]]    atomicnoret_wrapinc_global_scar_system_b64    [&x], 23;
    [[ global_u32 &x; ]]    atomicnoret_wrapdec_global_scar_system_b64    [&x], 23;
    [[ global_u32 &x; ]]    atomicnoret_wrapdec_global_scar_system_b64    [&x], 23;

// atomicnoret.mem.scope: Invalid memory scope

    [[ group_u32 &x; ]]    atomicnoret_and_group_scar_agent_b64       [&x], 23;
    [[ group_u32 &x; ]]    atomicnoret_and_group_scar_system_b64       [&x], 23;

///
///
/// atomicnoret.64
///
///!small
///    [[ global_u32 &x; ]]    atomicnoret_or_global_scar_system_b64     [&x], 23;
///    [[ global_u32 &x; ]]    atomicnoret_add_global_scar_system_u64    [&x], 23;
///    [[ global_u32 &x; ]]    atomicnoret_min_global_scar_system_s64    [&x], 23;

// atomicnoret.equiv

    atomicnoret_and_group_scar_wg_equiv()_b32    [&g], 23;
    atomicnoret_and_group_scar_wg_equiv(-1)_b32  [&g], 23;
    atomicnoret_and_group_scar_wg_equiv(1.)_b32  [&g], 23;
    atomicnoret_equiv(1)_and_group_scar_wg_b32   [&g], 23;
    atomicnoret_and_equiv(1)_group_scar_wg_b32   [&g], 23;
    atomicnoret_and_group_equiv(1)_scar_wg_b32   [&g], 23;
    atomicnoret_and_group_scar_equiv(1)_wg_b32   [&g], 23;

// atomicnoret.ld

    atomicnoret_ld_scar_system_b32              [$d6], $s1;

// atomicnoret.st.memord

    atomicnoret_st_scar_system_b32           [$d6], $s1;
    atomicnoret_st_scacq_system_b32          [$d6], $s1;

// atomicnoret.st.type

    atomicnoret_st_scar_system_s32              [$d6], $s1;
    atomicnoret_st_scar_system_u32              [$d6], $s1;

// atomicnoret.st.operands

    atomicnoret_st_screl_system_b32              [$d6], $s1, 1;
    atomicnoret_st_screl_system_b32              [$d6];
    atomicnoret_st_screl_system_b32              ;

// atomicnoret.disabled.operation

!large

    [[ global_u32 &x; ]]    atomicnoret_cas_global_scar_system_b64   [&x], 23, 12;
    [[ global_u32 &x; ]]    atomicnoret_cas_global_scacq_agent_b64   [&x], 23, 12;
    [[ global_u32 &x; ]]    atomicnoret_cas_global_rlx_wave_b64   [&x], 23, 12;
    [[ global_u32 &x; ]]    atomicnoret_cas_global_screl_wg_b64   [&x], 23, 12;
    [[ group_u32 &x; ]]     atomicnoret_cas_group_rlx_wave_b64   [&x], 23, 9;
    [[ group_u32 &x; ]]     atomicnoret_cas_group_scacq_wg_b64   [&x], 23, 9;
    [[ global_u32 &x; ]]    atomicnoret_cas_rlx_wg_b64   [0], 23, 9;
    [[ global_u32 &x; ]]    atomicnoret_cas_screl_wave_b64   [0], 23, 9;
    [[ global_u32 &x; ]]    atomicnoret_cas_scar_agent_b64   [0], 23, 9;
    [[ global_u32 &x; ]]    atomicnoret_cas_scacq_system_b64   [0], 23, 9;

!base

    [[ global_u32 &x; ]]    atomicnoret_cas_global_scar_system_b64   [&x], 23, 12;
    [[ global_u32 &x; ]]    atomicnoret_cas_global_scacq_agent_b64   [&x], 23, 12;
    [[ global_u32 &x; ]]    atomicnoret_cas_global_rlx_wave_b64   [&x], 23, 12;
    [[ global_u32 &x; ]]    atomicnoret_cas_global_screl_wg_b64   [&x], 23, 12;
    [[ group_u32 &x; ]]     atomicnoret_cas_group_rlx_wave_b64   [&x], 23, 9;
    [[ group_u32 &x; ]]     atomicnoret_cas_group_scacq_wg_b64   [&x], 23, 9;
    [[ global_u32 &x; ]]    atomicnoret_cas_rlx_wg_b64   [0], 23, 9;
    [[ global_u32 &x; ]]    atomicnoret_cas_screl_wave_b64   [0], 23, 9;
    [[ global_u32 &x; ]]    atomicnoret_cas_scar_agent_b64   [0], 23, 9;
    [[ global_u32 &x; ]]    atomicnoret_cas_scacq_system_b64   [0], 23, 9;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// signal.st.operation

    signal_st_rlx_b64_sig64 $d0, $d2;

// signalnoret.ld.operation

    signalnoret_ld_rlx_b64_sig64 $d2, $d0;

// signalnoret.exch.operation

    signalnoret_exch_rlx_b64_sig64 $d2, $d0, $d3;
    signalnoret_exch_rlx_b64_sig64 $d0, $d3;

// signalnoret.wait.operation

    signalnoret_wait_eq_rlx_s64_sig64 $d2, $d0, $d3;
    signalnoret_wait_ne_rlx_s64_sig64 $d2, $d0, $d3;
    signalnoret_wait_lt_rlx_s64_sig64 $d2, $d0, $d3;
    signalnoret_wait_gte_rlx_s64_sig64 $d2, $d0, $d3;

// signalnoret.waittimeout.operation

    signalnoret_waittimeout_eq_rlx_s64_sig64 $d2, $d0, $d3, $d4;
    signalnoret_waittimeout_ne_rlx_s64_sig64 $d2, $d0, $d3, $d5;
    signalnoret_waittimeout_lt_rlx_s64_sig64 $d2, $d0, $d3, $d4;
    signalnoret_waittimeout_gte_rlx_s64_sig64 $d2, $d0, $d3, $d5;

// signal.order

    signalnoret_st_scacq_b64_sig64 $d0, $d2;

    signal_ld_screl_b64_sig64 $d2, $d0;
    signal_wait_eq_screl_s64_sig64 $d2, $d0, 23;
    signal_wait_ne_screl_s64_sig64 $d2, $d0, $d3;
    signal_wait_lt_screl_s64_sig64 $d2, $d0, 23;
    signal_wait_gte_screl_s64_sig64 $d2, $d0, $d3;
    signal_waittimeout_eq_screl_s64_sig64 $d2, $d0, 23, $d4;
    signal_waittimeout_ne_screl_s64_sig64 $d2, $d0, $d3, 1000;
    signal_waittimeout_lt_screl_s64_sig64 $d2, $d0, 23, $d4;
    signal_waittimeout_gte_screl_s64_sig64 $d2, $d0, $d3, 1000;

    signal_ld_scar_b64_sig64 $d2, $d0;
    signal_wait_eq_scar_s64_sig64 $d2, $d0, 23;
    signal_wait_ne_scar_s64_sig64 $d2, $d0, $d3;
    signal_wait_lt_scar_s64_sig64 $d2, $d0, 23;
    signal_wait_gte_scar_s64_sig64 $d2, $d0, $d3;
    signal_waittimeout_eq_scar_s64_sig64 $d2, $d0, 23, $d4;
    signal_waittimeout_ne_scar_s64_sig64 $d2, $d0, $d3, WAVESIZE;
    signal_waittimeout_lt_scar_s64_sig64 $d2, $d0, 23, $d4;
    signal_waittimeout_gte_scar_s64_sig64 $d2, $d0, $d3, WAVESIZE;
    signalnoret_st_scar_b64_sig64 $d0, $d2;

// signal.type

    signal_ld_rlx_s64_sig64 $d2, $d0;
    signal_and_rlx_s64_sig64 $d2, $d0, $d3;
    signal_or_rlx_u64_sig64 $d2, $d0, $d3;
    signal_xor_rlx_s64_sig64 $d2, $d0, $d3;
    signal_cas_rlx_u64_sig64 $d2, $d0, $d3, $d3;
    signal_exch_rlx_s64_sig64 $d2, $d0, $d3;
    signal_add_rlx_b64_sig64 $d2, $d0, $d3;
    signal_sub_rlx_b64_sig64 $d2, $d0, $d3;
    signal_wait_eq_rlx_u64_sig64 $d2, $d0, $d3;
    signal_wait_ne_rlx_b64_sig64 $d2, $d0, $d3;
    signal_wait_lt_rlx_u64_sig64 $d2, $d0, $d3;
    signal_wait_gte_rlx_b64_sig64 $d2, $d0, $d3;
    signal_waittimeout_eq_rlx_u64_sig64 $d2, $d0, $d3, $d4;
    signal_waittimeout_ne_rlx_b64_sig64 $d2, $d0, $d3, $d5;
    signal_waittimeout_lt_rlx_b64_sig64 $d2, $d0, $d3, $d4;
    signal_waittimeout_gte_rlx_u64_sig64 $d2, $d0, $d3, $d5;

// signalnoret.type

    signalnoret_st_rlx_u64_sig64 $d0, $d2;
    signalnoret_and_rlx_s64_sig64 $d0, $d3;
    signalnoret_or_rlx_u64_sig64 $d0, $d3;
    signalnoret_xor_rlx_s64_sig64 $d0, $d3;
    signalnoret_cas_rlx_s64_sig64 $d0, $d3, $d5;
    signalnoret_add_rlx_b64_sig64 $d0, $d3;
    signalnoret_sub_rlx_f64_sig64 $d0, $d3;

// signal.type.length

    signal_ld_rlx_b32_sig32 $s2, $d0;
    signal_ld_rlx_b32_sig64 $s2, $d0;
    signal_ld_rlx_b64_sig32 $d2, $d0;

    signal_and_rlx_b32_sig64 $d2, $d0, $d3;
    signal_or_rlx_b64_sig32 $d2, $d0, $d3;
    signal_xor_rlx_b32_sig32 $d2, $d0, $d3;
    signal_cas_rlx_b32_sig32 $s2, $d0, $s3, $s3;
    signal_exch_rlx_b32_sig64 $d2, $d0, $d3;

    signal_add_rlx_u32_sig64 $d2, $d0, $d3;
    signal_sub_rlx_u64_sig32 $d2, $d0, $d3;

    signal_wait_eq_rlx_s32_sig64 $d2, $d0, $d3;
    signal_wait_ne_rlx_s32_sig32 $d2, $d0, $d3;
    signal_wait_lt_rlx_s64_sig32 $d2, $d0, $d3;
    signal_waittimeout_eq_rlx_s32_sig64 $d2, $d0, $d3, $d4;
    signal_waittimeout_ne_rlx_s64_sig32 $d2, $d0, $d3, $d5;
    signal_waittimeout_lt_rlx_s32_sig32 $s2, $d0, $s3, $d4;

// signalnoret.type.length

    signalnoret_st_rlx_b32_sig32 $d0, $s2;
    signalnoret_st_rlx_b32_sig64 $d0, $s2;
    signalnoret_st_rlx_b64_sig32 $d0, $d2;

    signalnoret_and_rlx_b32_sig64 $d0, $d3;
    signalnoret_or_rlx_b64_sig32 $d0, $d3;
    signalnoret_xor_rlx_b32_sig32 $d0, $s3;
    signalnoret_cas_rlx_b32_sig32 $d0, $s3, $s5;

    signalnoret_add_rlx_s32_sig64 $d0, $d3;
    signalnoret_sub_rlx_u32_sig32 $d0, $s3;

// signal.dst

    signal_ld_rlx_b64_sig64                 $s2, $d0;
    signal_and_rlx_b64_sig64                $s2, $d0, $d3;
    signal_or_rlx_b64_sig64                 $s2, $d0, $d3;
    signal_xor_rlx_b64_sig64                $s2, $d0, $d3;
    signal_cas_rlx_b64_sig64                $s2, $d0, $d3, $d3;
    signal_exch_rlx_b64_sig64               $s2, $d0, $d3;
    signal_add_rlx_u64_sig64                $s2, $d0, $d3;
    signal_sub_rlx_u64_sig64                $s2, $d0, $d3;
    signal_wait_eq_rlx_s64_sig64            $s2, $d0, $d3;
    signal_wait_ne_rlx_s64_sig64            $s2, $d0, $d3;
    signal_wait_lt_rlx_s64_sig64            $s2, $d0, $d3;
    signal_wait_gte_rlx_s64_sig64           $s2, $d0, $d3;
    signal_waittimeout_eq_rlx_s64_sig64     $s2, $d0, $d3, $d4;
    signal_waittimeout_ne_rlx_s64_sig64     $s2, $d0, $d3, $d5;
    signal_waittimeout_lt_rlx_s64_sig64     $s2, $d0, $d3, $d4;
    signal_waittimeout_gte_rlx_s64_sig64    $s2, $d0, $d3, $d5;

// signal.handle

    signal_ld_rlx_b64_sig64                 $d2, $s0;
    signal_and_rlx_b64_sig64                $d2, $s0, $d3;
    signal_or_rlx_b64_sig64                 $d2, $s0, $d3;
    signal_xor_rlx_b64_sig64                $d2, $s0, $d3;
    signal_cas_rlx_b64_sig64                $d2, $s0, $d3, $d3;
    signal_exch_rlx_b64_sig64               $d2, $s0, $d3;
    signal_add_rlx_u64_sig64                $d2, $s0, $d3;
    signal_sub_rlx_u64_sig64                $d2, $s0, $d3;
    signal_wait_eq_rlx_s64_sig64            $d2, $s0, $d3;
    signal_wait_ne_rlx_s64_sig64            $d2, $s0, $d3;
    signal_wait_lt_rlx_s64_sig64            $d2, $s0, $d3;
    signal_wait_gte_rlx_s64_sig64           $d2, $s0, $d3;
    signal_waittimeout_eq_rlx_s64_sig64     $d2, $s0, $d3, $d4;
    signal_waittimeout_ne_rlx_s64_sig64     $d2, $s0, $d3, $d5;
    signal_waittimeout_lt_rlx_s64_sig64     $d2, $s0, $d3, $d4;
    signal_waittimeout_gte_rlx_s64_sig64    $d2, $s0, $d3, $d5;

// signalnoret.handle

    signalnoret_st_rlx_b64_sig64            $s0, $d2;
    signalnoret_and_rlx_b64_sig64           $s0, $d3;
    signalnoret_or_rlx_b64_sig64            $s0, $d3;
    signalnoret_xor_rlx_b64_sig64           $s0, $d3;
    signalnoret_cas_rlx_b64_sig64           $s0, $d3, $d5;
    signalnoret_add_rlx_s64_sig64           $s0, $d3;
    signalnoret_sub_rlx_u64_sig64           $s0, $d3;

// signal.src

    signal_and_rlx_b64_sig64                $d2, $d0, $s3;
    signal_or_rlx_b64_sig64                 $d2, $d0, $s3;
    signal_xor_rlx_b64_sig64                $d2, $d0, $s3;
    signal_cas_rlx_b64_sig64                $d2, $d0, $s3, $d3;
    signal_cas_rlx_b64_sig64                $d2, $d0, $d3, $s3;
    signal_exch_rlx_b64_sig64               $d2, $d0, $s3;
    signal_add_rlx_u64_sig64                $d2, $d0, $s3;
    signal_sub_rlx_u64_sig64                $d2, $d0, $s3;
    signal_wait_eq_rlx_s64_sig64            $d2, $d0, $s3;
    signal_wait_ne_rlx_s64_sig64            $d2, $d0, $s3;
    signal_wait_lt_rlx_s64_sig64            $d2, $d0, $s3;
    signal_wait_gte_rlx_s64_sig64           $d2, $d0, $s3;
    signal_waittimeout_eq_rlx_s64_sig64     $d2, $d0, $d3, $s4;
    signal_waittimeout_ne_rlx_s64_sig64     $d2, $d0, $d3, $s5;
    signal_waittimeout_lt_rlx_s64_sig64     $d2, $d0, $s3, $d4;
    signal_waittimeout_gte_rlx_s64_sig64    $d2, $d0, $s3, $d5;

// signalnoret.src

    signalnoret_st_rlx_b64_sig64            $d0, $s2;
    signalnoret_and_rlx_b64_sig64           $d0, $s3;
    signalnoret_or_rlx_b64_sig64            $d0, $s3;
    signalnoret_xor_rlx_b64_sig64           $d0, $s3;
    signalnoret_cas_rlx_b64_sig64           $d0, $s3, $d5;
    signalnoret_cas_rlx_b64_sig64           $d0, $d3, $s5;
    signalnoret_add_rlx_s64_sig64           $d0, $s3;
    signalnoret_sub_rlx_u64_sig64           $d0, $s3;

// signal.timeout

    signal_waittimeout_eq_rlx_s64_sig64     $d2, $d0, $d3, $s4;
    signal_waittimeout_ne_rlx_s64_sig64     $d2, $d0, $d3, $s5;
    signal_waittimeout_lt_rlx_s64_sig64     $d2, $d0, $d3, $s4;
    signal_waittimeout_gte_rlx_s64_sig64    $d2, $d0, $d3, $s5;

// signal.small.model.type

!small

    signal_ld_rlx_b64_sig32 $s2, $d0;
    signal_ld_rlx_b64_sig32 $d2, $d0;

    signal_and_rlx_b64_sig32 $s2, $d0, $s3;
    signal_or_rlx_b64_sig32 $d2, $d0, $d3;

    signal_add_rlx_u64_sig32 $s2, $d0, $s3;
    signal_sub_rlx_u64_sig32 $d2, $d0, $d3;

    signal_wait_eq_rlx_s64_sig32 $s2, $d0, $s3;
    signal_wait_ne_rlx_s64_sig32 $d2, $d0, $d3;

// signalnoret.small.model.type

!small

    signalnoret_st_rlx_b64_sig32 $d0, $d2;
    signalnoret_st_rlx_b64_sig32 $d0, $s2;

    signalnoret_and_rlx_b64_sig32 $d0, $d3;
    signalnoret_or_rlx_b64_sig32 $d0, $s3;

    signalnoret_cas_rlx_b64_sig32 $d0, $s3, $s5;
    signalnoret_cas_rlx_b64_sig32 $d0, $d3, $s5;
    signalnoret_cas_rlx_b64_sig32 $d0, $d3, $d5;

// signal.small.model.sig

!small

    signal_ld_rlx_b32_sig64 $s2, $d0;
    signal_ld_rlx_b64_sig64 $s2, $d0;

    signal_and_rlx_b32_sig64 $s2, $d0, $s3;
    signal_or_rlx_b64_sig64 $s2, $d0, $s3;

    signal_waittimeout_eq_rlx_s32_sig64 $s2, $d0, $s3, $d4;
    signal_waittimeout_ne_rlx_s64_sig64 $s2, $d0, $s3, $d5;

// signalnoret.small.model.sig

!small

    signalnoret_st_rlx_b32_sig64 $d0, $s2;
    signalnoret_st_rlx_b64_sig64 $d0, $s2;

    signalnoret_and_rlx_b32_sig64 $d0, $s3;
    signalnoret_or_rlx_b64_sig64 $d0, $s3;

    signalnoret_cas_rlx_b32_sig64 $d0, $s3, $s5;
    signalnoret_cas_rlx_b64_sig64 $d0, $s3, $s5;
    signalnoret_cas_rlx_b64_sig64 $d0, $d3, $d5;

// signal.small.model.handle

!small

    signal_ld_rlx_b32_sig32 $s2, $s0;
    signal_and_rlx_b32_sig32 $s2, $s0, $s3;
    signal_add_rlx_u32_sig32 $s2, $s0, $s3;
    signal_wait_eq_rlx_s32_sig32 $s2, $s0, $s3;
    signal_waittimeout_eq_rlx_s32_sig32 $s2, $s0, $s3, $d4;

// signalnoret.small.model.handle

!small

    signalnoret_st_rlx_b32_sig32 $s0, $s2;
    signalnoret_and_rlx_b32_sig32 $s0, $s3;
    signalnoret_cas_rlx_b32_sig32 $s0, $s3, $s5;

// signalnoret.disabled.operation

!large
    signalnoret_cas_rlx_b64_sig64 $d0, $d3, $d5;
    signalnoret_cas_scacq_b64_sig64 $d0, WAVESIZE, 12;
    signalnoret_cas_screl_b64_sig64 $d0, 23, 12;
    signalnoret_cas_scar_b64_sig64 $d0, 23, WAVESIZE;


!small
    signalnoret_cas_rlx_b32_sig32 $d0, $s3, $s5;
    signalnoret_cas_scacq_b32_sig32 $d0, WAVESIZE, 12;
    signalnoret_cas_screl_b32_sig32 $d0, 23, 12;
    signalnoret_cas_scar_b32_sig32 $d0, 23, WAVESIZE;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// sig32: sig32 type is allowed only with small machine model

[[ decl global_sig32 &x; ]]
[[      global_sig32 &x; ]]

[[ decl function &fn()(arg_sig32 %x);  ]]

[[        function &fn()()            {   private_sig32   %x; };   ]]
[[        function &fn()()            {   spill_sig32     %x; };   ]]

[[ kernel &k(kernarg_sig32 %x)  {                     };   ]]
[[ kernel &k()                {   global_sig32    %x; };   ]]
[[ kernel &k()                {   readonly_sig32  %x; };   ]]
[[ kernel &k()                {   group_sig32     %x; };   ]]
[[ kernel &k()                {   private_sig32   %x; };   ]]
[[ kernel &k()                {   spill_sig32     %x; };   ]]

mov_sig32             $s1, $s8;

// sig64: sig64 type is allowed only with large machine model

!small

[[ decl global_sig64 &x; ]]
[[      global_sig64 &x; ]]

[[ decl function &fn()(arg_sig64 %x);  ]]

[[        function &fn()()            {   private_sig64   %x; };   ]]
[[        function &fn()()            {   spill_sig64     %x; };   ]]

[[ kernel &k(kernarg_sig64 %x)  {                     };   ]]
[[ kernel &k()                {   global_sig64    %x; };   ]]
[[ kernel &k()                {   readonly_sig64  %x; };   ]]
[[ kernel &k()                {   group_sig64     %x; };   ]]
[[ kernel &k()                {   private_sig64   %x; };   ]]
[[ kernel &k()                {   spill_sig64     %x; };   ]]

mov_sig64             $d1, $d8;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Base profile does not support:
/// - the 64-bit floating-point type (f64) and 64-bit packed floating-point type (2xf64)
/// - double-precision floating point constants
/// - any variable declarations and definitions of 64-bit fp types
/// - any operations on 64-bit fp types
/// - support only the near, zeroi, zeroi_sat rounding modes
/// - require all operations specify ftz (if they support it)
/// - DETECT and BREAK exception policies are not supported
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// base.profile.f64

!base

[[ decl global_f64 &x; ]]
[[      global_f64 &x; ]]

[[ decl function &fn()(arg_f64 %x);  ]]

[[        function &fn()()            {   private_f64   %x; };   ]]
[[        function &fn()()            {   spill_f64     %x; };   ]]

[[ kernel &k(kernarg_f64 %x)  {                     };   ]]
[[ kernel &k()                {   global_f64    %x; };   ]]
[[ kernel &k()                {   readonly_f64  %x; };   ]]
[[ kernel &k()                {   group_f64     %x; };   ]]
[[ kernel &k()                {   private_f64   %x; };   ]]
[[ kernel &k()                {   spill_f64     %x; };   ]]

abs_f64             $d1,$d2;
neg_f64             $d3,1.0;
mov_f64             $d1, $d8;
copysign_f64        $d3,$d2,$d1;
sqrt_f64           $d0, 3.2;

// base.profile.f64x2

!base

[[ decl global_f64x2 &x; ]]
[[      global_f64x2 &x; ]]

[[ decl function &fn()(arg_f64x2 %x);   ]]

[[        function &fn()()              {   private_f64x2   %x; };   ]]
[[        function &fn()()              {   spill_f64x2     %x; };   ]]

[[ kernel &k(kernarg_f64x2 %x)  {                       };   ]]
[[ kernel &k()                  {   global_f64x2    %x; };   ]]
[[ kernel &k()                  {   readonly_f64x2  %x; };   ]]
[[ kernel &k()                  {   group_f64x2     %x; };   ]]
[[ kernel &k()                  {   private_f64x2   %x; };   ]]
[[ kernel &k()                  {   spill_f64x2     %x; };   ]]

abs_s_f64x2         $q1, $q1;
add_ftz_ps_f64x2    $q3,$q2,$q1;
pack_f64x2_f64      $q1, $q1, $d2, $s0;
unpack_f64_f64x2    $d1, $q2, $s3;


// base.profile.ftz

!base

    add_f32	$s0, 0Fffffffff, $s0;
    add_f16	$s0, 0Hffff, $s0;
    add_f16	$s0, $s0, 0Hffff;
    add_ps_f16x2	$s0, $s0, $s0;
    add_sp_f16x2	$s0, $s0, $s0;
    add_ss_f16x2	$s0, $s0, $s0;
    add_pp_f16x2	$s0, f16x2(0Hffff,0Hffff), $s0;
    add_pp_f16x2	$s0, $s0, f16x2(0Hffff,0Hffff);
    sub_ps_f16x4	$d0, $d0, $d0;
    sub_sp_f16x4	$d0, $d0, $d0;
    sub_ss_f16x4	$d0, $d0, $d0;
    sub_pp_f16x4	$d0, f16x4(0Hffff,0Hffff,0Hffff,0Hffff), $d0;
    sub_pp_f16x4	$d0, $d0, f16x4(0Hffff,0Hffff,0Hffff,0Hffff);
    max_f16	$s0, 0Hffff, $s0;
    max_f16	$s0, $s0, 0Hffff;
    max_f32	$s0, 0Fffffffff, $s0;
    max_ps_f16x2	$s0, $s0, $s0;
    max_sp_f16x2	$s0, $s0, $s0;
    max_ss_f16x2	$s0, $s0, $s0;
    max_pp_f16x2	$s0, f16x2(0Hffff,0Hffff), $s0;
    min_ps_f32x4	$q0, $q0, $q0;
    min_sp_f32x4	$q0, $q0, $q0;
    min_ss_f32x4	$q0, $q0, $q0;
    min_pp_f32x4	$q0, f32x4(0F00000000,0F00000000,0F6bf037ae,0F325f1c71), $q0;
    min_pp_f32x4	$q0, $q0, f32x4(0F00000000,0F00000000,0F6bf037ae,0F325f1c71);
    mul_f16	$s0, 0Hffff, $s0;
    mul_f16	$s0, $s0, 0Hffff;
    mul_ps_f16x2	$s0, $s0, $s0;
    mul_sp_f16x2	$s0, $s0, $s0;
    mul_ss_f16x2	$s0, $s0, $s0;
    mul_pp_f16x2	$s0, f16x2(0Hffff,0Hffff), $s0;
    mul_pp_f16x2	$s0, $s0, f16x2(0Hffff,0Hffff);
    div_f16	$s0, 0Hffff, $s0;
    div_f16	$s0, $s0, 0Hffff;
    div_ps_f16x2	$s0, $s0, $s0;
    div_sp_f16x2	$s0, $s0, $s0;
    div_ss_f16x2	$s0, $s0, $s0;
    div_pp_f16x2	$s0, f16x2(0Hffff,0Hffff), $s0;
    div_pp_f16x2	$s0, $s0, f16x2(0Hffff,0Hffff);
    fract_s_f16x2	$s0, $s0;
    fract_p_f16x2	$s0, $s0;
    fract_s_f16x2	$s0, f16x2(0Hffff,0Hffff);
    sqrt_f32	$s0, 0Fffffffff;
    ceil_f16	$s0, 0Hffff;
    floor_p_f16x2	$s0, $s0;
    rint_p_f16x2	$s0, $s0;
    trunc_f16	$s0, 0Hffff;
    fma_f16	$s0, 0Hffff, $s0, $s0;
    cmp_eq_u32_f16	$s0, $s0, $s0;
    cvt_zeroi_sat_s8_f16	$s0, $s0;
    cvt_zeroi_s8_f16	$s0, $s0;


// base.profile.rounding

!base

    add_ftz_zero_f16	$s0, $s0, $s0;
    add_ftz_up_f16	$s0, $s0, $s0;
    add_ftz_down_f16	$s0, $s0, $s0;
    add_ftz_zero_f32	$s0, $s0, $s0;
    add_ftz_up_f32	$s0, $s0, $s0;
    add_ftz_down_f32	$s0, $s0, $s0;
    add_ftz_zero_pp_f16x2	$s0, $s0, $s0;
    add_ftz_up_pp_f16x2	$s0, $s0, $s0;
    add_ftz_down_pp_f16x2	$s0, $s0, $s0;

    sub_ftz_up_pp_f16x4	$d0, $d0, $d0;
    sub_ftz_zero_pp_f16x4	$d0, $d0, $d0;
    sub_ftz_down_pp_f16x4	$d0, $d0, $d0;

    mul_ftz_zero_f16	$s0, $s0, $s0;
    mul_ftz_up_f16	$s0, $s0, $s0;
    mul_ftz_down_f16	$s0, $s0, $s0;
    mul_ftz_zero_pp_f16x2	$s0, $s0, $s0;
    mul_ftz_up_pp_f16x2	$s0, $s0, $s0;
    mul_ftz_down_pp_f16x2	$s0, $s0, $s0;

    div_ftz_zero_f16	$s0, $s0, $s0;
    div_ftz_up_f16	$s0, $s0, $s0;
    div_ftz_down_f16	$s0, $s0, $s0;
    div_ftz_zero_pp_f16x2	$s0, $s0, $s0;
    div_ftz_up_pp_f16x2	$s0, $s0, $s0;
    div_ftz_down_pp_f16x2	$s0, $s0, $s0;

    sqrt_ftz_zero_f32	$s0, $s0;
    sqrt_ftz_up_f32	$s0, $s0;
    sqrt_ftz_down_f32	$s0, $s0;

    fma_ftz_zero_f16	$s0, $s0, $s0, $s0;
    fma_ftz_up_f16	$s0, $s0, $s0, $s0;
    fma_ftz_down_f16	$s0, $s0, $s0, $s0;

    cvt_zero_f16_u32	$s0, $s0;
    cvt_up_f16_u32	$s0, $s0;
    cvt_down_f16_u32	$s0, $s0;
    cvt_zero_f16_s32	$s0, $s0;
    cvt_up_f16_s32	$s0, $s0;
    cvt_down_f16_s32	$s0, $s0;

    cvt_ftz_upi_s8_f16	$s0, $s0;
    cvt_ftz_downi_s8_f16	$s0, $s0;
    cvt_ftz_neari_s8_f16	$s0, $s0;

    cvt_ftz_upi_sat_s8_f16	$s0, $s0;
    cvt_ftz_downi_sat_s8_f16	$s0, $s0;
    cvt_ftz_neari_sat_s8_f16	$s0, $s0;

    cvt_ftz_supi_s8_f16	$s0, $s0;
    cvt_ftz_sdowni_s8_f16	$s0, $s0;
    cvt_ftz_sneari_s8_f16	$s0, $s0;

    cvt_ftz_supi_sat_s8_f16	$s0, $s0;
    cvt_ftz_sdowni_sat_s8_f16	$s0, $s0;
    cvt_ftz_sneari_sat_s8_f16	$s0, $s0;


/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// image.extension: Image and sampler types and instructions are only supported if the IMAGE extension has been specified

[[ decl global_roimg &roimage; ]]
[[ decl global_rwimg &rwimage; ]]
[[ decl global_samp  &samp;    ]]
[[ global_roimg &roimage; ]]
[[ global_rwimg &rwimage; ]]
[[ global_samp  &samp;    ]]
[[ alloc(agent) global_roimg &x = roimg(geometry = 1d,  width = 1, channel_type = unorm_int_101010, channel_order = rgbx);     ]]
[[ alloc(agent) global_samp  &x = samp(coord = normalized, filter = nearest, addressing = clamp_to_edge); ]]
                                
[[ function &fn()() {   global_rwimg    %x; };   ]]
[[ function &fn()() {   readonly_rwimg  %x; };   ]]
[[ function &fn()() {   group_samp     %x; };   ]]
[[ function &fn()() {   private_samp   %x; };   ]]
[[ function &fn()() {   spill_samp     %x; };   ]]

[[ kernel &k() {   global_rwimg    %x; };   ]]
[[ kernel &k() {   readonly_rwimg  %x; };   ]]
[[ kernel &k() {   group_roimg     %x; };   ]]
[[ kernel &k() {   private_roimg   %x; };   ]]
[[ kernel &k() {   spill_roimg     %x; };   ]]

ld_global_roimg               $d1, [$d0];
ld_global_rwimg               $d1, [$d0];
ld_global_samp                $d1, [$d0];

st_global_roimg               $d1, [$d0];
st_global_rwimg               $d1, [$d0];
st_global_samp                $d1, [$d0];
    
mov_samp            $d1, $d2;
mov_roimg           $d1, $d2;
mov_rwimg           $d1, $d2;
mov_rwimg           $d1, WAVESIZE;

rdimage_v4_1d_s32_roimg_f32     ($s0, $s1, $s5, $s3), $d1, $d3,    $s6;
ldimage_v4_1d_u32_roimg_u32     ($s1, $s2, $s3, $s4), $d2,    $s4;
stimage_v4_1d_f32_rwimg_u32     ($s1, $s2, $s3, $s4), $d1,    $s4;

///queryimagewidth_u32_rwimg        $s1, $d1;
///queryimageheight_u32_rwimg       $s0, $d1;
///queryimagedepth_u32_rwimg        $s0, $d1;
///queryimagearray_u32_roimg        $s1, $d2;
///queryimageorder_u32_roimg        $s0, $d2;
///queryimageformat_u32_roimg       $s0, $d2;
///querysamplercoord_u32_samp       $s0, $d3;
///querysamplerfilter_u32_samp      $s0, $d3;
///querysamplerboundary_u32_samp    $s0, $d3, 1;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// rdimage

    [[ extension "IMAGE";  ]] rdimage_v4_1db_s32_roimg_f32    ($s0, $s1, $s5, $s3), $d1, $d3,    $s6;

    [[ extension "IMAGE";  ]] rdimage_v4_1da_u32_roimg_s32    ($s1, $s2, $s3), $d1, $d3,      ($s6, $s7);
    [[ extension "IMAGE";  ]] rdimage_v4_2d_s32_roimg_s32     ($s3, $s4), $d2, $d3,           ($s6, $s9);
    [[ extension "IMAGE";  ]] rdimage_v4_2da_f32_roimg_f32    ($s4), $d1, $d3,                ($s6, $s9, $s12);

    [[ extension "IMAGE";  ]] rdimage_v4_1d_s32_roimg_f32     ($s0, $s1, $s5, $s3), $d1, $d3,    ($s6, $s7);
    [[ extension "IMAGE";  ]] rdimage_v4_1da_u32_roimg_s32    ($s0, $s1, $s2, $s3), $d1, $d3,    $s6;
    [[ extension "IMAGE";  ]] rdimage_v4_2d_s32_roimg_s32     ($s0, $s1, $s3, $s4), $d2, $d3,    ($s6, $s9, $s12);
    [[ extension "IMAGE";  ]] rdimage_v4_2da_f32_roimg_f32    ($s0, $s1, $s3, $s4), $d1, $d3,    ($s6, $s9);
    [[ extension "IMAGE";  ]] rdimage_v4_3d_s32_roimg_f32     ($s0, $s1, $s3, $s4), $d2, $d3,    $s6;

    [[ extension "IMAGE";  ]] rdimage_v4_1d_s32_samp_f32      ($s0, $s1, $s5, $s3), $d1, $d3,    $s6;
    [[ extension "IMAGE";  ]] rdimage_v4_1da_u32_roimg_u32    ($s0, $s1, $s2, $s3), $d1, $d3,    ($s6, $s7);

    [[ extension "IMAGE";  ]] rdimage_v2_2d_s32_roimg_s32     ($s0, $s1, $s3, $s4), $d2, $d3,    ($s6, $s9);
    [[ extension "IMAGE";  ]] rdimage_2da_f32_roimg_f32       ($s0, $s1, $s3, $s4), $d1, $d3,    ($s6, $s9, $s12);
    [[ extension "IMAGE";  ]] rdimage_v1_3d_s32_roimg_f32     ($s0, $s1, $s3, $s4), $d2, $d3,    ($s6, $s9, $s2);

// rdimage.equiv

    [[ extension "IMAGE"; ]] rdimage_v4_3d_equiv()_s32_roimg_f32     ($s0, $s1, $s3, $s4), $d2, $d3,    ($s6, $s9, $s2);
    [[ extension "IMAGE"; ]] rdimage_v4_3d_equiv(1.)_s32_roimg_f32   ($s0, $s1, $s3, $s4), $d2, $d3,    ($s6, $s9, $s2);
    [[ extension "IMAGE"; ]] rdimage_v4_3d_equiv(-1)_s32_roimg_f32   ($s0, $s1, $s3, $s4), $d2, $d3,    ($s6, $s9, $s2);
    [[ extension "IMAGE"; ]] rdimage_v4_3d_equiv(256)_s32_roimg_f32  ($s0, $s1, $s3, $s4), $d2, $d3,    ($s6, $s9, $s2);
    [[ extension "IMAGE"; ]] rdimage_equiv(1)_v4_3d_s32_roimg_f32    ($s0, $s1, $s3, $s4), $d2, $d3,    ($s6, $s9, $s2);
    [[ extension "IMAGE"; ]] rdimage_v4_equiv(1)_3d_s32_roimg_f32    ($s0, $s1, $s3, $s4), $d2, $d3,    ($s6, $s9, $s2);
    [[ extension "IMAGE"; ]] rdimage_v4_3d_s32_equiv(1)_roimg_f32    ($s0, $s1, $s3, $s4), $d2, $d3,    ($s6, $s9, $s2);
    [[ extension "IMAGE"; ]] rdimage_v4_3d_s32_roimg_equiv(1)_f32    ($s0, $s1, $s3, $s4), $d2, $d3,    ($s6, $s9, $s2);

// rdimage.2ddepth

    [[ extension "IMAGE"; ]] rdimage_v4_2ddepth_s32_roimg_f32 $s0, $d2, $d3, ($s6, $s9);
    [[ extension "IMAGE"; ]] rdimage_v4_2ddepth_s32_roimg_f32 ($s0, $s1, $s3, $s4), $d2, $d3, ($s6, $s9);
    [[ extension "IMAGE"; ]] rdimage_v2_2ddepth_s32_roimg_f32 ($s0, $s4), $d2, $d3, ($s6, $s9);
    [[ extension "IMAGE"; ]] rdimage_2ddepth_s32_roimg_f32 ($s0, $s1, $s3, $s4), $d2, $d3, ($s6, $s9);
    [[ extension "IMAGE"; ]] rdimage_2ddepth_s32_roimg_f32 ($s0), $d2, $d3, ($s6, $s9);
    [[ extension "IMAGE"; ]] rdimage_2ddepth_s32_roimg_f32 ($s0, $s4), $d2, $d3, ($s6, $s9);
    [[ extension "IMAGE"; ]] rdimage_2ddepth_s32_roimg_f32 $s0, $d2, $d3, ($s6, $s9, $s1, $s0);
    [[ extension "IMAGE"; ]] rdimage_2ddepth_s32_roimg_f32 $s0, $d2, $d3, ($s6, $s9, $s1);
    [[ extension "IMAGE"; ]] rdimage_2ddepth_s32_roimg_f32 $s0, $d2, $d3, ($s6);
    [[ extension "IMAGE"; ]] rdimage_2ddepth_s32_roimg_f32 $s0, $d2, $d3, $s6;

// rdimage.2dadepth

    [[ extension "IMAGE"; ]] rdimage_v4_2dadepth_s32_roimg_f32 $s0, $d2, $d3, ($s6, $s7, $s9);
    [[ extension "IMAGE"; ]] rdimage_v4_2dadepth_s32_roimg_f32 ($s0, $s1, $s3, $s4), $d2, $d3, ($s6, $s7, $s9);
    [[ extension "IMAGE"; ]] rdimage_v2_2dadepth_s32_roimg_f32 ($s0, $s4), $d2, $d3, ($s6, $s7, $s9);
    [[ extension "IMAGE"; ]] rdimage_2dadepth_s32_roimg_f32 ($s0, $s1, $s3, $s4), $d2, $d3, ($s6, $s7, $s9);
    [[ extension "IMAGE"; ]] rdimage_2dadepth_s32_roimg_f32 ($s0), $d2, $d3, ($s6, $s7, $s9);
    [[ extension "IMAGE"; ]] rdimage_2dadepth_s32_roimg_f32 ($s0, $s4), $d2, $d3, ($s6, $s7, $s9);
    [[ extension "IMAGE"; ]] rdimage_2dadepth_s32_roimg_f32 $s0, $d2, $d3, ($s6, $s9, $s1, $s0);
    [[ extension "IMAGE"; ]] rdimage_2dadepth_s32_roimg_f32 $s0, $d2, $d3, ($s6, $s9);
    [[ extension "IMAGE"; ]] rdimage_2dadepth_s32_roimg_f32 $s0, $d2, $d3, ($s6);
    [[ extension "IMAGE"; ]] rdimage_2dadepth_s32_roimg_f32 $s0, $d2, $d3, $s6;

// rdimage.rwimg: rwimg is not supported

    [[ extension "IMAGE"; ]] rdimage_v4_1d_s32_rwimg_f32     ($s0, $s1, $s5, $s3), $d1, $d3,    $s6;
    [[ extension "IMAGE"; ]] rdimage_v4_1da_u32_rwimg_s32    ($s0, $s1, $s2, $s3), $d1, $d3,    ($s6, $s7);
    [[ extension "IMAGE"; ]] rdimage_v4_2d_s32_rwimg_s32     ($s0, $s1, $s3, $s4), $d2, $d3,    ($s6, $s9);
    [[ extension "IMAGE"; ]] rdimage_v4_2da_f32_rwimg_f32    ($s0, $s1, $s3, $s4), $d1, $d3,    ($s6, $s9, $s12);
    [[ extension "IMAGE"; ]] rdimage_v4_3d_s32_rwimg_f32     ($s0, $s1, $s3, $s4), $d2, $d3,    ($s6, $s9, $s2);

// rdimage.woimg: woimg is not supported

    [[ extension "IMAGE"; ]] rdimage_v4_1d_s32_woimg_f32     ($s0, $s1, $s5, $s3), $d1, $d3,    $s6;
    [[ extension "IMAGE"; ]] rdimage_v4_1da_u32_woimg_s32    ($s0, $s1, $s2, $s3), $d1, $d3,    ($s6, $s7);
    [[ extension "IMAGE"; ]] rdimage_v4_2d_s32_woimg_s32     ($s0, $s1, $s3, $s4), $d2, $d3,    ($s6, $s9);
    [[ extension "IMAGE"; ]] rdimage_v4_2da_f32_woimg_f32    ($s0, $s1, $s3, $s4), $d1, $d3,    ($s6, $s9, $s12);
    [[ extension "IMAGE"; ]] rdimage_v4_3d_s32_woimg_f32     ($s0, $s1, $s3, $s4), $d2, $d3,    ($s6, $s9, $s2);

/////////////////////////////////////////////////////////////////////////////////////////////////////////
// stimage.roimg: roimg is not supported

    [[ extension "IMAGE"; ]] stimage_v4_1d_f32_roimg_u32     ($s1, $s2, $s3, $s4), $d1,    $s4;
    [[ extension "IMAGE"; ]] stimage_v4_1db_f32_roimg_u32    ($s1, $s2, $s3, $s4), $d1,    $s4;
    [[ extension "IMAGE"; ]] stimage_v4_2d_u32_roimg_u32     ($s1, $s2, $s3, $s4), $d1,    ($s4, $s5);
    [[ extension "IMAGE"; ]] stimage_v4_1da_u32_roimg_u32    ($s1, $s2, $s3, $s4), $d1,    ($s4, $s5);
    [[ extension "IMAGE"; ]] stimage_v4_3d_f32_roimg_u32     ($s1, $s2, $s3, $s4), $d1,    ($s4, $s5, $s6);
    [[ extension "IMAGE"; ]] stimage_v4_2da_s32_roimg_u32    ($s1, $s2, $s3, $s4), $d1,    ($s4, $s5, $s6);

/////////////////////////////////////////////////////////////////////////////////////////////////////////
// ldimage.roimg: woimg is not supported

    [[ extension "IMAGE"; ]] ldimage_v4_1d_u32_woimg_u32     ($s1, $s2, $s3, $s4), $d2,    $s4;
    [[ extension "IMAGE"; ]] ldimage_v4_1db_u32_woimg_u32    ($s1, $s2, $s3, $s4), $d2,    $s4;
    [[ extension "IMAGE"; ]] ldimage_v4_2d_s32_woimg_u32     ($s1, $s2, $s3, $s4), $d1,    ($s4, $s5);
    [[ extension "IMAGE"; ]] ldimage_v4_1da_s32_woimg_u32    ($s1, $s2, $s3, $s4), $d1,    ($s4, $s5);
    [[ extension "IMAGE"; ]] ldimage_v4_3d_f32_woimg_u32     ($s1, $s2, $s3, $s4), $d1,    ($s4, $s5, $s6);
    [[ extension "IMAGE"; ]] ldimage_v4_2da_f32_woimg_u32    ($s1, $s2, $s3, $s4), $d2,    ($s4, $s1, $s2);

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
///// querysamplerboundary.type
///
///    [[ extension "IMAGE"; ]] querysamplerboundary_b32_samp    $s0, $d3, 1;
///
///// querysamplerboundary.stype
///
///    [[ extension "IMAGE"; ]] querysamplerboundary_u32_rwimg   $s0, $d3, 1;
///    [[ extension "IMAGE"; ]] querysamplerboundary_u32_b64     $s0, $d3, 1;
///
///// querysamplerboundary.arg
///
///    [[ extension "IMAGE"; ]] querysamplerboundary_u32_samp    $d0, $d3, 1;
///    [[ extension "IMAGE"; ]] querysamplerboundary_u32_samp    $s0, $s3, 1;
///    [[ extension "IMAGE"; ]] querysamplerboundary_u32_samp    $s0, $d3, 1.0f;


/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// initfbar

fbarrier %fb; initfbar_fbar %fb;
fbarrier %fb; initfbar_u32 %fb;
fbarrier %fb; initfbar_u32 %fb;

fbarrier %fb; initfbar_fnone %fb;
fbarrier %fb; initfbar_fgroup %fb;
fbarrier %fb; initfbar_fglobal %fb;
fbarrier %fb; initfbar_fboth %fb;
fbarrier %fb; initfbar_fpartial %fb;
fbarrier %fb; initfbar_fpartialboth %fb;

fbarrier %fb; initfbar_width(1) %fb;
fbarrier %fb; initfbar_width(all) %fb;

fbarrier %fb; initfbar $d0;

fbarrier %fb; initfbar 0;

// initfbar.type

initfbar_b32            $s0;

// initfbar.memord

initfbar_scacq            $s0;
initfbar_screl            $s0;
initfbar_scar             $s0;
initfbar_sc             $s0;

// initfbar.memscp

initfbar_wg            $s0;
initfbar_agent           $s0;

// initfbar.memfnc

initfbar_fboth         $s0;
initfbar_fgroup        $s0;
initfbar_fnone         $s0;

// initfbar.width

initfbar_width(2)      $s0;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// releasefbar

fbarrier %fb; releasefbar_fbar %fb;
fbarrier %fb; releasefbar_u32 %fb;
fbarrier %fb; releasefbar_u32 %fb;
fbarrier %fb; releasefbar_fnone %fb;
fbarrier %fb; releasefbar_fgroup %fb;
fbarrier %fb; releasefbar_fglobal %fb;
fbarrier %fb; releasefbar_fboth %fb;
fbarrier %fb; releasefbar_fpartial %fb;
fbarrier %fb; releasefbar_fpartialboth %fb;
fbarrier %fb; releasefbar_width(1) %fb;
fbarrier %fb; releasefbar_width(all) %fb;
fbarrier %fb; releasefbar $d0;

fbarrier %fb; releasefbar 0;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// joinfbar

fbarrier %fb; joinfbar_fbar %fb;
fbarrier %fb; joinfbar_u32 %fb;
fbarrier %fb; joinfbar_u32 %fb;
fbarrier %fb; joinfbar_fnone %fb;
fbarrier %fb; joinfbar_fgroup %fb;
fbarrier %fb; joinfbar_fglobal %fb;
fbarrier %fb; joinfbar_fboth %fb;
fbarrier %fb; joinfbar_fpartial %fb;
fbarrier %fb; joinfbar_fpartialboth %fb;
fbarrier %fb; joinfbar $d0;
fbarrier %fb; joinfbar 0;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// leavefbar

fbarrier %fb; leavefbar_fbar %fb;
fbarrier %fb; leavefbar_u32 %fb;
fbarrier %fb; leavefbar_u32 %fb;
fbarrier %fb; leavefbar_fnone %fb;
fbarrier %fb; leavefbar_fgroup %fb;
fbarrier %fb; leavefbar_fglobal %fb;
fbarrier %fb; leavefbar_fboth %fb;
fbarrier %fb; leavefbar_fpartial %fb;
fbarrier %fb; leavefbar_fpartialboth %fb;
fbarrier %fb; leavefbar $d0;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// waitfbar

fbarrier %fb; waitfbar_fbar %fb;
fbarrier %fb; waitfbar_u32 %fb;
fbarrier %fb; waitfbar_u32 %fb;
fbarrier %fb; waitfbar $d0;

// waitfbar.type

waitfbar_b32        $s0;

// waitfbar.memord

waitfbar_scacq        $s0;
waitfbar_screl        $s0;
waitfbar_scar         $s0;
waitfbar_sc         $s0;

// waitfbar.old.syntax

waitfbar_fgroup          %fb;
waitfbar_fglobal         %fb;
waitfbar_fboth           %fb;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// arrivefbar

fbarrier %fb; arrivefbar_fbar %fb;
fbarrier %fb; arrivefbar_u32 %fb;
fbarrier %fb; arrivefbar_u32 %fb;
fbarrier %fb; arrivefbar $d0;

// arrivefbar.old.syntax

arrivefbar_fgroup          %fb;
arrivefbar_fglobal         %fb;
arrivefbar_fboth           %fb;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// barrier.memord

barrier_scacq;
barrier_screl;
barrier_scar;
barrier_sc;

// barrier.type

barrier_b32;

// barrier.fence

barrier_fgroup;
barrier_global;

// barrier.memscp

barrier_wg;
barrier_width(64)_wg;
barrier_wg_group;
barrier_wg_fglobal;

barrier_agent;
barrier_width(64)_agent;
barrier_agent_group;
barrier_agent_global;

barrier_width(64)_agent_group;
barrier_width(64)_agent_fgroup;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// wavebarrier

wavebarrier_b32;
wavebarrier $s0;
wavebarrier_width(1);
wavebarrier_width(2);
wavebarrier_width(all);
wavebarrier_width(WAVESIZE);

[[ extension "IMAGE"; ]]  wavebarrier_samp;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// memfence.old.syntax

memfence_fnone;
memfence_fgroup;
memfence_scacq_fglobal;
memfence_scacq_wg_fnone;

// memfence.98.syntax

memfence_scacq_global(sys);
memfence_scacq_global(cmp);
memfence_scacq_global(wg);
memfence_scacq_global(wv);
memfence_screl_group(wg);
memfence_screl_group(wv);
memfence_screl_global(cmp)_group(wg);
memfence_scar_global(wg)_group(wg);
memfence_screl_global(sys)_group(wv);
memfence_scar_global(wv)_group(wv);

// memfence.new.syntax

memfence_screl_group;
memfence_screl_image;
memfence_screl_global;
memfence_scacq;
memfence_system;
memfence_scacq_system

// memfence.type

memfence_b32;
memfence_scacq_system_s32;

// memfence.width

memfence_width(4);
memfence_width(4)_scacq_system;
memfence_scacq_width(4)_system;

// memfence.memord

memfence_rlx_system;
memfence_rlx_agent;
memfence_rlx_wg;
memfence_rlx_wave;
memfence_none_system;
memfence_none_agent;
memfence_none_wg;
memfence_none_wave;

// memfence.memscp

memfence_scacq_wi;
memfence_screl_wi;
memfence_scar_wi;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// nullptr

    nullptr_group_u32       $d0;

    nullptr_u64             $s0; 
    nullptr_u32             $d0; 
    nullptr_u32             $s0; 

    nullptr_global_u32      $d0; 
    nullptr_global_u32      $s0; 
    nullptr_global_u64      $c0; 

    nullptr_global_u64_u32  $d0; 
    nullptr_global_u64_none $d0; 

    nullptr_flat_u64        $d0; 

    nullptr_arg_u32         $s0; 
    nullptr_spill_u32       $s0; 

!small

    nullptr_group_u32       $d0;    

    nullptr_u64             $s0; 
    nullptr_u32             $d0; 
    nullptr_u64             $d0; 

    nullptr_global_u64      $d0; 
    nullptr_global_u64      $s0; 
    nullptr_global_u32      $d0; 

// nullptr.disabled

!large
    nullptr_global_u64          $d1;    

!small
    nullptr_global_u32          $s1;    

!base
    nullptr_global_u64          $d1;    

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// alloca.nested.scope

[[ function &f()() { { alloca_u32          $s1, $s0; } }; ]]

// alloca.type

alloca_u64          $s1, $s0;
alloca_s32          $s1, $s0;

// alloca.segment

alloca_global_u32          $s1, $s0;
alloca_private_u32            $s1, $s0;

// alloca.equiv

alloca_equiv(0)_u32         $s1, $s0;
alloca_equiv(1)_u32         $s1, $s0;
alloca_equiv(10)_u32        $s1, $s0;

// alloca.align

alloca_align(0)_u32         $s1, $s0;
alloca_align(-1)_u32        $s1, $s0;
alloca_align(512)_u32       $s1, $s0;

// alloca.const

alloca_const_u32            $s1, $s0;

// alloca.width

alloca_width(1)_u32            $s1, $s0;
alloca_width(2)_u32            $s1, $s0;
alloca_width(0)_u32            $s1, $s0;
alloca_width(WAVESIZE)_u32     $s1, $s0;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// addqueuewriteindex.segment

                            addqueuewriteindex_group_rlx_u64 	$d1, [0],  $d0;
    [[ global_u32 &x; ]]    addqueuewriteindex_rlx_u64 	        $d1, [&x],  $d0;

// addqueuewriteindex.missing.memord

    addqueuewriteindex_global_u64 	$d1, [$d2], 0;

// addqueuewriteindex.type

    addqueuewriteindex_global_screl 	$d1, [0],   0xFFFFFFFFFFFFFFFF;
    addqueuewriteindex_scar_s64 		$d1, [$d2], WAVESIZE;
    addqueuewriteindex_scar_s32 		$d1, [$d2], WAVESIZE;

// addqueuewriteindex.args

    [[ global_u32 &x; ]]    addqueuewriteindex_global_rlx_u64 	$s1, [&x],  $d0;
    [[ global_u32 &x; ]]    addqueuewriteindex_global_rlx_u64 	[&x], [&x], $d0;
    [[ global_u32 &x; ]]    addqueuewriteindex_global_rlx_u64 	$d1, [&x],  $s0;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// casqueuewriteindex.segment
                                                    
                            casqueuewriteindex_private_rlx_u64 	$d1, [0],  $d3, $d4;
    [[ global_u32 &x; ]]    casqueuewriteindex_rlx_u64 	$d1, [&x],  $d3, $d4;

// casqueuewriteindex.missing.memord

    casqueuewriteindex_global_u64 	$d1, [$d2], 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF;

// casqueuewriteindex.type

    casqueuewriteindex_global_screl 	    $d1, [0],   WAVESIZE, $d4;
    casqueuewriteindex_global_screl_s64 	$d1, [0],   WAVESIZE, $d4;
    casqueuewriteindex_global_screl_u32 	$d1, [0],   WAVESIZE, $d4;

// casqueuewriteindex.args

    casqueuewriteindex_scar_u64 	        $s1, [$d2], $d3, WAVESIZE;
    casqueuewriteindex_scar_u64 	        $d1, [$d2], $s3, WAVESIZE;
    casqueuewriteindex_scar_u64 	        $d1, [$d2], $d3, $s3;
    casqueuewriteindex_scar_u64 	        [$d2], [$d2], $d3, WAVESIZE;
    casqueuewriteindex_scar_u64 	        WAVESIZE, $d1, [$d2], $d3;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// ldqueuereadindex.segment

                            ldqueuereadindex_group_scacq_u64 	$d5, [0];
    [[ global_u32 &x; ]]    ldqueuereadindex_scacq_u64 	    $d5, [&x];

// ldqueuereadindex.memord

                            ldqueuereadindex_global_u64 $d5, [0];
    [[ global_u32 &x; ]]    ldqueuereadindex_global_scar_u64 	$d5, [&x];
    [[ global_u32 &x; ]]    ldqueuereadindex_global_screl_u64 	$d5, [&x];

// ldqueuereadindex.type

    [[ global_u32 &x; ]]    ldqueuereadindex_global_scacq_s64 	$d5, [&x];
    [[ global_u32 &x; ]]    ldqueuereadindex_global_scacq_b64 	$d5, [&x];
                            ldqueuereadindex_scacq_u32 		$d5, [$d2];

// ldqueuereadindex.args

    [[ global_u32 &x; ]]    ldqueuereadindex_global_scacq_u64 	$s5, [&x];
    [[ global_u32 &x; ]]    ldqueuereadindex_global_scacq_u64 	[&x],[&x];
                            ldqueuereadindex_global_scacq_u64 	$d5, $d5;
                            ldqueuereadindex_global_scacq_u64 	$d5, 0;
                            ldqueuereadindex_global_scacq_u64 	$d5;
                            ldqueuereadindex_global_scacq_u64 	;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// ldqueuewriteindex.segment

                            ldqueuewriteindex_kernarg_rlx_u64 	$d3, [0];
    [[ global_u32 &x; ]]    ldqueuewriteindex_scacq_u64 	        $d3, [&x];

// ldqueuewriteindex.memord

    [[ global_u32 &x; ]]    ldqueuewriteindex_global_u64 	$d3, [&x];
                            ldqueuewriteindex_global_scar_u64 	$d3, [0];
                            ldqueuewriteindex_screl_u64 		$d3, [$d2];

// ldqueuewriteindex.type

    [[ global_u32 &x; ]]    ldqueuewriteindex_global_rlx_b64 	$d3, [&x];
                            ldqueuewriteindex_global_scacq_f64 	$d3, [0];
                            ldqueuewriteindex_rlx_u32 		$d3, [$d2];

// ldqueuewriteindex.args

    [[ global_u32 &x; ]]    ldqueuewriteindex_global_rlx_u64 	$s3, [&x];
                            ldqueuewriteindex_global_scacq_u64 	$d3, $d3;
                            ldqueuewriteindex_rlx_u64 		    $d3, 0;
    [[ global_u32 &x; ]]    ldqueuewriteindex_global_rlx_u64 	[&x];
                            ldqueuewriteindex_global_scacq_u64 	$d3;
                            ldqueuewriteindex_rlx_u64 		    ;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// stqueuewriteindex.segment

                            stqueuewriteindex_group_rlx_u64 	[0], $d4;
                            stqueuewriteindex_private_screl_u64 	[0], 0;
    [[ global_u32 &x; ]]    stqueuewriteindex_screl_u64 	        [&x], WAVESIZE;

// stqueuewriteindex.memord

    [[ global_u32 &x; ]]    stqueuewriteindex_global_scar_u64 	[&x], $d4;
                            stqueuewriteindex_global_scacq_u64 	[0], 0;
                            stqueuewriteindex_u64 	            [$d2], WAVESIZE;

// stqueuewriteindex.type

    [[ global_u32 &x; ]]    stqueuewriteindex_global_rlx_s64 	[&x], $d4;
                            stqueuewriteindex_global_screl_b64 	[0], 0;
                            stqueuewriteindex_screl_u32 	        [$s2], WAVESIZE;

// stqueuewriteindex.args

    [[ global_u32 &x; ]]    stqueuewriteindex_global_rlx_u64 	$d4, [&x];
                            stqueuewriteindex_global_screl_u64 	0, 0;
                            stqueuewriteindex_screl_u64 	        [$s2], WAVESIZE;
    [[ global_u32 &x; ]]    stqueuewriteindex_global_rlx_u64 	[&x], $s4;
                            stqueuewriteindex_global_screl_u64 	[0], 0.0;
                            stqueuewriteindex_screl_u64 	        [$d2];
                            stqueuewriteindex_screl_u64 	        WAVESIZE;
                            stqueuewriteindex_screl_u64 	        ;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// stqueuereadindex.segment

                            stqueuereadindex_group_rlx_u64 	[0], $d4;
                            stqueuereadindex_private_screl_u64 	[0], 0;
    [[ global_u32 &x; ]]    stqueuereadindex_screl_u64 	        [&x], WAVESIZE;

// stqueuereadindex.memord

    [[ global_u32 &x; ]]    stqueuereadindex_global_scar_u64 	[&x], $d4;
                            stqueuereadindex_global_scacq_u64 	[0], 0;
                            stqueuereadindex_u64 	            [$d2], WAVESIZE;

// stqueuereadindex.type

    [[ global_u32 &x; ]]    stqueuereadindex_global_rlx_s64 	[&x], $d4;
                            stqueuereadindex_global_screl_b64 	[0], 0;
                            stqueuereadindex_screl_u32 	        [$s2], WAVESIZE;

// stqueuereadindex.args

    [[ global_u32 &x; ]]    stqueuereadindex_global_rlx_u64 	$d4, [&x];
                            stqueuereadindex_global_screl_u64 	0, 0;
                            stqueuereadindex_screl_u64 	        [$s2], WAVESIZE;
    [[ global_u32 &x; ]]    stqueuereadindex_global_rlx_u64 	[&x], $s4;
                            stqueuereadindex_global_screl_u64 	[0], 0.0;
                            stqueuereadindex_screl_u64 	        [$d2];
                            stqueuereadindex_screl_u64 	        WAVESIZE;
                            stqueuereadindex_screl_u64 	        ;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// currentworkgroupsize

    currentworkgroupsize_u64    $s1, 0; 
    currentworkgroupsize_u32    $d1, 0; 
    currentworkgroupsize_u32    $s1, $s0; 

    currentworkgroupsize_u32    $s1, -1; 
    currentworkgroupsize_u32    $s1, 3; 
    currentworkgroupsize_u32    $s1, 1.0; 
    currentworkgroupsize_u32    $s1, 1.0f; 

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// unpackcvt

    unpackcvt_f32_u8x4  $s5, $s0, -1;
    unpackcvt_f32_u8x4  $s5, $s0, 4;
    unpackcvt_f32_u8x4  $s5, $s0, 5;
    unpackcvt_f32_u8x4  $s5, $s0, 0xFFFFFFFF;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// sadhi.type

    sadhi_u32_u8x4    $s5, $s0, $s1, $s6;
    sadhi_b32_u8x4    $s5, $s0, $s1, $s6;
    sadhi_u16x2_u32   $s5, $s0, $s1, $s6;
    sadhi_u16x2_b32   $s5, $s0, $s1, $s6;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// activelanemask

    activelanemask_v4_b32_b1                 ($d1, $d2, $d3, $d4), $c0;
    activelanemask_v4_u64_u32                ($d1, $d2, $d3, $d4), $s0;
    activelanemask_v4_f64_u32                ($d1, $d2, $d3, $d4), 1;

    activelanemask_v4_b64_b1                 ($s1, $s2, $s3, $s4), $c0;
    activelanemask_v4_b64_u32                ($d1, $d2, $d3, $d4), $d0;
    activelanemask_v4_b64_b1                 ($d1, $d2, $d3, $d4), 1.0f;

// activelanemask.stype.missing

    activelanemask_v4_b64                    ($d1, $d2, $d3, $d4), $c0;
    activelanemask_v4_b64                    ($d1, $d2, $d3, $d4), 1.0f;

// activelanemask.stype

    activelanemask_v4_b64_b8                 ($d1, $d2, $d3, $d4), $c0;
    activelanemask_v4_b64_b32                ($d1, $d2, $d3, $d4), $s0;
    activelanemask_v4_b64_f32                ($d1, $d2, $d3, $d4), $s0;

// activelanemask.arg

    activelanemask_v4_b64_b1                 ($d1, $d2, $d3, $d4), $s0;
    activelanemask_v4_b64_u32                ($d1, $d2, $d3, $d4), $c0;
    activelanemask_v4_b64_b1                 ($c1, $c2, $c3, $c4), $c0;
    activelanemask_v4_b64_b1                 $d1,                  $c0;
    activelanemask_v4_b64_b1                 ($d0, $d1, $d2     ), $c0;

// activelanemask.v4

    activelanemask_b64_b1                    ($d0, $d1, $d2, $d3), $c0;
    activelanemask_b64_b1                    $d0,                  $c0;
    activelanemask_v2_b64_b1                 ($d0, $d1, $d2, $d3), $c0;
    activelanemask_v2_b64_b1                 ($d0, $d1          ), $c0;
    activelanemask_v3_b64_b1                 ($d0, $d1, $d2, $d3), $c0;
    activelanemask_v3_b64_b1                 ($d0, $d1, $d2     ), $c0;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// activelanecount

    activelanecount_b32_b1                 $d1, $c0;
    activelanecount_u64_u32                $d1, $s0;
    activelanecount_f64_u32                $d1, 1;

    activelanecount_u32_b1                 $d1, $c0;
    activelanecount_u32_u32                $s1, $d0;
    activelanecount_u32_b1                 $s1, 1.0f;

// activelanecount.stype.missing

    activelanecount_u32                    $d1, $c0;
    activelanecount_u32                    $d1, 1.0f;

// activelanecount.stype

    activelanecount_u32_b8                 $s1, $c0;
    activelanecount_u32_b32                $s1, $s0;
    activelanecount_u32_f32                $s1, $s0;

// activelanecount.arg

    activelanecount_u32_b1                 $s1, $s0;
    activelanecount_u32_u32                $s1, $c0;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// activelaneid.stype

    activelaneid_u32_b1                  $s1;
    activelaneid_width(WAVESIZE)_u32_u32 $s1;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// activelanepermute.src.type

    activelanepermute_b32_b1                   $s1, $s2, 0, $s3, 1;

// activelanepermute.width

    activelanepermute_width                    $c1,   0,  -1,   0,   2;
    activelanepermute_width_b1                 $c1,   0,  -1,   0,   2;
    activelanepermute_width()_b1               $c1,   0,  -1,   0,   2;
    activelanepermute_width(0)_b1              $c1,   0,  -1,   0,   2;

// activelanepermute.arg.num

    activelanepermute_b1                    $c1,   0,  -1,   0;
    activelanepermute_b1                    $c1,   0,  -1;
    activelanepermute_b1                    $c1,   0;
    activelanepermute_b1                    $c1;
    activelanepermute_b1                    ;

// activelanepermute.arg.type

    activelanepermute_b1                    $c1,   0,  -1,   0,   u16x2(0,0);
    activelanepermute_b32                   $s1, $s2, u32x2(0,0), $s3, 1;
    activelanepermute_b32                   $s1, 222, 1.0, 444,  0;
    activelanepermute_b32                   $s1, $s2, 0, $d3, 1;
    activelanepermute_b32                   $s1, $c2, 0, $s3, 1;
    activelanepermute_b32                   $q1, $s2, 0, $s3, 1;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// packetcompletionsig.type

    packetcompletionsig_s64     $d6;
    packetcompletionsig_sig32   $s6;
    packetcompletionsig_sig64   $s6;

[[ extension "IMAGE"; ]]     packetcompletionsig_samp    $d6;

!small

    packetcompletionsig_sig64   $d6;
    packetcompletionsig_sig32   $s6;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// cleardetectexcept

    cleardetectexcept           1;
    cleardetectexcept_u32        ;
    cleardetectexcept_s32       1;
    cleardetectexcept_u32       $s0;
    cleardetectexcept_u32       WAVESIZE;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// setdetectexcept

    setdetectexcept           1;
    setdetectexcept_u32        ;
    setdetectexcept_s32       1;
    setdetectexcept_u32       $s0;
    setdetectexcept_u32       WAVESIZE;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// BRANCHES - GENERIC

// cbr.generic

    cbr_b64         $c0, @lab;             @lab: ret;
    cbr_ftz         $c0, @lab;             @lab: ret;
    cbr_near        $c0, @lab;             @lab: ret;
    cbr_width(0)    $c0, @lab;             @lab: ret;
                                         
    cbr_b1          $s0, @lab;             @lab: ret;
    cbr_b1          $d0, @lab;             @lab: ret;
    cbr_b1          $q0, @lab;             @lab: ret;

    cbr_b1          $c0, 0;
    cbr_b1          $c0, $s0;              
    cbr_b1          @lab, @lab;            @lab: ret;
    cbr_b1          $c0, @lab, @lab;       @lab: ret;

    cbr_b1          $c0, [0];

    cbr_b1;
    cbr             $c0, @lab;             @lab: ret;

// br.generic

    br;
    br_width(0);
    br_width(1);
    br_width(all);

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// BRANCHES - SBR

// sbr.syntax

sbr_width(all)_u32      $s1;
sbr_width(all)_u32      $s1 [];
sbr_width(all)_u32      $s1 {};
sbr_width(all)_u32      $s1 {1};
sbr_width(all)_u32      $s1 [1];
sbr_width(all)_u32      $s1 @lab;
sbr_width(all)_u32      $s1 @lab;              @lab: ret;
sbr_width(all)_u32      $s1 [@
sbr_width(all)_u32      $s1 [@lab, 1];         @lab: ret;
sbr_width(all)_u32      $s1 [@lab,];           @lab: ret;
sbr_width(all)_u32      $s1 [,@lab];           @lab: ret;
sbr_width(all)_u32      $s1, [@lab];           @lab: ret;

// sbr.type

sbr_width(all)_s32      $s1 [@lab];              @lab: ret;
sbr_width(1)_b32        $s1 [@lab];              @lab: ret;
sbr_width(2)_u16        $s1 [@lab];              @lab: ret;

// sbr.reg

sbr_width(all)_u32      $d1 [@lab];              @lab: ret;
sbr_width(all)_u64      $s1 [@lab];              @lab: ret;

// sbr.labels

[[ function &f()() {  sbr_width(all)_u32 $s1 [@lab];                                                               }; ]]
[[ function &f()() {  sbr_width(all)_u32 $s1 [@lab];                             {  call &f()(); @lab: nop; }      }; ]]
[[ function &f()() {  {  call &f()(); @lab: add_s32 $s0, 1, 1; }                 sbr_width(all)_u32 $s1 [@lab];    }; ]]
[[ function &f()() {  {  call &f()(); sbr_width(all)_u32 $s1 [@lab];   }         {  call &f()(); @lab: nop; }      }; ]]
[[ function &f()() {  {  call &f()(); sbr_width(all)_u32 $s1 [@lab];   }                         @lab: nop;        }; ]]

    
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// LABELS

// label.scope: labels have function scope

@x: { @x: }           ret;
    { @x: } @x:       ret;
    { @x: } { @x: }   ret;

// label.undef

cbr_width(2)_b1    $c0, @label;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// FBARRIERS

// fbarrier

initfbar %fb;                       // undefined fbarrier
initfbar %fb; fbarrier %fb;         // used before definition

fbarrier %fb; fbarrier %fb;         // redefinition
{fbarrier %fb;} fbarrier %fb;       // redefinition
fbarrier %fb; {fbarrier %fb;}       // redefinition
global_u32 %fb; fbarrier %fb;       // name redefinition
global_u32 %fb; fbarrier %fb;       // name redefinition

[[ fbarrier &x;         fbarrier &x;         ]]   // redefinition
[[ global_u32 &x;       fbarrier &x;         ]]   // name redefinition
[[ decl function &x()();fbarrier &x;         ]]   // name redefinition
[[ function &x()(){};   fbarrier &x;         ]]   // name redefinition
[[ kernel &x(){};       fbarrier &x;         ]]   // name redefinition
[[ fbarrier &x;         global_u32 &x;       ]]   // name redefinition
[[ fbarrier &x;         decl function &x()();]]   // name redefinition
[[ fbarrier &x;         function &x()(){};   ]]   // name redefinition
[[ fbarrier &x;         kernel &x(){};       ]]   // name redefinition

[[ function &f()(arg_s32 %x) { fbarrier %x; }; ]] // name redefinition 

[[ function &fn1()() { fbarrier %fb; ret; }; ]] initfbar %fb;

fbarrier %;                         // invalid name
fbarrier a;                         // invalid name
fbarrier 0;                         // invalid name
fbarrier &fb;                       // invalid prefix
fbarrier @fb;                       // invalid prefix
fbarrier $fb;                       // invalid prefix
fbarrier ;                          // name is missing

// fbarrier.undef

[[ decl fbarrier &fb1; ]] ldf_u32 $s0, &fb1;  // used but not defined
[[ decl fbarrier &fb1; pragma &fb1; ]]        // used but not defined

// fbarrier.compatibility

[[ decl fbarrier &fb1; decl prog fbarrier &fb1; ]]
[[ decl prog fbarrier &fb1; decl fbarrier &fb1; ]]

// fbarrier.qualifiers

[[ indirect fbarrier &fb1;     ]]
[[ alloc(agent) fbarrier &fb1; ]]
[[ align(8) fbarrier &fb1;     ]]
[[ const fbarrier &fb1;        ]]
[[ prog decl fbarrier &fb1;    ]]



/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// CALLS

// call.syntax

    [[ function &fn()() {}; ]]  { call             0 ()(); }
    [[ function &fn()() {}; ]]  { call             ()(); }
    [[ function &fn()() {}; ]]  { call             (); }
    [[ function &fn()() {}; ]]  { call             (; }
    [[ function &fn()() {}; ]]  { call             ; }
    [[ function &fn()() {}; ]]  { call             0; }
    [[ function &fn()() {}; ]]  { call             [0]; }
    [[ function &fn()() {}; ]]  { @lbl: call       @lbl()(); }
    [[ function &fn()() {}; ]]  { call             &fn ;     } // missing call arg list
    [[ function &fn()() {}; ]]  { call             &fn (; }
    [[ function &fn()() {}; ]]  { call             &fn 0; }
    [[ function &fn()() {}; ]]  { call             &fn [0]; }

// call.modifiers

    [[ function &fn()() {}; ]]  { call_b64         &fn ()(); }
    [[ function &fn()() {}; ]]  { call_ftz         &fn ()(); }
    [[ function &fn()() {}; ]]  { call_near        &fn ()(); }
    [[ function &fn()() {}; ]]  { call_neari       &fn ()(); }
    [[ function &fn()() {}; ]]  { call_width(0)    &fn ()(); }
    [[ function &fn()() {}; ]]  { call_width(all)  &fn ()(); }

// call.target

    [[ function &fn()() {}; ]]  { call             $c0 ()(); }
    [[ function &fn()() {}; ]]  { call             $s0 ()(); }
    [[ function &fn()() {}; ]]  { call             $d0 ()(); }
    [[ function &fn()() {}; ]]  { call             $q0 ()(); }

// call.width

    [[ function &fn()() {}; ]]  { call_width(0)    &fn ()(); }
    [[ function &fn()() {}; ]]  { call_width(1)    &fn ()(); }
    [[ function &fn()() {}; ]]  { call_width(all)  &fn ()(); }

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// ARG PASSING RULES

// func.arg.scope: All args passed into a function must be allocated in the arg scope

[[ function &f()(arg_s8 %x) { { call &f ()(%x); } }; // error: illegal to pass '%x' as it is defined outside of current arg scope ]]


// kernel.arg.scope: All args passed into a function must be allocated in the arg scope

[[ function &f()(arg_s8 %x){}; kernel &k(kernarg_s8 %x) { { call &f ()(%x); } }; // error: illegal to pass '%x' as it is defined outside of current arg scope ]]


// func.arg.in.out: It is not legal to use the same name as both an input and an output argument.

[[ function &f(arg_s32 %out)(arg_s32 %in){ { arg_s32  %x; call	&f (%x) (%x);	} }; ]]


// func.arg.in.in: each argument must be used exactly once

[[ function &f()(arg_s32 %arg1, arg_s32 %arg2){ { arg_s32  %x; call	&f () (%x, %x);	} }; ]]


// func.arg.unused: each argument must be used exactly once

[[ function &f()(arg_s32 %in){ { arg_s32  %x; arg_s32  %y; call	&f () (%x);	} }; ]]


// func.formal.arg.access: Output formal arguments cannot be accessed by any operation other than an st operation

[[ function &f(arg_s32 %out)(arg_s32 %in) { ld_arg_s32 $s0, [%out]; }; ]]
[[ function &f(arg_s32 %out)(arg_s32 %in) { st_arg_s32 $s0, [%in]; }; ]]


/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// FORMAL AND ACTUAL ARGS MISMATCH

// func.formal.actual.mismatch: actual call args must be compatible with formal arguments

[[ function &TestFunc()(arg_b32 %x) {};         ]] {                     call &TestFunc () ();    }            // expected 1 input argument
[[ function &TestFunc()(          ) {};         ]] { arg_s32 %x;         call &TestFunc () (%x);  }            // unexpected input arg
[[ function &TestFunc()(          ) {};         ]] { arg_s32 %x;         call &TestFunc (%x) ();  }            // unexpected output arg


[[ function &TestFunc(arg_s32 %x)() {};         ]] { arg_u32 %x;         call &TestFunc (%x) ();  }            // expected s32
[[ function &TestFunc()(arg_s32 %x) {};         ]] { arg_u32 %x;         call &TestFunc () (%x);  }            // expected s32

[[ function &TestFunc()(align(8) arg_u32 %x) {}; ]] { arg_u32 %x;         call &TestFunc () (%x);  }            // expected align 8
[[ function &TestFunc()(        arg_u32 %x) {}; ]] { align(8) arg_u32 %x; call &TestFunc () (%x);  }            // unexpected align 8

[[ function &TestFunc()(arg_u32 %x[]) {}; ]]       { arg_u32 %x;         call &TestFunc () (%x);  }            // expected array
[[ function &TestFunc()(arg_u32 %x)   {}; ]]       { arg_u32 %x[3];      call &TestFunc () (%x);  }            // unexpected array

[[ function &TestFunc()(arg_u32 %x[3]) {}; ]]      { arg_u32 %x[4];      call &TestFunc () (%x);  }            // expected array with 3 elements


/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// SWITCH CALL

// scall.compatibility: Call arguments must be compatible with targets

    [[ function &TestFunc()(arg_b32 %x) {};         ]] {                         scall_u64 $d1 () () [&TestFunc];       }            // expected 1 input argument
    [[ function &TestFunc()(          ) {};         ]] { arg_s32 %iarg0;         scall_u64 $d1 () (%iarg0) [&TestFunc]; }            // unexpected input arg
    [[ function &TestFunc()(          ) {};         ]] { arg_s32 %iarg0;         scall_u64 $d1 (%iarg0) () [&TestFunc]; }            // unexpected output arg

    [[ function &TestFunc(arg_s32 %x)() {};         ]] { arg_u32 %arg0;         scall_u64 $d1 (%arg0) () [&TestFunc];  }            // expected s32
    [[ function &TestFunc()(arg_s32 %x) {};         ]] { arg_u32 %arg0;         scall_u64 $d1 () (%arg0) [&TestFunc];  }            // expected s32

    [[ function &TestFunc()(align(8) arg_u32 %x) {}; ]] { arg_u32 %arg0;         scall_u64 $d1 () (%arg0) [&TestFunc];  }            // expected align 8
    [[ function &TestFunc()(        arg_u32 %x) {}; ]] { align(8) arg_u32 %arg0; scall_u64 $d1 () (%arg0) [&TestFunc];  }            // unexpected align 8

    [[ function &TestFunc()(arg_u32 %x[]) {}; ]]       { arg_u32 %arg0;         scall_u64 $d1 () (%arg0) [&TestFunc];  }            // expected array
    [[ function &TestFunc()(arg_u32 %x)   {}; ]]       { arg_u32 %arg0[3];      scall_u64 $d1 () (%arg0) [&TestFunc];  }            // unexpected array

    [[                                              \
       function &TestFunc1()()           { ret; };  \
       function &TestFunc2()(arg_b32 %x) { ret; };  \
       function &TestFunc3()()           { ret; };  \
    ]]                                              \
                                                    \
        { scall_u64 $d1 () () [&TestFunc1, &TestFunc2, &TestFunc3]; } // Error: &TestFunc2: expected 1 input argument
   
    [[                                                   \
        function &TestFunc1()(arg_s32 %iarg0){ ret; };   \
        function &TestFunc2()()              { ret; };   \
        function &TestFunc3()(arg_s32 %iarg0){ ret; };   \
    ]]                                                   \
        { arg_s32 %iarg0; scall_u64 $d1 () (%iarg0) [&TestFunc1, &TestFunc2, &TestFunc3]; } // Error: &TestFunc2: unexpected input argument
    
    [[                                                   \
        function &TestFunc1()(arg_s32 %iarg0){ ret; };   \
        function &TestFunc2()()              { ret; };   \
        function &TestFunc3()(arg_s32 %iarg0){ ret; };   \
    ]]                                                   \
        { arg_s32 %arg0; scall_u64 $d1 (%arg0) () [&TestFunc1, &TestFunc2, &TestFunc3]; } // Error: &TestFunc2: unexpected output argument
    
    [[                                                   \
        function &TestFunc1(arg_u32 %x)() { ret; };      \
        function &TestFunc2(arg_s32 %x)() { ret; };      \
        function &TestFunc3(arg_u32 %x)() { ret; };      \
    ]]                                                   \
        { arg_u32 %arg0; scall_u64 $d1 (%arg0) () [&TestFunc1, &TestFunc2, &TestFunc3]; } // Error: &TestFunc2: expected s32 type
    
    [[                                                       \
        function &TestFunc1()(         arg_u32 %x){ ret; };   \
        function &TestFunc2()(align(8) arg_u32 %x){ ret; };   \
        function &TestFunc3()(         arg_u32 %x){ ret; };   \
    ]]                                                       \
                                                             \
        { arg_u32 %arg0; scall_u64 $d1 () (%arg0) [&TestFunc1, &TestFunc2, &TestFunc3]; } // Error: &TestFunc2: expected align(8)
    
    [[                                                       \
        function &TestFunc1()(arg_u32 %x  ) { ret; };        \
        function &TestFunc2()(arg_u32 %x[]) { ret; };        \
        function &TestFunc3()(arg_u32 %x  ) { ret; };        \
    ]]                                                       \
        { arg_u32 %arg0; scall_u64 $d1 () (%arg0) [&TestFunc1, &TestFunc2, &TestFunc3]; } // Error: &TestFunc2: expected array
    
    [[                                                       \
        function &TestFunc1()(arg_u32 %x[1]) { ret; };       \
        function &TestFunc2()(arg_u32 %x[2]) { ret; };       \
    ]]                                                       \
        { arg_u32 %arg0[1]; scall_u64 $d1 () (%arg0) [&TestFunc1, &TestFunc2]; } // Error: &TestFunc2: expected array with 2 elements

// scall.invalid: Misc errors

[[                                                       \
    function &TestFunc1()(arg_u32 %x  ) { ret; };        \
    function &TestFunc3()(arg_u32 %x  ) { ret; };        \
]]                                                       \
    { arg_u32 %arg0; scall_u64 $d1 () (%arg0) [&TestFunc1, &TestFunc2, &TestFunc3]; } // Error: &TestFunc2 is not declared

[[                                                       \
    signature &TestSignature()(arg_u32 %x);              \
    function &TestFunc1()(arg_u32 %x  ) { ret; };        \
]]                                                       \
    { arg_u32 %arg0; scall_u64 $d1() (%arg0) &TestSignature; } // Error: switch call with signature

[[                                                       \
    signature &TestSignature0()(arg_u32 %x);             \
    function &TestFunc1()(arg_u32 %x  ) { ret; };        \
]]                                                       \
    { arg_u32 %arg0; scall_u64 $d1 () (%arg0) [&TestSignature0]; } // Error: unexpected targets

[[                                                       \
    signature &TestSignature0()(arg_u32 %x);             \
    function &TestFunc1()(arg_u32 %x  ) { ret; };        \
]]                                                       \
    { arg_u32 %arg0; scall_u64 $d1 () (%arg0) [&TestFunc1] &TestSignature0; } // Error: unexpected signature

[[                                                       \
    signature &TestSignature0()(arg_u32 %x);             \
    function &TestFunc1()(arg_u32 %x  ) { ret; };        \
]]                                                       \
    { arg_u32 %arg0; scall_u64 $d1 () (%arg0) [&TestFunc1,&TestSignature0]; } // Error: signature in the list of targets

[[                                                       \
    signature &TestSignature0()(arg_u32 %x);             \
    function &TestFunc1()(arg_u32 %x  ) { ret; };        \
]]                                                       \
    { arg_u32 %arg0; scall_u64 $d1 () (%arg0) [&TestSignature0, &TestFunc1]; } // Error: signature in the list of targets

[[                                                       \
    signature &TestSignature0()(arg_u32 %x);             \
    function &TestFunc1()(arg_u32 %x  ) { ret; };        \
]]                                                       \
    { arg_u32 %arg0; scall_u64 $d1 () (%arg0) [&TestSignature0]; } // Error: signature in the list of targets

[[                                                       \
    function &TestFunc1()(arg_u32 %x  ) { ret; };        \
]]                                                       \
    { arg_u32 %arg0; scall_u64 $d1 () (%arg0) [&TestFunc1, $s0]; } // Error: register in the list of targets

[[                                                       \
    function &TestFunc1()(arg_u32 %x  ) { ret; };        \
]]                                                       \
    { @lab: arg_u32 %arg0; scall_u64 $d1 () (%arg0) [&TestFunc1, @lab]; } // Error: label in the list of targets

[[                                                       \
    function &TestFunc1()(arg_u32 %x  ) { ret; };        \
]]                                                       \
    { arg_u32 %arg0; scall_u64 $d1 () (%arg0) [&TestFunc1, %arg0]; } // Error: variable in the list of targets

[[                                                       \
    global_u32   &global_var;                            \
    function &TestFunc1()(arg_u32 %x  ) { ret; };        \
]]                                                       \
    { arg_u32 %arg0; scall_u64 $d1 () (%arg0) [&TestFunc1, &global_var]; } // Error: variable in the list of targets

[[                                                       \
    function &TestFunc1()(arg_u32 %x  ) { ret; };        \
]]                                                       \
    { arg_u32 %arg0; scall_u64 $d1 () (%arg0) [&TestFunc1, 0]; } // Error: number in the list of targets

[[                                                       \
    function &TestFunc1()(arg_u32 %x  ) { ret; };        \
]]                                                       \
    { arg_u32 %arg0; scall_u64 $d1 () (%arg0) [&TestFunc1, ""]; } // Error: string in the list of targets

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// SIGNATURE

// signature.syntax

[[ signature x()();                    ]]
[[ signature ()();                     ]]
[[ signature )();                      ]]
[[ signature &x)();                    ]]
[[ signature &x()(){};                 ]]
[[ signature &x()(arg_b1 %a);          ]]
[[ signature &x()(arg_b32 &a);          ]]
[[ signature &x()(arg_b32 a);           ]]
[[ signature &x()(arg_b32 @a);          ]]

[[ signature &x(arg_b32 %x[-1])();     ]]
[[ signature &x(arg_b32[0])();         ]]
[[ signature &x(arg_b32 &x[4])();      ]]
[[ signature &x(arg_b32 %x[""])();     ]]

// signature.misc

[[ signature &x()(kernarg_u32);        ]]
[[ signature &x()(private_u32);        ]]
[[ signature &x()(spill_u32);          ]]
[[ signature &x()(arg_b1);             ]]

// signature.arg.align

[[ signature &x(align(2) arg_b32)(); ]]
[[ signature &x(align(5) arg_b32)(); ]]

// signature.args.inout: signature must have 2 lists of args

[[ signature &x(arg_u32, arg_u32);  ]]
[[ signature &x();                  ]]
[[ signature &x;                    ]]

// signature.out.args: signature cannot have more than 1 output arg

[[ signature &x(arg_u32, arg_u32)(arg_u32); ]]

// signature.duplicate.args

[[ signature &x()(arg_b32 %a, arg_b32 %a); ]]

// signature.redefinition 

[[ signature &x()();               signature &x(arg_b32)();             ]]
[[ signature &x(arg_s32)();        signature &x(arg_b32)();             ]]
[[ signature &x()(arg_b32 %a);     signature &x()(arg_b32 %a[]);        ]]
[[ signature &x()(arg_b32 %a);     signature &x()(arg_b32[]);           ]]
[[ signature &x()(arg_b32[1]);     signature &x()(arg_b32[]);           ]]
[[ signature &x()(arg_b32[1]);     signature &x()(arg_b32[2]);          ]]
[[ signature &x(arg_b32)();        signature &x(align(8) arg_b32)();    ]]
[[ signature &x()();               signature &x()();                    ]]

// signature.call.args.mismatch

[[ signature &x()(arg_b32 %x);  ]]		    {                            icall_u64 $d1 () () &x;        }
[[ signature &x()();            ]]          { arg_s32 %iarg0;		     icall_u64 $d1 () (%iarg0) &x;  }
[[ signature &x()();            ]]          { arg_s32 %arg0;		     icall_u64 $d1 (%arg0) () &x;   }
[[ signature &x(arg_s32)();     ]]          { arg_u32 %arg0;             icall_u64 $d1 (%arg0) () &x;   }
[[ signature &x()(arg_s32);     ]]          { arg_u32 %arg0;             icall_u64 $d1 () (%arg0) &x;   }
[[ signature &x(arg_u32)(arg_s32); ]]       { arg_u32 %arg0;             icall_u64 $d1 () (%arg0) &x;   }
[[ signature &x()(arg_u32 %x[2]);   ]]      { arg_u32 %arg0[3];          icall_u64 $d1 () (%arg0) &x;   } // array
[[ signature &x()(arg_u32 %x[2]);   ]]      { arg_u32 %arg0;             icall_u64 $d1 () (%arg0) &x;   } // array
[[ signature &x()(arg_u32 %x[]);    ]]      { arg_u32 %arg0;             icall_u64 $d1 () (%arg0) &x;   } // array
[[ signature &x()(arg_u32 %x);      ]]      { arg_u32 %arg0[1];          icall_u64 $d1 () (%arg0) &x;   } // array
[[ signature &x()(align(8) arg_u32 %x); ]]   { arg_u32 %arg0;            icall_u64 $d1 () (%arg0) &x;   } // align
[[ signature &x()(arg_u32 %x); ]]           { align(8) arg_u32 %arg0;    icall_u64 $d1 () (%arg0) &x;   } // align


// signature.flex

[[ signature &s(arg_s8 %x[])(); ]]
[[ signature &s()(arg_s8 %x[], arg_s8 %y); ]]


// signature.call.synax

[[ signature &x(arg_u32)();         ]]                            { arg_u32 %arg0;          icall_u64 $d1 (%arg0) () &x, &x;     }
[[ function &x1(arg_u32 %x)(){}; function &x2(arg_u32 %x)(){}; ]] {                         icall_u64 $d1 () ()      &x1, &x2;   }
[[ function &x(arg_u32 %x)() {};    ]]                            { arg_u32 %arg0;      	icall_u64 $d1 (%arg0) () &x;         }
[[ global_u32 &x;                   ]]                            { arg_u32 %arg0;          icall_u64 $d1 (%arg0) () &x;       }
                                                                  {	global_u32 %Var; arg_u32 %arg0; icall_u64 $d1 (%arg0) () %Var; }
                                                                  {	arg_u32 %arg0;          icall_u64 $d1 (%arg0) () $s0; }
                                                                  {	arg_u32 %arg0;          icall_u64 $d1 (%arg0) () 0; }
                                                                  {	arg_u32 %arg0;          icall_u64 $d1 (%arg0) () ""; }
                                                                  {	@lab: arg_u32 %arg0;    icall_u64 $d1 (%arg0) () @lab; }

// signature.qualifiers

[[ decl             signature &x()(); ]]
[[ prog             signature &x()(); ]]
[[ alloc(agent)     signature &x()(); ]]
[[ align(8)         signature &x()(); ]]
[[ const            signature &x()(); ]]

// icall.type

[[ signature &x()();  ]]		    {                            icall_u32 $s1 () () &x;        }

!small

[[ signature &x()();  ]]		    {                            icall_u64 $d1 () () &x;        }

// icall.base

!base

[[ signature &x()();  ]]		    {                            icall_u64 $d1 () () &x;        }

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////

// directive.extension: misc errors

[[ extension ;  ]]      // missing argument
[[ extension "; ]]      // missing argument
[[ extension 0; ]]      // expected string
[[ extension 1.0; ]]    // expected string

// extension.placement: 'extension' must be used before the first HSAIL declaration or definition

[[ global_u32 &a;                         extension "abc";         ]]
[[ decl global_u32 &a;                    extension "abc";         ]]
[[ function &f()(){};                     extension "abc";         ]]
[[ extension "xyz"; decl function &f()(); extension "abc";         ]]

[[ global_u32 &b;                         extension "xyz";   ]]
[[ decl global_u32 &b;                    extension "xyz";   ]]
[[ function &g()(){};                     extension "xyz";   ]]
[[ extension "xyz"; function &g()(){};    extension "xyz";   ]]
[[ extension "xyz"; global_u32 &b;        extension "xyz";   ]]

// extension.CORE: 'CORE' extension is incompatible with any other extensions

[[ extension "CORE"; extension "abc";                         ]]
[[ extension "CORE"; extension "CORE"; extension "abc";       ]]
[[ extension "abc";  extension "CORE";                        ]]
[[ extension "abc";  extension "abc";  extension "CORE";      ]]

[[ extension "CORE"; extension "xyz";                         ]]
[[ extension "CORE"; extension "CORE"; extension "xyz";       ]]
[[ extension "xyz";  extension "CORE";                        ]]
[[ extension "xyz";  extension "xyz";  extension "CORE";      ]]

// extension.toplevel: can be used at toplevel only

extension "abc";

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////

// loc.directive.missing.args: Missing "loc" arg

[[ loc; // error ]] 

// loc.directive.syntax: invalid "loc" syntax

[[ loc 1          // error ]]
[[ loc 1,2,"";    // error ]]
[[ loc 1,2 "";    // error ]]
[[ loc 1 2,"";    // error ]]

// loc.directive.too.many.args: Too many "loc" args

///F [[ loc 1 2 "" "";   // error ]]
///F [[ loc 1 "" "";     // error ]]

[[ loc 1 2 "" 3;    // error ]]
[[ loc 1 "" 3;      // error ]]
[[ loc 1 "" 0;      // error ]]
[[ loc 1 "" -1;     // error ]]
[[ loc 1 "" 1.0f;   // error ]]
[[ loc 1 "" @lab;   // error ]]
[[ loc 1 "" &x;     // error ]]
[[ loc 1 "" $s0;    // error ]]
[[ loc 1 "" %x;     // error ]]

// loc.directive.invalid.linenum: Invalid "loc" line number

[[ loc 0;    // error ]]
[[ loc -1;   // error ]]
[[ loc 1.0f; // error ]]
[[ loc "";   // error ]]
[[ loc @lab; // error ]]
[[ loc &x;   // error ]]
[[ loc $s0;  // error ]]
[[ loc %x;   // error ]]

// loc.directive.invalid.loccol: Invalid "loc" line column

[[ loc 1 0;        // error ]]
[[ loc 1 -1;       // error ]]
[[ loc 1 1.0f;     // error ]]
[[ loc 1 @lab;     // error ]]
[[ loc 1 &s0;      // error ]]
[[ loc 1 %s0;      // error ]]
[[ loc 1 $s0;      // error ]]

// loc.directive.invalid.filename: Invalid "loc" file name

[[ loc 1 1 ";        // error ]]
[[ loc 1 1 0;        // error ]]
[[ loc 1 1 1.0f;     // error ]]
[[ loc 1 1 @lab;     // error ]]
[[ loc 1 1 &s0;      // error ]]
[[ loc 1 1 %s0;      // error ]]
[[ loc 1 1 $s0;      // error ]]

// loc.directive.u64

[[ loc 0xFFFFFFFF00000001 1; ]]
[[ loc 1 0xFFFFFFFF00000001; ]]

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////

// pragma.directive.arg: invalid pragma - missing arg

[[ pragma p;   // error ]]
[[ pragma @l;  // error ]]
[[ pragma $s0; // error ]]
[[ pragma &x;  // error ]]
[[ pragma;     // error ]]
[[ pragma      // error ]]
[[ pragma "    // error ]]

// pragma.directive.lab.scope

[[ function &f()() { @lab: ret; }; pragma @lab; ]]
[[ pragma @lab; function &f()() { @lab: ret; }; ]]

[[ function &f1()() { @lab: ret; };   function &f2()() { pragma @lab; }; ]]
[[ function &f1()() { pragma @lab; }; function &f2()() { @lab: ret; };   ]]

// pragma.directive.global.scope

[[ pragma &f; function &f()() { @lab: ret; }; ]]
[[ pragma &f; decl function &f()(); ]]
[[ pragma &f; indirect function &f()() { @lab: ret; }; ]]
[[ pragma &f; decl indirect function &f()(); ]]
[[ pragma &k; kernel &k()() { @lab: ret; }; ]]
[[ pragma &k; decl kernel &k()(); ]]
[[ pragma &s; signature &s()(); ]]

[[ pragma &v; global_s32 &v; ]]
[[ pragma &v; decl global_s32 &v; ]]
[[ pragma &v; fbarrier &v; ]]
[[ pragma &v; decl fbarrier &v; ]]

// pragma.directive.local.scope

[[ function &f()() { pragma %v; global_s32 %v; }; ]]
[[ function &f()() { pragma %v; fbarrier %v; }; ]]

[[ function &f()(arg_s32 %x) { pragma %v; { arg_s32 %v; call &f()(%v); }            }; ]]
[[ function &f()(arg_s32 %x) {            { arg_s32 %v; call &f()(%v); } pragma %v; }; ]]

// pragma.reg.reference.at.toplevel

[[ pragma $c0; ]]
[[ pragma $s0; ]]
[[ pragma $d0; ]]
[[ pragma $q0; ]]

// pragma.to.module.reference

[[ pragma &ModuleName; $module$ ]]

// pragma.aggregate

[[ pragma {}; ]]
[[ pragma { align(16) }; ]]

// pragma.opaque

[[ pragma roimg[]( rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx) ); ]]

// pragma.array

[[ pragma u32[]( ); ]]
[[ pragma u64[]( WAVESIZE ); ]]

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// The control directives must appear in the code block of a kernel, function, or argument scope

// enablebreakexceptions.directive.order: enablebreakexceptions must appear before any other directives in code block

add_s32 $s1, $s2, $s3; enablebreakexceptions 7;
global_s32 %x; enablebreakexceptions 7;

// enablebreakexceptions.directive

[[ enablebreakexceptions 7; // must appear in a code block ]] 

enablebreakexceptions; 
enablebreakexceptions 1, 2; 
enablebreakexceptions @; 
enablebreakexceptions @lab; 
enablebreakexceptions $s0; 
enablebreakexceptions ""; 
enablebreakexceptions "; 
enablebreakexceptions #; 
enablebreakexceptions %x; 
enablebreakexceptions &x; 
enablebreakexceptions *; 
enablebreakexceptions [0]; 
enablebreakexceptions <>; 
enablebreakexceptions WAVESIZE; 

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// The control directives must appear in the code block of a kernel, function, or argument scope

// enabledetectexceptions.directive

[[ enabledetectexceptions 7; // must appear in a code block ]] 

enabledetectexceptions; 
enabledetectexceptions 1, 2; 
enabledetectexceptions @; 
enabledetectexceptions @lab; 
enabledetectexceptions $s0; 
enabledetectexceptions ""; 
enabledetectexceptions "; 
enabledetectexceptions #; 
enabledetectexceptions %x; 
enabledetectexceptions &x; 
enabledetectexceptions *; 
enabledetectexceptions [0]; 
enabledetectexceptions <>; 
enabledetectexceptions WAVESIZE; 

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// The control directives must appear in the code block of a kernel, function, or argument scope
/// Arg must be an immediate value >= 0.

// maxdynamicgroupsize.directive

[[ maxdynamicgroupsize 1; // must appear in a code block ]] 

maxdynamicgroupsize u16x2(0,0); // Arg must be an immediate value >= 0
maxdynamicgroupsize 0.0;         // Arg must be an immediate value >= 0
maxdynamicgroupsize ;            // Arg must be an immediate value >= 0
maxdynamicgroupsize 1, 2;        // Arg must be an immediate value >= 0
maxdynamicgroupsize "";          // Arg must be an immediate value >= 0
maxdynamicgroupsize WAVESIZE;    // Arg must be an immediate value >= 0

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// The control directives must appear in the code block of a kernel, function, or argument scope
/// Arg must be an immediate value greater than 0, or WAVESIZE.
/// If multiple control directives are present in the kernel or the functions it calls, they must all have the same values.
/// The value specified must be greater than or equal to the product of the values specified by requiredgridsize

// maxflatgridsize.directive

[[ maxflatgridsize 1; // must appear in a code block ]] 

    maxflatgridsize u16x2(0,0);                                 // Arg must be an immediate value greater than 0, or WAVESIZE.
    maxflatgridsize 0;                                           // Arg must be an immediate value greater than 0, or WAVESIZE.
    maxflatgridsize 0.0;                                         // Arg must be an immediate value greater than 0, or WAVESIZE.
    maxflatgridsize ;                                            // Arg must be an immediate value greater than 0, or WAVESIZE.
    maxflatgridsize 1, 2;                                        // Arg must be an immediate value greater than 0, or WAVESIZE.
    maxflatgridsize "";                                          // Arg must be an immediate value greater than 0, or WAVESIZE.
///F    maxflatgridsize 10;   maxflatgridsize 11;                    // If multiple control directives are present in the kernel or the functions it calls, they must all have the same values.
///F
///F    requiredgridsize 5, 6, 10;         maxflatgridsize 1;        // The value specified must be greater than or equal to the product of the values specified by requiredgridsize
///F    requiredgridsize 5, 6, 10;         maxflatgridsize 299;      // The value specified must be greater than or equal to the product of the values specified by requiredgridsize
///F    requiredgridsize WAVESIZE, 2, 1;   maxflatgridsize WAVESIZE; // The value specified must be greater than or equal to the product of the values specified by requiredgridsize
///F    requiredgridsize 1, 2, WAVESIZE;   maxflatgridsize WAVESIZE; // The value specified must be greater than or equal to the product of the values specified by requiredgridsize

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// The control directives must appear in the code block of a kernel, function, or argument scope
/// Arg must be an immediate value greater than 0, or WAVESIZE.
/// If multiple control directives are present in the kernel or the functions it calls, they must all have the same values.
/// The value specified must also be greater than or equal to the product of the values specified by requiredworkgroupsize.

// maxflatworkgroupsize.directive

[[ maxflatworkgroupsize 1; // must appear in a code block ]] 

    maxflatworkgroupsize u16x2(0,0);                 // Arg must be an immediate value greater than 0, or WAVESIZE.
    maxflatworkgroupsize  0;                          // Arg must be an immediate value greater than 0, or WAVESIZE.
    maxflatworkgroupsize 0.0;                         // Arg must be an immediate value greater than 0, or WAVESIZE.
    maxflatworkgroupsize ;                            // Arg must be an immediate value greater than 0, or WAVESIZE.
    maxflatworkgroupsize 1, 2;                        // Arg must be an immediate value greater than 0, or WAVESIZE.
    maxflatworkgroupsize "";                          // Arg must be an immediate value greater than 0, or WAVESIZE.
///F    maxflatworkgroupsize 4; maxflatworkgroupsize  3;  // If multiple control directives are present in the kernel or the functions it calls, they must all have the same values.
///F
///F    requiredworkgroupsize 5, 6, 10;       maxflatworkgroupsize 1;        // The value specified must also be greater than or equal to the product of the values specified by requiredworkgroupsize.
///F    requiredworkgroupsize 5, 6, 10;       maxflatworkgroupsize 299;      // The value specified must also be greater than or equal to the product of the values specified by requiredworkgroupsize.
///F    requiredworkgroupsize WAVESIZE, 2, 1; maxflatworkgroupsize WAVESIZE; // The value specified must also be greater than or equal to the product of the values specified by requiredworkgroupsize.
///F    requiredworkgroupsize 1, 2, WAVESIZE; maxflatworkgroupsize WAVESIZE; // The value specified must also be greater than or equal to the product of the values specified by requiredworkgroupsize.

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// The control directives must appear in the code block of a kernel, function, or argument scope
/// If multiple control directives are present in the kernel or the functions it calls, they must all have the same values.
/// Arg must be an immediate value with the value 1, 2, or 3.
/// Arg value must be consistent with requiredgridsize and requiredworkgroupsize:
/// - if requireddim = 1, => requiredgridsize X, 1, 1; requiredworkgroupsize X, 1, 1;
/// - if requireddim = 2, => requiredgridsize X, Y, 1; requiredworkgroupsize X, Y, 1;

// requireddim.directive 

[[ requireddim 3; // must appear in a code block ]] 

    requireddim -1;                 // Arg must be an immediate value with the value 1, 2, or 3.
    requireddim 0;                  // Arg must be an immediate value with the value 1, 2, or 3.
    requireddim 4;                  // Arg must be an immediate value with the value 1, 2, or 3.
    requireddim 0.0;                // Arg must be an immediate value with the value 1, 2, or 3.
    requireddim ;                   // Arg must be an immediate value with the value 1, 2, or 3.
    requireddim 1, 2;               // Arg must be an immediate value with the value 1, 2, or 3.
    requireddim "";                 // Arg must be an immediate value with the value 1, 2, or 3.
    requireddim WAVESIZE;           // Arg must be an immediate value with the value 1, 2, or 3.

///F    requireddim 2; requireddim 3;   // If multiple control directives are present in the kernel or the functions it calls, they must all have the same values.
///F
///F    requiredgridsize 1, 2, 3;      requireddim 1;    // Arg value must be consistent with requiredgridsize
///F    requiredgridsize 1, 2, 3;      requireddim 2;    // Arg value must be consistent with requiredgridsize
///F    requiredgridsize 1, 2, 1;      requireddim 1;    // Arg value must be consistent with requiredgridsize
///F
///F    requiredworkgroupsize 1, 2, 3; requireddim 1;    // Arg value must be consistent with requiredworkgroupsize
///F    requiredworkgroupsize 1, 2, 3; requireddim 2;    // Arg value must be consistent with requiredworkgroupsize
///F    requiredworkgroupsize 1, 2, 1; requireddim 1;    // Arg value must be consistent with requiredworkgroupsize

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// The control directives must appear in the code block of a kernel, function, or argument scope
/// If multiple control directives are present in the kernel or the functions it calls, they must all have the same values.
/// Args must be an immediate value greater than 0, or WAVESIZE.
/// Args values must be consistent with requireddim
/// The product of the values must be less than or equal to value specified by maxflatgridsize

// requiredgridsize.directive

[[ requiredgridsize 1, 2, 3; // must appear in a code block ]] 

    requiredgridsize 1, 2;                      // Args must be an immediate value greater than 0, or WAVESIZE.
    requiredgridsize 3;                         // Args must be an immediate value greater than 0, or WAVESIZE.
    requiredgridsize ;                          // Args must be an immediate value greater than 0, or WAVESIZE.

    requiredgridsize 0.0, 2, 3;                 // Args must be an immediate value greater than 0, or WAVESIZE.
    requiredgridsize 0, 2.0, 3;                 // Args must be an immediate value greater than 0, or WAVESIZE.
    requiredgridsize 0, 2, 3.0;                 // Args must be an immediate value greater than 0, or WAVESIZE.
    requiredgridsize 0, 2, 3;                   // Args must be an immediate value greater than 0, or WAVESIZE.
    requiredgridsize 1, 0, 3;                   // Args must be an immediate value greater than 0, or WAVESIZE.
    requiredgridsize 1, 2, 0;                   // Args must be an immediate value greater than 0, or WAVESIZE.
    requiredgridsize u16x2(0,0), 2, 3;         // Args must be an immediate value greater than 0, or WAVESIZE.
    requiredgridsize 1, u16x2(0,0), 3;         // Args must be an immediate value greater than 0, or WAVESIZE.
    requiredgridsize 1, 2, u16x2(0,0);         // Args must be an immediate value greater than 0, or WAVESIZE.

///F    requiredgridsize 1, 2, 3; requiredgridsize 7, 2, 3;    // If multiple control directives are present in the kernel or the functions it calls, they must all have the same values.
///F    requiredgridsize 1, 2, 3; requiredgridsize 1, 1, 3;    // If multiple control directives are present in the kernel or the functions it calls, they must all have the same values.
///F    requiredgridsize 1, 2, 3; requiredgridsize 1, 2, 4;    // If multiple control directives are present in the kernel or the functions it calls, they must all have the same values.

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// The control directives must appear in the code block of a kernel, function, or argument scope
/// If multiple control directives are present in the kernel or the functions it calls, they must all have the same values.
/// Args must be an immediate value greater than 0, or WAVESIZE.
/// The product of the values must be less than or equal to any value specified by maxflatworkgroupsize .
/// Args values must be consistent with requireddim

// requiredworkgroupsize.directive

[[ requiredworkgroupsize 1, 2, 3; // must appear in a code block ]] 

    requiredworkgroupsize 1, 2;                     // Args must be an immediate value greater than 0, or WAVESIZE.
    requiredworkgroupsize 3;                        // Args must be an immediate value greater than 0, or WAVESIZE.
    requiredworkgroupsize ;                         // Args must be an immediate value greater than 0, or WAVESIZE.

    requiredworkgroupsize 0.0, 2, 3;                // Args must be an immediate value greater than 0, or WAVESIZE.
    requiredworkgroupsize 0, 2.0, 3;                // Args must be an immediate value greater than 0, or WAVESIZE.
    requiredworkgroupsize 0, 2, 3.0;                // Args must be an immediate value greater than 0, or WAVESIZE.
    requiredworkgroupsize 0, 2, 3;                  // Args must be an immediate value greater than 0, or WAVESIZE.
    requiredworkgroupsize 1, 0, 3;                  // Args must be an immediate value greater than 0, or WAVESIZE.
    requiredworkgroupsize 1, 2, 0;                  // Args must be an immediate value greater than 0, or WAVESIZE.
    requiredworkgroupsize u16x2(0,0), 2, 3;        // Args must be an immediate value greater than 0, or WAVESIZE.
    requiredworkgroupsize 1, u16x2(0,0), 3;        // Args must be an immediate value greater than 0, or WAVESIZE.
    requiredworkgroupsize 1, 2, u16x2(0,0);        // Args must be an immediate value greater than 0, or WAVESIZE.

///F    requiredworkgroupsize 1, 2, 3; requiredworkgroupsize 7, 2, 3;   // If multiple control directives are present in the kernel or the functions it calls, they must all have the same values.
///F    requiredworkgroupsize 1, 2, 3; requiredworkgroupsize 1, 7, 3;   // If multiple control directives are present in the kernel or the functions it calls, they must all have the same values.
///F    requiredworkgroupsize 1, 2, 3; requiredworkgroupsize 1, 2, 7;   // If multiple control directives are present in the kernel or the functions it calls, they must all have the same values.

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// The control directives must appear in the code block of a kernel, function, or argument scope

// requirenopartialworkgroups.directive

[[ requirenopartialworkgroups; // must appear in a code block ]] 
    
   requirenopartialworkgroups -1; 
   requirenopartialworkgroups 0; 
   requirenopartialworkgroups 1; 
   requirenopartialworkgroups 1.0; 
   requirenopartialworkgroups ""; 
   requirenopartialworkgroups 1, 2; 
   requirenopartialworkgroups WAVESIZE; 

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// 

// sampler.init.values: Initialization of Samp. All values must be specified

[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(                    filter = nearest, addressing = clamp_to_edge); // error  ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord = normalized,                   addressing = clamp_to_edge); // error  ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord = normalized, filter = nearest); // error  ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord = normalized); // error                                                                             ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(filter = nearest); // error                                                                               ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(addressing = clamp_to_edge); // error                                                                              ]]


// sampler.init.syntax: Initialization of Samp - Syntax

[[ extension "IMAGE"; alloc(agent) global_samp &y samp(coord = normalized, filter = nearest, addressing = clamp_to_edge); // error         ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(); // error                                                                                                    ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord normalized, filter = nearest, addressing = clamp_to_edge); // error         ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord = , filter = nearest, addressing = clamp_to_edge);                          ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord = normalized filter = nearest, addressing = clamp_to_edge); // error        ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord = normalized, , filter = nearest, addressing = clamp_to_edge); // error     ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord = normalized, , ); // error                                                                              ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord = normalized,  = nearest, addressing = clamp_to_edge); // error             ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord = normalized, filter = ,  addressing = clamp_to_edge);                      ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord = nearest, filter = nearest, addressing = clamp_to_edge);                   ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord = normalized, filter = normalized, addressing = clamp_to_edge);             ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord = normalized, filter = nearest, addressing = );                    ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord = normalized, filter = nearest, addressing = cclamp); // error      ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord = normalized, filter = nearest, boundaryv = clamp_to_edge); // error        ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord = normalized, filter = nearest, addressing = nearest);              ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord = normalized, filter = nearest, addressing = ); // error            ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord = normalized, filter = nearest, addressing = clamp_to_edge; // error        ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord == normalized, filter = nearest, addressing = clamp_to_edge); // error      ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord = normalized=, filter = nearest, addressing = clamp_to_edge); // error      ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord = {normalized, filter = nearest, addressing = clamp_to_edge); // error      ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord = normalized; filter = nearest, addressing = clamp_to_edge); // error       ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord =; normalized, filter = nearest, addressing = clamp_to_edge); // error      ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(normalized, filter = nearest, addressing = clamp_to_edge); // error               ]]

// sampler.init.normalized: repeat, mirrored_repeat require normalized coordinates

[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord = unnormalized, filter = nearest, addressing = mirrored_repeat); // error                ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord = unnormalized, filter = nearest, addressing = repeat); // error                ]]

// sampler.init.unnormalized: delme

[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord = unnormalized, filter = linear, addressing = repeat); ]]

// sampler.init.dup: duplicate property definition

[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord = normalized, filter = nearest, addressing = clamp_to_edge, coord = unnormalized);    ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord = normalized, filter = nearest, addressing = clamp_to_edge, filter = linear);                           ]]
[[ extension "IMAGE"; alloc(agent) global_samp &y = samp(coord = normalized, addressing = repeat, filter = nearest, addressing = clamp_to_edge);                          ]]

// sampler.init.syntax.old: Old syntax

[[ extension "IMAGE"; alloc(agent) global_samp &x    = {};                                                                                           ]]
[[ extension "IMAGE"; alloc(agent) global_samp &x    = ();                                                                                           ]]
[[ extension "IMAGE"; alloc(agent) global_samp &x    = (coord = unnormalized, filter = nearest, addressing = clamp_to_edge); ]]
[[ extension "IMAGE"; alloc(agent) global_samp &x[]  = (coord = unnormalized, filter = nearest, addressing = clamp_to_edge); ]]
[[ extension "IMAGE"; alloc(agent) global_samp &x[1] = (coord = unnormalized, filter = nearest, addressing = clamp_to_edge); ]]
[[ extension "IMAGE"; alloc(agent) global_samp &x[2] = (coord = unnormalized, filter = nearest, addressing = clamp_to_edge); ]]

[[ extension "IMAGE"; alloc(agent) global_samp &x    = samp(coord = normalized, filter = nearest, addressing = clamp); ]]
[[ extension "IMAGE"; alloc(agent) global_samp &x    = samp(coord = normalized, filter = nearest, addressing = border); ]]
[[ extension "IMAGE"; alloc(agent) global_samp &x    = samp(coord = normalized, filter = nearest, addressing = wrap); ]]
[[ extension "IMAGE"; alloc(agent) global_samp &x    = samp(coord = normalized, filter = nearest, addressing = mirror); ]]
[[ extension "IMAGE"; alloc(agent) global_samp &x    = samp(coord = normalized, filter = nearest, addressing = mirroronce); ]]

// sampler.init.array.by.scalar

[[ extension "IMAGE"; alloc(agent) global_samp &x[]  = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_edge); ]]
[[ extension "IMAGE"; alloc(agent) global_samp &x[1] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_edge); ]]
[[ extension "IMAGE"; alloc(agent) global_samp &x[2] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_edge); ]]

// sampler.init.scalar.by.array

[[ extension "IMAGE"; alloc(agent) global_samp &x = samp[] ( );                                                                                                ]]
[[ extension "IMAGE"; alloc(agent) global_samp &x = samp[] ( samp(coord = unnormalized, filter = nearest, addressing = clamp_to_edge) ); ]]
[[ extension "IMAGE"; alloc(agent) global_samp &x = samp[] ( samp(coord = unnormalized, filter = nearest, addressing = clamp_to_edge), samp(coord = unnormalized, filter = nearest, addressing = clamp_to_edge) ); ]]
[[ extension "IMAGE"; alloc(agent) global_samp &x = samp[] ( samp(coord = unnormalized, filter = nearest, addressing = clamp_to_edge) ); ]]

// sampler.init.scalar.wrong.prefix

[[ extension "IMAGE"; alloc(agent) global_samp &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r); ]]

// sampler.init.array.wrong.prefix

[[ extension "IMAGE"; alloc(agent) global_samp &x[] = samp[] ( roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r), rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r) ); ]]
[[ extension "IMAGE"; alloc(agent) global_samp &x[] = samp[] ( roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r), woimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r) ); ]]
[[ extension "IMAGE"; alloc(agent) global_samp &x[] = samp[] ( samp(coord = unnormalized, filter = nearest, addressing = clamp_to_edge), roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r) ); ]]
[[ extension "IMAGE"; alloc(agent) global_samp &x[] = samp[] ( woimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r), samp(coord = unnormalized, filter = nearest, addressing = clamp_to_edge) ); ]]

[[ extension "IMAGE"; alloc(agent) global_samp &x[] = samp[] ( img(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r), samp(coord = unnormalized, filter = linear, addressing = clamp_to_border) ); ]]
[[ extension "IMAGE"; alloc(agent) global_samp &x[] = roimg[] ( samp(coord = unnormalized, filter = linear, addressing = clamp_to_border), samp(coord = unnormalized, filter = linear, addressing = clamp_to_border) ); ]]

// sampler.init.with.numbers

[[ extension "IMAGE"; alloc(agent) global_samp &x   = 0;              ]]
[[ extension "IMAGE"; alloc(agent) global_samp &x   = u64[](0, 1, 2); ]]
[[ extension "IMAGE"; alloc(agent) global_samp &x[] = 0;              ]]
[[ extension "IMAGE"; alloc(agent) global_samp &x[] = u64[](0, 1, 2); ]]

// sampler.init.for.var

[[ extension "IMAGE"; readonly_s32 &x   = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_edge); ]]
[[ extension "IMAGE"; readonly_s32 &x[] = samp[] ( samp(coord = unnormalized, filter = nearest, addressing = clamp_to_edge) ); ]]


// sampler.init.array.with.long.list

[[ extension "IMAGE"; alloc(agent) global_samp &x[1] = samp[] ( samp(coord = unnormalized, filter = nearest, addressing = clamp_to_edge), samp(coord = unnormalized, filter = nearest, addressing = clamp_to_edge) ); ]]

// sampler.init.syntax2

[[ extension "IMAGE"; alloc(agent) global_samp &x[2] = samp[] ( samp(coord = unnormalized, filter = nearest, addressing = clamp_to_edge), samp(coord = unnormalized, filter = nearest, addressing = clamp_to_edge)    ]]
[[ extension "IMAGE"; alloc(agent) global_samp &x[2] = samp[] ( samp(coord = unnormalized, filter = nearest, addressing = clamp_to_edge),      (coord = unnormalized, filter = nearest, addressing = clamp_to_edge) ); ]]
[[ extension "IMAGE"; alloc(agent) global_samp &x[2] = samp[] ( samp(coord = unnormalized, filter = nearest, addressing = clamp_to_edge)  samp(coord = unnormalized, filter = nearest, addressing = clamp_to_edge) ); ]]
[[ extension "IMAGE"; alloc(agent) global_samp &x[2] = samp[] ( samp(coord = unnormalized, filter = nearest, addressing = clamp_to_edge)),_samp(coord = unnormalized, filter = nearest, addressing = clamp_to_edge) ); ]]
[[ extension "IMAGE"; alloc(agent) global_samp &x[2] = samp[] ( samp(coord = unnormalized, filter = nearest, addressing = clamp_to_edge,  samp(coord = unnormalized, filter = nearest, addressing = clamp_to_edge) ); ]]
[[ extension "IMAGE"; alloc(agent) global_samp &x[2] = samp[]   samp(coord = unnormalized, filter = nearest, addressing = clamp_to_edge), samp(coord = unnormalized, filter = nearest, addressing = clamp_to_edge) ); ]]
[[ extension "IMAGE"; alloc(agent) global_samp &x[2]   samp[] ( samp(coord = unnormalized, filter = nearest, addressing = clamp_to_edge), samp(coord = unnormalized, filter = nearest, addressing = clamp_to_edge) ); ]]

// sampler.init.agent

[[ extension "IMAGE"; prog global_samp  &samp    = samp(coord = normalized, filter = nearest, addressing = clamp_to_edge); ]]
[[ extension "IMAGE";      global_samp  &samp    = samp(coord = normalized, filter = nearest, addressing = clamp_to_edge); ]]

[[ extension "IMAGE"; prog alloc(agent) readonly_samp  &samp    = samp(coord = normalized, filter = nearest, addressing = clamp_to_edge); ]]
[[ extension "IMAGE";      alloc(agent) readonly_samp  &samp    = samp(coord = normalized, filter = nearest, addressing = clamp_to_edge); ]]

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////

// image.init.value: invalid value. Validator cannot catch this bug as "width", "height" and "depth" are unsigned

[[ extension "IMAGE"; alloc(agent) global_roimg &ro_img = roimg(geometry = 3d, width = 0, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx);   ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &ro_img = roimg(geometry = 3d, width = 5, height = 0, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx);   ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &ro_img = roimg(geometry = 3d, width = 5, height = 4, depth = 0, channel_type = unorm_int_101010, channel_order = rgbx);   ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &ro_img = roimg(geometry = 1da, width = 5, array = 0, channel_type = unorm_int_101010, channel_order = rgbx);              ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &ro_img = roimg(geometry = 3d, width = -1, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx);  ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &ro_img = roimg(geometry = 3d, width = 5, height = -1, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx);  ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &ro_img = roimg(geometry = 3d, width = 5, height = 4, depth = -1, channel_type = unorm_int_101010, channel_order = rgbx);  ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &ro_img = roimg(geometry = 1da, width = 5, array = -1, channel_type = unorm_int_101010, channel_order = rgbx);              ]]

// image.init.syntax: Invalid init

[[ extension "IMAGE"; alloc(agent) global_roimg &ro_img = roimg(geometry = 3d, width = 1.0, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx);   ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &ro_img = roimg(geometry = 3d, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx, width = );   ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &ro_img = roimg(); // error             ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &ro_img = roimg(geometry = 3d, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx, width);   ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &ro_img = 0; // error              ]]

// image.init.format: Invalid format

[[ extension "IMAGE"; alloc(agent) global_roimg &ro_img = roimg(geometry = 3d, width = 1, height = 4, depth = 6, channel_order = rgbx, channel_type = rgbx); // error               ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &ro_img = roimg(geometry = 3d, width = 1, height = 4, depth = 6, channel_order = rgbx, channel_type = 0);    // error               ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &ro_img = roimg(geometry = 3d, width = 1, height = 4, depth = 6, channel_order = rgbx, channel_type = =); // error                  ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &ro_img = roimg(geometry = 3d, width = 1, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = unorm_int_101010); // error  ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &ro_img = roimg(geometry = 3d, width = 1, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = float); // error               ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &ro_img = roimg(float); // error                       ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &ro_img = roimg(geometry = 3d, width = 1, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order =  // error                      ]]
[[ extension "IMAGE"; alloc(agent) global_rwimg &rw_img = rwimg(geometry = 3d, width = 1, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = 0);                            ]]

// image.init.dup: Duplicate property

[[ extension "IMAGE"; alloc(agent) global_roimg &img = roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx, width = 4);             ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &img = roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, height = 5, channel_order = rgbx, width = 4); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &img = roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, height = 5, channel_order = rgbx);            ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &img = roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, depth = 6, height = 5, channel_order = rgbx); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &img = roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, depth = 6, channel_order = rgbx);             ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &img = roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx, channel_type = unorm_int8);   ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &img = roimg(geometry = 3d, width = 5, channel_order = rx, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx);            ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &img = roimg(geometry = 3d, width = 5, channel_order = rx, height = 4, depth = 6, channel_type = unorm_int_101010, geometry = 1d);           ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &img = roimg(geometry = 1da, width = 4,                       array = 4, channel_type = unorm_int_101010, channel_order = rgbx, array = 4);  ]]

// image.init.all.values: Initialization of Image. All values must be specified

[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(                width = 3, height = 2, depth = 1,           channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 1d,                                              channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 1d,  width = 1,                                                               channel_order = rgbx); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 1d,  width = 1,                                  channel_type = unorm_int_101010              ); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 2d,  width = 2,                                  channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 2d,             height = 1,                      channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 2d,  width = 2, height = 1,                                                   channel_order = rgbx); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 2d,  width = 2, height = 1,                      channel_type = unorm_int_101010              ); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 3d,  width = 3, height = 2,                      channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 3d,             height = 2, depth = 1,           channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 3d,  width = 3,             depth = 1,           channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 3d,  width = 3, height = 2, depth = 1,                                        channel_order = rgbx); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 3d,  width = 3, height = 2, depth = 1,           channel_type = unorm_int_101010              ); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 1da, width = 4,                                  channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 1da,                                  array = 4, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 1da, width = 4,                       array = 4,                              channel_order = rgbx); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 1da, width = 4,                       array = 4, channel_type = unorm_int_101010              ); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 2da, width = 5, height = 4,           array = 4,                              channel_order = rgbx); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 2da,            height = 4,           array = 4, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 2da, width = 5,                       array = 4, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 2da, width = 5, height = 4,                      channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 2da, width = 5, height = 4,           array = 4, channel_type = unorm_int_101010              ); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 1db, width = 5,                                  channel_type = unorm_int_101010              ); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 1db,                                             channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 1db, width = 5,                                                               channel_order = rgbx); ]]

[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 2ddepth, width = 5,                              channel_type = unorm_int_101010, channel_order = depth); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 2ddepth, height = 5,                             channel_type = unorm_int_101010, channel_order = depth); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 2ddepth, width = 5, height = 5,                                               channel_order = depth); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 2ddepth, width = 5, height = 5,      array = 4,  channel_type = unorm_int_101010, channel_order = depth); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 2ddepth, width = 5, height = 5,      depth = 1,  channel_type = unorm_int_101010, channel_order = depth); ]]

[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 2dadepth, width = 5, height = 5,                 channel_type = unorm_int_101010, channel_order = depth); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 2dadepth, width = 5, array = 5,                  channel_type = unorm_int_101010, channel_order = depth); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 2dadepth, array = 5, height = 5,                 channel_type = unorm_int_101010, channel_order = depth); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 2dadepth, width = 5, height = 5, array = 5,                                   channel_order = depth); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 2dadepth, width = 5, height = 5, array = 4, depth = 1, channel_type = unorm_int_101010, channel_order = depth); ]]

// image.init.order: Invalid order

[[ extension "IMAGE"; readonly_rwimg &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = depth);               ]]
[[ extension "IMAGE"; readonly_rwimg &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = depth_stencil);       ]]

[[ extension "IMAGE"; readonly_rwimg &x = rwimg(geometry = 2ddepth, width = 5, height = 4, channel_type = unorm_int_101010, channel_order = rgbx);                     ]]
[[ extension "IMAGE"; readonly_rwimg &x = rwimg(geometry = 2dadepth, width = 5, height = 4, array = 6, channel_type = unorm_int_101010, channel_order = luminance); ]]

// image.init.geometry: Invalid geometry

[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 3,   width = 3, height = 2, depth = 6,           channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = 3.0, width = 3, height = 2, depth = 6,           channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = "a", width = 3, height = 2, depth = 6,           channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = rgbx,width = 3, height = 2, depth = 6,           channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry = unorm_int_101010,width = 3, height = 2, depth = 6,           channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry =      width = 3, height = 2, depth = 6,           channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &roimage = roimg(geometry        width = 3, height = 2, depth = 6,           channel_type = unorm_int_101010, channel_order = rgbx); ]]

// image.init.syntax.old: Old syntax

[[ extension "IMAGE"; readonly_roimg &x    = {};                                                                                           ]]
[[ extension "IMAGE"; readonly_roimg &x    = {geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx}; ]]
[[ extension "IMAGE"; readonly_roimg &x[]  = {geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx}; ]]
[[ extension "IMAGE"; readonly_roimg &x[1] = {geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx}; ]]
[[ extension "IMAGE"; readonly_roimg &x[2] = {geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx}; ]]
[[ extension "IMAGE"; readonly_roimg &x    = roimg(geometry = 3d, width = 5, height = 4, depth = 6, format = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; readonly_roimg &x    = roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, order = rgbx); ]]

// image.init.array.by.scalar

[[ extension "IMAGE"; readonly_roimg &x[]  = roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r); ]]
[[ extension "IMAGE"; readonly_roimg &x[1] = roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r); ]]
[[ extension "IMAGE"; readonly_roimg &x[2] = roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r); ]]

// image.init.scalar.by.array

[[ extension "IMAGE"; readonly_roimg &x = roimg[] ( );                                                                                                ]]
[[ extension "IMAGE"; readonly_roimg &x = roimg[] ( roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r) ); ]]
[[ extension "IMAGE"; readonly_roimg &x = roimg[] ( roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r), roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r) ); ]]
[[ extension "IMAGE"; readonly_roimg &x = roimg[] ( roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r) ); ]]

// image.init.scalar.wrong.prefix

[[ extension "IMAGE"; readonly_roimg &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r); ]]
[[ extension "IMAGE"; readonly_roimg &x = woimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r); ]]

[[ extension "IMAGE"; readonly_rwimg &x = roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r); ]]
[[ extension "IMAGE"; readonly_rwimg &x = woimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r); ]]

[[ extension "IMAGE"; readonly_woimg &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r); ]]
[[ extension "IMAGE"; readonly_woimg &x = roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r); ]]

[[ extension "IMAGE"; readonly_woimg &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; readonly_woimg &x = _woimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r); ]]

// image.init.array.wrong.prefix

[[ extension "IMAGE"; readonly_roimg &x[] = roimg[] ( roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r), rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r) ); ]]
[[ extension "IMAGE"; readonly_roimg &x[] = roimg[] ( roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r), woimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r) ); ]]
[[ extension "IMAGE"; readonly_roimg &x[] = roimg[] ( rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r), roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r) ); ]]
[[ extension "IMAGE"; readonly_roimg &x[] = roimg[] ( woimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r), roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r) ); ]]

[[ extension "IMAGE"; readonly_roimg &x[] = roimg[] ( roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r), samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border) ); ]]
[[ extension "IMAGE"; readonly_roimg &x[] = rwimg[] ( roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r), roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r) ); ]]

[[ extension "IMAGE"; readonly_roimg &x[] = rwimg[] ( rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r), rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r) ); ]]

// image.init.with.numbers

[[ extension "IMAGE"; readonly_roimg &x   = 0;              ]]
[[ extension "IMAGE"; readonly_roimg &x   = u64[](0, 1, 2); ]]
[[ extension "IMAGE"; readonly_roimg &x[] = 0;              ]]
[[ extension "IMAGE"; readonly_roimg &x[] = u64[](0, 1, 2); ]]

// image.init.for.var

[[ extension "IMAGE"; readonly_s32 &x   = roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r); ]]
[[ extension "IMAGE"; readonly_s32 &x[] = roimg[] ( roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r) ); ]]


// image.init.array.with.long.list

[[ extension "IMAGE"; readonly_roimg &x[1] = roimg[] ( roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r), roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r) ); ]]

// image.init.syntax2

[[ extension "IMAGE"; readonly_roimg &x[2] = roimg[] ( roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r), roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r)    ]]
[[ extension "IMAGE"; readonly_roimg &x[2] = roimg[] ( roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r),       (geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r) ); ]]
[[ extension "IMAGE"; readonly_roimg &x[2] = roimg[] ( roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r)  roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r) ); ]]
[[ extension "IMAGE"; readonly_roimg &x[2] = roimg[] ( roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r,  roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r) ); ]]
[[ extension "IMAGE"; readonly_roimg &x[2] = roimg[]   roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r), roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r) ); ]]
[[ extension "IMAGE"; readonly_roimg &x[2]   roimg[] ( roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r), roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = r) ); ]]

// image.init.agent

[[ extension "IMAGE"; prog global_roimg &n0 = roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE";      global_roimg &n0 = roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]

[[ extension "IMAGE"; prog alloc(agent) readonly_roimg &n0 = roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE";      alloc(agent) readonly_roimg &n0 = roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Image objects can be defined in three places:
/// - As a global or readonly variable outside of a function or kernel.
/// - As a type in an arg definition
/// - As a type in a kernarg definition

// opaque.definitions

[[ extension "IMAGE"; group_samp    &x; ]]
[[ extension "IMAGE"; private_samp  &x; ]]
[[ extension "IMAGE"; group_rwimg   &x; ]]
[[ extension "IMAGE"; private_roimg &x; ]]

[[ extension "IMAGE"; function &fn()() { { global_rwimg    %x; call &fn()(); } }; ]]
[[ extension "IMAGE"; function &fn()() { { readonly_rwimg  %x; call &fn()(); } }; ]]
[[ extension "IMAGE"; function &fn()() {   group_rwimg     %x;                 }; ]]
[[ extension "IMAGE"; function &fn()() {   private_rwimg   %x;                 }; ]]
[[ extension "IMAGE"; function &fn()() {   spill_rwimg     %x;                 }; ]]
[[ extension "IMAGE"; function &fn()() { { spill_rwimg     %x; call &fn()(); } }; ]]

[[ extension "IMAGE"; function &fn()() { { global_samp    %x; call &fn()(); } }; ]]
[[ extension "IMAGE"; function &fn()() { { readonly_samp  %x; call &fn()(); } }; ]]
[[ extension "IMAGE"; function &fn()() {   group_samp     %x;                 }; ]]
[[ extension "IMAGE"; function &fn()() {   private_samp   %x;                 }; ]]
[[ extension "IMAGE"; function &fn()() {   spill_samp     %x;                 }; ]]
[[ extension "IMAGE"; function &fn()() { { spill_samp     %x; call &fn()(); } }; ]]

[[ extension "IMAGE"; function &fn()(){}; kernel &k() { { global_rwimg    %x; call &fn()(); } }; ]]
[[ extension "IMAGE"; function &fn()(){}; kernel &k() { { readonly_rwimg  %x; call &fn()(); } }; ]]
[[ extension "IMAGE"; function &fn()(){}; kernel &k() {   group_rwimg     %x; };   ]]
[[ extension "IMAGE"; function &fn()(){}; kernel &k() {   private_rwimg   %x; };   ]]
[[ extension "IMAGE"; function &fn()(){}; kernel &k() {   spill_rwimg     %x; };   ]]

[[ extension "IMAGE"; function &fn()(){}; kernel &k() { { global_roimg    %x; call &fn()(); } }; ]]
[[ extension "IMAGE"; function &fn()(){}; kernel &k() { { readonly_roimg  %x; call &fn()(); } }; ]]
[[ extension "IMAGE"; function &fn()(){}; kernel &k() {   group_roimg     %x; };   ]]
[[ extension "IMAGE"; function &fn()(){}; kernel &k() {   private_roimg   %x; };   ]]
[[ extension "IMAGE"; function &fn()(){}; kernel &k() {   spill_roimg     %x; };   ]]

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// FUNCTION/KERNEL ARGUMENTS

// func.arg.align.unsupported: Invalid align arg. Parser should not allow negative values as this cannot be later detected by Validator (unsigned field)

[[ function &f(align(-1 ) arg_b8 %a)(){};  ]]
[[ function &f(align(0  ) arg_b8 %a)(){};  ]]
[[ function &f(align(3  ) arg_b8 %a)(){};  ]]
[[ function &f(align(5  ) arg_b8 %a)(){};  ]]
[[ function &f(align(512) arg_b8 %a)(){}; ]]
[[ function &f(align(1.0) arg_b8 %a)(){}; ]]
[[ function &f(align("" ) arg_b8 %a)(){};  ]]
[[ function &f(align      arg_b8 %a)(){};     ]]

// kernel.arg.align.unsupported: Invalid align arg. Parser should not allow negative values as this cannot be later detected by Validator (unsigned field)

[[ kernel &k(align(-1 ) kernarg_b8 %a){};  ]]
[[ kernel &k(align(0  ) kernarg_b8 %a){};  ]]
[[ kernel &k(align(3  ) kernarg_b8 %a){};  ]]
[[ kernel &k(align(5  ) kernarg_b8 %a){};  ]]
[[ kernel &k(align(512) kernarg_b8 %a){};  ]]
[[ kernel &k(align(1.0) kernarg_b8 %a){};  ]]
[[ kernel &k(align("" ) kernarg_b8 %a){};  ]]
[[ kernel &k(align(   ) kernarg_b8 %a){};  ]]

// func.arg.align.invalid: If an alignment is specified, it must be equal to or greater than the variable's natural alignment

[[ function &f(align(2) arg_u32  %a)(){};  ]]
[[ function &f(align(2) arg_u8x4 %a)(){};  ]]
[[ function &f(align(4) arg_f64  %a)(){};  ]]
[[ function &f(align(4) arg_s16x4 %a)(){}; ]]
[[ function &f(align(8) arg_s16x8 %a)(){}; ]]
[[ function &f(align(8) arg_b128 %a)(){};  ]]

// kernel.arg.align.invalid: If an alignment is specified, it must be equal to or greater than the variable's natural alignment

[[ kernel &k(align(2) kernarg_u32  %a){};  ]]
[[ kernel &k(align(2) kernarg_u8x4 %a){};  ]]
[[ kernel &k(align(4) kernarg_f64  %a){};  ]]
[[ kernel &k(align(4) kernarg_s16x4 %a){}; ]]
[[ kernel &k(align(8) kernarg_s16x8 %a){}; ]]
[[ kernel &k(align(8) kernarg_b128 %a){};  ]]

// func.arg.dim: Invalid dim

[[ function &f(arg_u32 %a[0]) (){};   ]]
[[ function &f(arg_u32 %a[-1])(){};  ]]

// kernel.arg.dim: Invalid dim

[[ kernel &k(kernarg_u32 %a[0]) {};   ]]
[[ kernel &k(kernarg_u32 %a[-1]){};  ]]

// func.arg.init: Invalid initializer

[[ function &f(const arg_u32 %a = 1     )(){}; ]]
[[ function &f(arg_u32       %a[1] = u32[](0))(){}; ]]

// kernel.arg.init: Invalid initializer

[[ kernel   &f(kernarg_u32   %a[1] = u32[](0))  {}; ]]

// func.arg.const: const argument

[[ function &f(const arg_u32 %a)(){};     ]]

// kernel.arg.const: const argument

[[ kernel &kern(const kernarg_u32 %a){};  ]]

// func.arg.decl: decl argument

[[ function &f(decl arg_b32 %x)() {}; ]]

// kernel.arg.decl: decl argument

[[ kernel &k(decl kernarg_b32 %x) {}; ]]

// func.arg.prog: prog argument

[[ function &f(prog arg_b32 %x)() {}; ]]

// kernel.arg.prog: prog argument

[[ kernel &k(prog kernarg_b32 %x) {}; ]]

// func.arg.segment: invalid arg segment

[[ function &TestFunc12(global_u32 %x)(){};      ]] 
[[ function &TestFunc12(readonly_u32 %x)(){};    ]] 
[[ function &TestFunc12(group_u32 %x)(){};       ]] 
[[ function &TestFunc12(kernarg_u32 %x)(){};     ]] 
[[ function &TestFunc12(private_u32 %x)(){};     ]] 
[[ function &TestFunc12(spill_u32 %x)(){};       ]] 

// kern.arg.segment: invalid arg segment

[[ kernel &TestFunc12(global_u32 %x){};      ]] 
[[ kernel &TestFunc12(readonly_u32 %x){};    ]] 
[[ kernel &TestFunc12(group_u32 %x){};       ]] 
[[ kernel &TestFunc12(arg_u32 %x){};         ]] 
[[ kernel &TestFunc12(private_u32 %x){};     ]] 
[[ kernel &TestFunc12(spill_u32 %x){};       ]] 

// func.arg.name: invalid arg name

[[ function &TestFunc12(arg_u32)(){};        ]] 
[[ function &TestFunc12(arg_u32 %&)(){};     ]] 
[[ function &TestFunc12(arg_u32 %%)(){};     ]] 
[[ function &TestFunc12(arg_u32  a)(){};     ]] 
[[ function &TestFunc12(arg_u32 &a)(){};     ]] 
[[ function &TestFunc12(arg_u32 $s)(){};     ]] 
[[ function &TestFunc12(arg_u32 %.)(){};     ]] 
[[ function &TestFunc12(arg_u32 %.abc)(){};  ]] 


// func.arg.duplicate: duplicate arg name

[[ function &f	(arg_u32 %x)(arg_u32 %x){};              ]]
[[ function &f	(arg_u32 %x)(arg_u32 %y, arg_u32 %y){};  ]]


// kernel.arg.duplicate: duplicate arg name

[[ kernel &k(kernarg_u32 %y, kernarg_u32 %y){};  ]]


// func.arg.output: only 1 out arg is allowed

[[ function &f(arg_u32 %x, arg_u32 %y)(){}; ]]


// func.arg.seg: invalid segment

[[ function &f()(global_u32 %x){}; ]]
[[ function &f()(arg %a){};        ]]

// func.arg.b1: b1 is not a valid variable type

[[ function &f()(arg_b1 %x){};     ]]

// kernel.arg.b1: b1 is not a valid variable type

[[ kernel &k(kernarg_b1 %x){};     ]]


/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// FUNCTION DECL AND DEF MISMATCH
 
// func.decl.def.mismatch: Incompatible decl and def arguments

[[ decl function &TestFunc1()(arg_s32 %a);           function &TestFunc1()(arg_u32 %a){};    ]]
[[ decl function &TestFunc1()(arg_s32 %a[]);         function &TestFunc1()(arg_s32 %a){};    ]]
[[ decl function &TestFunc1()(arg_s32 %a[1]);        function &TestFunc1()(arg_s32 %a[]){};  ]]
[[ decl function &TestFunc1()(arg_s32 %a[]);         function &TestFunc1()(arg_s32 %a[2]){}; ]]
[[ decl function &TestFunc1()(arg_s32 %a[1]);        function &TestFunc1()(arg_s32 %a[2]){}; ]]
[[ decl function &TestFunc1()(align(8) arg_s32 %a);   function &TestFunc1()(arg_s32 %a){};    ]]

[[ decl     indirect function &TestFunc1()();                    function &TestFunc1()(){};    ]]
[[ decl              function &TestFunc1()();           indirect function &TestFunc1()(){};    ]]
[[                   function &TestFunc1()(){};    decl indirect function &TestFunc1()();      ]]
[[ indirect          function &TestFunc1()(){};    decl          function &TestFunc1()();      ]]

// func.decl.def.attrs: Incompatible decl/prog attribute

[[ function &TestFunc1()(arg_s32 %a){};         decl prog function &TestFunc1()(arg_s32 %a); ]]
[[ decl function &TestFunc1()(arg_s32 %a);      decl prog function &TestFunc1()(arg_s32 %a); ]]
[[ decl function &TestFunc1()(arg_s32 %a);      prog function &TestFunc1()(arg_s32 %a){};    ]]
[[ decl prog function &TestFunc1()(arg_s32 %a); function &TestFunc1()(arg_s32 %a){};         ]]

// func.decl.def.decl: decl function mismatch (arg num)

[[ decl function &f()();              function &f()(arg_s32 %x){}; ]]
[[ decl function &f()(arg_s32 %x);    function &f()(){};           ]]

[[ function &f()(arg_s32 %x){};         decl function &f()();      ]]
[[ function &f()(){};                   decl function &f()(arg_s32 %x);]]

[[ decl function &f()(arg_s32 %x);    function &f()(arg_u32 %x){};      ]]
[[ decl function &f(arg_f32 %x)();    function &f(arg_s32 %x)(){};      ]]

[[ function &f()(arg_s32 %x){};         decl function &f()(arg_u32 %x); ]]
[[ function &f(arg_s32 %x)(){};         decl function &f(arg_u32 %x)(); ]]

// func.qualifiers

[[ indirect decl function &f()();   ]]
[[ indirect prog function &f()(){}; ]]
[[ prog decl     function &f()();   ]]
[[ alloc(agent)  function &f()(){}; ]]
[[ align(8)      function &f()(){}; ]]
[[ const         function &f()(){}; ]]

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// GENERIC FUNCTION CHECKS

// func.generic: module func must be defined if it is used

[[ decl function &f()(); ]]    { call &f()(); }
[[ decl function &f()(); pragma &f; ]]

// func.attrs: align and const cannot be used with functions

[[ align    function &f()() {}; ]]
[[ align(1) function &f()() {}; ]]
[[ align(4) function &f()() {}; ]]
[[ const    function &f()() {}; ]]

// func.decl: Function must be defined or declared before it may be used

[[ function &f()() { { call &g()(); } }; function &g()() {}; ]]
[[ function &f()() { { call &g()(); } };                     ]]

// func.def: Function must have one definition

[[ function &f()(){}; function &f()(){}; ]]
[[ prog function &f()(){}; prog function &f()(){}; ]]

// func.decl.def: declaration of a function must not have body

[[ decl function &f()() {}; ]]

// func.decl.body: definition of a function must have a body

[[ function &f()(arg_s8 %flex[]); ]]

// func.flex

[[ decl function &f(arg_s8 %x[])(); ]]
[[ decl function &f()(arg_s8 %x[], arg_s8 %y); ]]
[[      function &f()(arg_s8 %x[]) { { arg_s8 %y[]; call &f()(%y); }}; ]]

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// GENERIC KERNEL CHECKS

// kernel.generic: module kernel must be defined if it is used

[[ decl kernel &f(); pragma &f; ]]

// kernel.output.args: Kernels have no output args

[[ kernel &x()() {};   ]]

// kernel.attrs: align, const cannot be used with kernels

[[ align    kernel &x() {}; ]]
[[ align(1) kernel &x() {}; ]]
[[ align(4) kernel &x() {}; ]]
[[ const    kernel &x() {}; ]]

// kernel.body: Kernel definition must have a body

[[ kernel &x();       ]]

// kernel.redefinition: Kernel must have one definition

[[ kernel &x(){};               kernel &x(){}; ]]

// kernel.decl.def.mismatch: Incompatible decl and def arguments

[[ decl kernel &k(kernarg_s32 %a);           kernel &k(kernarg_u32 %a){};    ]]
[[ decl kernel &k(kernarg_s32 %a[2]);        kernel &k(kernarg_s32 %a){};    ]]
[[ decl kernel &k(kernarg_s32 %a);           kernel &k(kernarg_s32 %a[2]){}; ]]
[[ decl kernel &k(kernarg_s32 %a[1]);        kernel &k(kernarg_s32 %a[2]){}; ]]
[[ decl kernel &k(align(8) kernarg_s32 %a);  kernel &k(kernarg_s32 %a){};    ]]

// kernel.decl.def.attrs: Incompatible decl/prog attribute

[[ kernel &k(kernarg_s32 %a){};         decl prog kernel &k(kernarg_s32 %a); ]]
[[ decl kernel &k(kernarg_s32 %a);      decl prog kernel &k(kernarg_s32 %a); ]]
[[ decl kernel &k(kernarg_s32 %a);      prog kernel &k(kernarg_s32 %a){};    ]]
[[ decl prog kernel &k(kernarg_s32 %a); kernel &k(kernarg_s32 %a){};         ]]

// kernel.decl.def.decl: decl kernel mismatch (arg num)

[[ decl kernel &k();                  kernel &k(kernarg_s32 %x){};      ]]
[[ decl kernel &k(kernarg_s32 %x);    kernel &k(){};                ]]

[[ kernel &k(kernarg_s32 %x){};       decl kernel &k();             ]]
[[ kernel &k(){};                     decl kernel &k(kernarg_s32 %x);   ]]

// kernel.qualifiers

[[ indirect kernel &k(){};                 ]]
[[ alloc(agent) kernel &k(){};             ]]
[[ align(8) kernel &k(){};                 ]]
[[ const kernel &k(){};                    ]]
[[ prog decl kernel &k(kernarg_s32 %x);    ]]

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// FUNCTION DECLARATION/DEFINITION SYNTAX

// func.syntax: syntax

[[ &TestFunc()() {};        ]]
[[ function &f()(){}{}      ]]
[[ function f()(){};        ]]
[[ function &()(){};        ]]
[[ function &&()(){};       ]]
[[ function &0()(){};       ]]
[[ function ()(){};         ]]
[[ function &f() {};        ]]
[[ function &f   {};        ]]
[[ function &f(  {};        ]]
[[ function &f()();{};      ]]

// func.nested: nested functions are not allowed

[[ function &f()() { function &x()() { { call &g()(); } }; }; function &g()() {}; ]]


/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// MODULE

// module.syntax: invalid module

[[ module &name:-1:0:$full:$large:$near;    ]]
[[ module &name:1:-1:$full:$large:$near;    ]]
[[ module &name:1.0:0:$full:$large:$near;   ]]
[[ module &name:1:1.0:$full:$large:$near;   ]]
[[ module &name:1:0:$full:$full:$near;      ]]
[[ module &name:1:0:$large:$large:$near;    ]]
[[ module &name:1:0:$large:$full:$near;     ]]
[[ module &name:1:0 $full:$large:$near;     ]]
[[ module &name:1:0:$full $large:$near;     ]]
[[ module &name:1:0:$full:$large;           ]]
[[ module &name:1:0:$full:$large            ]]
[[ module &name:1:0:$full;                  ]]
[[ module &name:1:0:$large;                 ]]
[[ module &name:1:0:$full                   ]]
[[ module &name:1:0:$:$;                    ]]
[[ module &name:1:0:;                       ]]
[[ module &name:1:0;                        ]]
[[ module &name:1:;                         ]]
[[ module &name:1;                          ]]
[[ module &name;                            ]]
[[ module &name                             ]]
[[ module                                   ]]

[[ module &name:1:0:$full:$large:0;         ]]
[[ module &name:1:0:$full:$large:zero;      ]]
[[ module &name:1:0:$full:$large:$zeroo;    ]]
[[ module &name:1:0:$full:$large:$zero o;   ]]
[[ module &name:1:0:$full:$large:$up;       ]]
[[ module &name:1:0:$full:$large:$down;     ]]

[[ module &name:0xFFFFFFFF00000001:0:$full:$large:$near;    ]]
[[ module &name:1:0xFFFFFFFF00000000:$full:$large:$near;     ]]

// module.dup

[[ module &name:1:0:$full:$large:$zero; module &name:1:0:$full:$large:$zero; ]]
[[ module &name:1:0:$full:$large:$near; global_u32 &x; function &x()() {}; module &name:1:0:$full:$large:$zero; ]]

// module.name

[[ module &x:1:0:$full:$large:$zero; function &x()() {}; ]]
[[ module %x:1:0:$full:$large:$zero; ]]
[[ module $s:1:0:$full:$large:$zero; ]]
[[ module &:1:0:$full:$large:$zero;  ]]
[[ module :1:0:$full:$large:$zero;   ]]
[[ module 1:0:$full:$large:$zero;    ]]

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// ORDER OF DIRECTIVES AND INSTRUCTIONS

// order.module

[[ global_s32 &x;               $module$ ]]
[[ decl global_s32 &x;          $module$ ]]
[[ fbarrier &x;                 $module$ ]]
[[ decl fbarrier &x;            $module$ ]]
[[ kernel &x(){};               $module$ ]]
[[ decl kernel &x();            $module$ ]]
[[ function &x()(){};           $module$ ]]
[[ decl function &x()();        $module$ ]]
[[ signature &x()();            $module$ ]]
[[ $module$                     $module$ ]]
[[ extension "CORE";            $module$ ]]
[[ requirenopartialworkgroups;  $module$ ]]


// order.extension

[[ global_s32 &x;               extension "CORE"; ]]
[[ decl global_s32 &x;          extension "CORE"; ]]
[[ fbarrier &x;                 extension "CORE"; ]]
[[ decl fbarrier &x;            extension "CORE"; ]]
[[ kernel &x(){};               extension "CORE"; ]]
[[ decl kernel &x();            extension "CORE"; ]]
[[ function &x()(){};           extension "CORE"; ]]
[[ decl function &x()();        extension "CORE"; ]]
[[ signature &x()();            extension "CORE"; ]]
[[ requirenopartialworkgroups;  extension "CORE"; ]]


// order.control.directives

[[ function &f()() { global_s32 %x;         requirenopartialworkgroups; }; ]]
[[ function &f()() { fbarrier %x;           enablebreakexceptions 1;    }; ]]
[[ function &f()() { @lab1:                 enabledetectexceptions 1;   }; ]]
[[ function &f()() { { call &f()(); }       maxdynamicgroupsize 123;    }; ]]
[[ function &f()() { add_s32 $s0, $s0, $s0; requireddim 3;              }; ]]


// order.block.defs

[[ function &f()() { @lab1:                 global_s32 %x;  }; ]]
[[ function &f()() { { call &f()(); }       fbarrier %x;    }; ]]
[[ function &f()() { add_s32 $s0, $s0, $s0; global_s32 %x;  }; ]]


// order.arg.defs

[[ function &f()(arg_u32 %x) { {                    arg_u32 %x; call &f()(%x); arg_u32 %y;  } }; ]]
[[ function &f()(arg_u32 %x) { { @lab1:             arg_u32 %x; call &f()(%x);              } }; ]]
[[ function &f()(arg_u32 %x) { { neg_s64 $d1, $d2;  arg_u32 %x; call &f()(%x);              } }; ]]


/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// ARGUMENT SCOPE

// argscope.syntax

{{ arg_u32 %x;}}                                                    // Argument scope cannot be nested.
{}                                                                  // Argument scope cannot be empty.
{{}                                                                 // Invalid argument scope.
{}}                                                                 // Invalid argument scope.

// argscope.missing

[[ function &x()() { call &x()(); }; ]]                             // Calls must be in arg scope
[[ function &x()() { arg_u32 %x;  }; ]]                             // Arg vars must be defined in arg scope

// argscope.calls

[[ function &x()() { { call	&x()(); call &x()(); } }; ]]            // Argument scope cannot include more than 1 call
[[ function &x()(arg_u32 %z) { { call &x () (%z); } }; ]]           // Calls may only refer arg vars defined in arg scope
[[ function &x(arg_u32 %z)() { { call &x (%z) (); } }; ]]           // Calls may only refer arg vars defined in arg scope

// argscope.ret

[[ function &x()() { { call &x()(); ret; } }; ]]                    // ret is not allowed in arg blocks

// argscope.visibility

[[ function &x()(arg_u32 %z) { { arg_u32 %x; call &x()(%x); } st_arg_u32 0, [%x]; }; ]]  // arg vars are live till the end of arg scope
[[ function &x()() { { private_u32 %x; call &x()(); } }; ]]                              // arg scope cannot include non-arg variables
[[ function &x()() { { spill_u32 %x; call &x()(); } }; ]]                                // arg scope cannot include non-arg variables

// argscope.sbrscope: Variables defined inside an argument scope must be unique within the argument scope

[[ function &x()() { { arg_u32 %x; arg_u32 %x; call &x()(); } }; ]]

// argscope.branch

[[ function &x()() { @outside: barrier; { cbr_b1 $c0, @outside; call &x()(); }   }; ]]  // It is not valid to branch into or out of an argument scope.
[[ function &x()() { { @inside: barrier; call &x()(); } cbr_b1 $c0, @inside;     }; ]]  // It is not valid to branch into or out of an argument scope.
[[ function &x()() { { @inside: barrier; call &x()(); } { cbr_b1 $c0, @inside; call &x()(); } }; ]]  // It is not valid to branch into or out of an argument scope.


/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// VAR DEFS - NAME

// identifier.name.global: variables defined outside fn/kernel must start with '&'

[[ global_u32 %x;    ]] 
[[ global_u32 $s0;   ]] 
[[ global_u32 @lab;  ]] 
[[ global_u32 &&lab; ]] 
[[ global_u32 lab;   ]] 

// identifier.name.local: variables defined inside fn/kernel must start with '%'

[[ function &TestCalls()(arg_u32 &x){}; ]]
[[ kernel &Test(kernarg_u32 &x){}; ]]
global_u32 &x;
{ arg_u32 &x; }

// identifier.name.chars

[[ global_u32 &a:b; ]]
[[ global_u32 &^b;  ]]
[[ global_u32 &.a;  ]]

// identifier.name.special: Identifiers must not start with the characters __hsa.

///F FIXME: temporarily disabled [[ global_u32 &__hsa;  ]]
///F FIXME: temporarily disabled [[ global_u32 &__hsaxxx;  ]]
///F FIXME: temporarily disabled [[ function &__hsa()();  ]]
///F FIXME: temporarily disabled [[ function &__hsayyy()();  ]]
///F FIXME: temporarily disabled [[ function &f()(arg_u32 %__hsa);  ]]
///F FIXME: temporarily disabled [[ function &f()(arg_u32 %__hsazzz);  ]]

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// VAR DEFS - SEGMENT

// var.def.segment 

[[ kernarg_u32  &x; ]]
[[ arg_u32      &x; ]]
[[ spill_u32    &x; ]]

[[ function &Test()() { kernarg_u32 %x;         }; ]]
[[ function &Test()() { { kernarg_u32 %x; }     }; ]]
[[ function &Test()() { arg_u32     %x;         }; ]]

[[ kernel &Test() { kernarg_u32 %x;             }; ]]
[[ kernel &Test() { { kernarg_u32 %x; }         }; ]]
[[ kernel &Test() { arg_u32     %x;             }; ]]

// var.def.arg.segment

[[ function &fn()() { { global_u32 %x;   call &fn()(); } }; ]]
[[ function &fn()() { { group_u32 %x;    call &fn()(); } }; ]]
[[ function &fn()() { { private_u32 %x;  call &fn()(); } }; ]]
[[ function &fn()() { { spill_u32 %x;    call &fn()(); } }; ]]
[[ function &fn()() { { kernarg_u32 %x;  call &fn()(); } }; ]]
[[ function &fn()() { { readonly_u32 %x; call &fn()(); } }; ]]

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// VAR DEFS - ALIGNMENT

// var.def.align 

[[ align(1) global_u16 &x;              ]]
[[ align(1) global_s16 &x;              ]]
[[ align(1) global_b16 &x;              ]]
[[ align(1) global_f16 &x;              ]]
[[ align(1) global_u32 &x;              ]]
[[ align(1) global_s32 &x;              ]]
[[ align(1) global_b32 &x;              ]]
[[ align(1) global_f32 &x;              ]]
[[ align(1) global_u64 &x;              ]]
[[ align(1) global_s64 &x;              ]]
[[ align(1) global_b64 &x;              ]]
[[ align(1) global_f64 &x;              ]]
[[ align(1) global_b128 &x;             ]]
[[ align(1) global_u16x2 &x;            ]]
[[ align(1) global_u16x4 &x;            ]]
[[ align(1) global_u16x8 &x;            ]]

[[ align(2) global_u32 &x;              ]]
[[ align(2) global_s32 &x;              ]]
[[ align(2) global_b32 &x;              ]]
[[ align(2) global_f32 &x;              ]]
[[ align(2) global_u64 &x;              ]]
[[ align(2) global_s64 &x;              ]]
[[ align(2) global_b64 &x;              ]]
[[ align(2) global_f64 &x;              ]]
[[ align(2) global_b128 &x;             ]]
[[ align(2) global_u16x2 &x;            ]]
[[ align(2) global_u16x4 &x;            ]]
[[ align(2) global_u16x8 &x;            ]]

[[ align(4) global_u64 &x;              ]]
[[ align(4) global_s64 &x;              ]]
[[ align(4) global_b64 &x;              ]]
[[ align(4) global_f64 &x;              ]]
[[ align(4) global_b128 &x;             ]]
[[ align(4) global_s8x8 &x;             ]]
[[ align(4) global_s32x2 &x;            ]]
[[ align(4) global_s16x4 &x;            ]]
[[ align(4) global_u16x8 &x;            ]]

[[ align(8) global_b128 &x;             ]]
[[ align(8) global_s64x2 &x;            ]]
[[ align(8) global_u32x4 &x;            ]]
[[ align(8) global_s16x8 &x;            ]]

[[ align(1)  align(1)  global_s8  &x;    ]]
[[ align(2)  align(2)  global_s16 &x;    ]]
[[ align(4)  align(4)  global_s32 &x;    ]]
[[ align(8)  align(8)  global_s64 &x;    ]]
[[ align(16) align(16) global_s16x8 &x;  ]]

[[ extension "IMAGE"; align(1) global_samp &x;             ]]
[[ extension "IMAGE"; align(1) global_rwimg &x;            ]]
[[ extension "IMAGE"; align(1) global_roimg &x;            ]]
[[ extension "IMAGE"; align(2) global_samp &x;             ]]
[[ extension "IMAGE"; align(2) global_rwimg &x;            ]]
[[ extension "IMAGE"; align(2) global_roimg &x;            ]]
[[ extension "IMAGE"; align(4) global_samp &x;             ]]
[[ extension "IMAGE"; align(4) global_rwimg &x;            ]]
[[ extension "IMAGE"; align(4) global_roimg &x;            ]]

// var.def.align.invalid

[[ align(3   ) global_u8 &x;              ]]
[[ align(5   ) global_u8 &x;              ]]
[[ align(7   ) global_u8 &x;              ]]
[[ align(9   ) global_u8 &x;              ]]
[[ align(15  ) global_u8 &x;              ]]
[[ align(17  ) global_u8 &x;              ]]
[[ align(31  ) global_u8 &x;              ]]
[[ align(33  ) global_u8 &x;              ]]
[[ align(63  ) global_u8 &x;              ]]
[[ align(65  ) global_u8 &x;              ]]
[[ align(127 ) global_u8 &x;              ]]
[[ align(129 ) global_u8 &x;              ]]
[[ align(512 ) global_u8 &x;              ]]
[[ align(1024) global_u8 &x;              ]]

// var.def.align.old.syntax

[[ align 4     global_u8 &x;              ]]

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// VAR DEFS - ARRAY

// var.array

[[ global_u32 &x[-1];                  ]]
[[ global_u32 &x[0];                   ]]
[[ global_u32 &x[1.0];                 ]]
[[ global_u32 &x[.];                   ]]
[[ global_u32 &x[.1];                  ]]
[[ global_u32 &x[1]                    ]]

// var.array.max.dim

global_s16 %x[0x8000000000000000];
global_s32 %x[0x4000000000000000];

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// VAR DEFS - ARRAY INITIALIZATION

// var.array.init

[[ global_u32 &x[3] = u32[](1, 2, 3, 4);    ]]
[[ global_u32 &x[1] =                  ]]
[[ global_u32 &x[1] =;                 ]]
[[ global_u32 &x[1] ==;                ]]
[[ global_u32 &x[1] = u32[]();         ]]
[[ global_u32 &x[1] = u32[](,);        ]]
[[ global_u32 &x[1] = 1;               ]]
[[ global_u32 &x[1] = u32[](1, 2);     ]]
[[ global_u32 &x[3] = u32[](1, 2);     ]]

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// VAR DEFS - INITIALIZATION

// var.init.syntax

[[ global_u32 &x = "";          ]]
[[ global_u32 &x = ();          ]]
[[ global_u32 &x = (1);         ]]

// var.init.segment: only variables in global and readonly segments may be initialized

[[ group_u32 &x = 1;    ]]
[[ private_u32 &x = 1;  ]]

const spill_u32 %x = 1;
{ const arg_u32 %x = 1; }
const group_u32 %x = 1;

// signal.init

[[ global_sig64 &x    = 1;                  ]]
[[ global_sig64 &x    = -1;                 ]]
[[ global_sig64 &x    = 0.0h;               ]]
[[ global_sig64 &x    = 0.0f;               ]]
[[ global_sig64 &x    = -0.0;               ]]
[[ global_sig64 &x    = u8x4(0,0,0,0);      ]]
[[ global_sig64 &x    = "";                 ]]
[[ global_sig64 &x    = 0,0;                ]]
[[ global_sig64 &x    = sig64[](sig64(0));  ]]
[[ global_sig64 &x    = 0xFFFFFFFF00000000; ]]

// signal.array.init

[[ global_sig64 &s1[2] = 0;            ]]
[[ global_sig64 &s1[2] = 0, 0x00;      ]]
[[ global_sig64 &s1[2] = sig64[] (sig64(0), sig64(1));       ]]
[[ global_sig64 &s2[1] = sig64[] (sig64(0), sig64(0x00));    ]]
[[ global_sig64 &s3[]  = sig64[] (sig64(0), sig64(0.0), sig64(0));  ]]
[[ global_sig64 &s1[2] = sig64[] (sig64(0));       ]]

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// VAR DEFS - CONST

// const.syntax

[[ const const global_u32      &x = 1;  ]]
[[ global_u32 const            &x = 1;  ]]
[[ const global_u32 global_u32 &x = 1;  ]]

/// const.init: Initializer required
///
/// According to new spec, initializer is optional
///
/// const global_u32 &x;    
/// const global_u32 &x[10];
/// const global_roimg &x;  
/// const global_samp &x;   
/// 
/// const readonly_u32 &x;    
/// const readonly_u32 &x[10];
/// const readonly_roimg &x;  
/// const readonly_samp &x;   
/// 
/// readonly_u32 &x;    
/// readonly_u32 &x[10];
/// readonly_roimg &x;  
/// readonly_samp &x;   

// const.segment: Only global and readonly segment variable definitions can be marked const

[[ const group_u32 &x;    ]]
[[ const private_u32 &x;  ]]

const spill_u32 %x;
const group_u32 %x;

{ const arg_u32 %x; }

// const.def: Definitions of const variables must have an initializer

[[ const global_u32 &x;    ]]
[[ const readonly_u32 &x;  ]]

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// VAR DEFS - DECL AND PROG

// prog.decl.syntax

[[ prog decl global_u32 &x;  ]]
[[ prog prog global_u32 &x;  ]]
[[ decl decl global_u32 &x;  ]]

// prog.decl.local: prog/decl cannot be used in code blocks

prog global_s32 %k;
decl global_s32 %k;

// prog.decl.conflict

[[ decl global_u32 &x; prog global_u32 &x; ]]
[[ prog global_u32 &x; decl global_u32 &x; ]]

// decl.definition: _definition_ cannot be decl 

[[ decl global_u32 &global_var = 1;               ]]
[[ decl group_u32  &global_array[] = u32[](1,2,3);  ]]
[[ decl global_u32 &global_array[3] = u32[](1,2,3); ]]

[[ extension "IMAGE"; decl alloc(agent) global_roimg &ro_img1 = roimg(geometry = 1d,  width = 5, channel_type = unorm_int_101010, channel_order = rgbx);     ]]
[[ extension "IMAGE"; decl alloc(agent) global_samp &y1 = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_edge); ]]

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// VAR DEFS - MISC

// kernarg.flex.array: Flexible arrays are only allowed with functions

[[ kernel &Test(kernarg_u32 %in_arg0[]) {}; ]] 


// var.type: b1 is not a valid type for variables

[[ global_b1 &x;    ]]

// var.def: variable must be defined if it is used

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// VAR DECL

// var.decl: variable must be defined if it is used

[[ decl global_s32 &x;   ]] lda_global_u64   $d4, [&x];
[[ decl global_s32 &x;   ]] ld_global_s32    $s1, [&x];
[[ decl global_s32 &x;   ]] st_global_s32    $s1, [&x];
[[ decl global_s32 &x;   ]] atomic_and_global_scar_system_b32    $s1, [&x], 23;
[[ decl global_s32 &x;   ]] atomicnoret_and_global_scar_system_b32   [&x], 23;
[[ decl global_s32 &x;   ]] pragma &x;

// var.decl.def.mismatch: Incompatible decl and def arguments

[[ decl global_s32 &x;        global_u32 &x; ]]
[[ decl global_s32 &x;        global_s16 &x; ]]
[[ decl global_s32 &x;   decl global_u32 &x; ]]
[[ decl global_s32 &x;   decl global_s16 &x; ]]

[[ decl prog global_s32 &x;   global_s32 &x; ]]
[[ decl prog global_s32 &x;   decl global_s32 &x; ]]
[[ global_s32 &x;             decl prog global_s32 &x;   ]]
[[ decl global_s32 &x;        decl prog global_s32 &x;   ]]

[[ decl alloc(agent) global_s32 &x;   global_s32 &x;                   ]]
[[ global_s32 &x;                     decl alloc(agent) global_s32 &x; ]]

[[ decl align(8) global_s32 &x;             global_s32 &x;  ]]
[[ decl align(8) global_s32 &x;   align(16) global_s32 &x;  ]]

[[ decl const global_s32 &x;                global_s32 &x = 0;  ]]
[[ decl       global_s32 &x;          const global_s32 &x = 0;  ]]
[[ const      global_s32 &x = 0;      decl  global_s32 &x;      ]]

[[ decl global_s32 &x;                      group_s32 &x;  ]]

// var.qualifiers

[[ prog decl             global_s32 &x;   ]]
[[ alloc(agent) decl     global_s32 &x;   ]]
[[ alloc(agent) prog     global_s32 &x;   ]]
[[ align(8) decl         global_s32 &x;   ]]
[[ align(8) prog         global_s32 &x;   ]]
[[ align(8) alloc(agent) global_s32 &x;   ]]
[[ const decl            global_s32 &x;   ]]
[[ const prog            global_s32 &x;   ]]
[[ const alloc(agent)    global_s32 &x;   ]]
[[ const align(8)        global_s32 &x;   ]]
[[ prog prog             global_s32 &x;   ]]
[[ decl decl             global_s32 &x;   ]]
[[ alloc(agent) alloc(agent) global_s32 &x;   ]]
[[ align(8) align(8)     global_s32 &x;   ]]
[[ const const           global_s32 &x;   ]]

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// TYPED CONSTANTS

// typed.const.old.syntax

[[ global_u8x8  &b7 = _u8x8(-1, -1, -1, -1, -1, -1, -1, -1); ]]
[[ global_f16x4 &b8 = _f16x4(0.0h, 0.1h, 0.2h, 0.3h);        ]]

[[ extension "IMAGE"; alloc(agent) global_rwimg &opq1 = _rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &opq2 = _samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border);                                    ]]
[[ extension "IMAGE";              global_sig64 &opq3 = _sig64(-0);                                                                                                     ]]


// typed.const.bit

[[ global_b8   &x = b8(0);    ]]
[[ global_b16  &x = b16(0);   ]]
[[ global_b32  &x = b32(0);   ]]
[[ global_b64  &x = b64(0);   ]]
[[ global_b128 &x = b128(0);  ]]

// typed.const.empty

[[ global_s8   &x = s8();     ]]
[[ global_u16  &x = u16();    ]]
[[ global_s16  &x = s16();    ]]
[[ global_f16  &x = f16();    ]]
[[ global_s32  &x = s32();    ]]
[[ global_u32  &x = u32();    ]]
[[ global_f32  &x = f32();    ]]
[[ global_s64  &x = s64();    ]]
[[ global_u64  &x = u64();    ]]
[[ global_f64  &x = f64();    ]]

// typed.const.missing.brackets

[[ global_s8   &x = s8;       ]]
[[ global_u16  &x = u16(;     ]]
[[ global_s16  &x = s16(;     ]]
[[ global_f16  &x = f16(;     ]]
[[ global_s32  &x = s32(;     ]]
[[ global_u32  &x = u32(;     ]]
[[ global_f32  &x = f32);     ]]
[[ global_s64  &x = s64);     ]]
[[ global_u64  &x = u64);     ]]
[[ global_f64  &x = f64);     ]]

// typed.const.int.invalid.arg

[[ global_u8   &x = u8(u8(-0x3000)); ]]
[[ global_s8   &x = s8(s8(+0x100));  ]]
[[ global_u16  &x = u16(u16(+010));  ]]
[[ global_s16  &x = s16(s16(-020));  ]]
[[ global_s32  &x = s32(s32(0123));  ]]
[[ global_u32  &x = u32(u32(0x1));   ]]
[[ global_s64  &x = s64(s64(+123));  ]]
[[ global_u64  &x = u64(u64(-123));  ]]

[[ global_s16  &x = s16(f16(0.0h));  ]]
[[ global_u32  &x = u32(f32(1.0f));  ]]
[[ global_s64  &x = s64(f64(1.0));   ]]

[[ global_u8   &x = u8(1.0h);        ]]
[[ global_s8   &x = s8(1.0h);        ]]
[[ global_u16  &x = u16(1.0h);       ]]
[[ global_s16  &x = s16(1.0h);       ]]
[[ global_s32  &x = s32(1.0f);       ]]
[[ global_u32  &x = u32(1.0f);       ]]
[[ global_s64  &x = s64(1.0);        ]]
[[ global_u64  &x = u64(1.0);        ]]

[[ global_u64  &x = u64(sig64(0));                       ]]
[[ global_u64  &x = u64(f16x4(0.0h, 0.1h, 0.2h, 0.3h));  ]]
[[ global_u64  &x = u64(u16x4(0, 0, 0, 0));              ]]

[[ global_u64  &x = u64(woimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx));  ]]
[[ global_u64  &x = u64(samp(coord = normalized, filter = nearest, addressing = clamp_to_edge));                                         ]]

[[ global_u64  &x = u64(u8[](0,0,0,0,0,0,0,0)); ]]
[[ global_u64  &x = u64({u64(0)});              ]]

// typed.const.float.invalid.arg

[[ global_f16  &x = f16(f16(0.0h)); ]]
[[ global_f32  &x = f32(f32(1.0f)); ]] 
[[ global_f64  &x = f64(f64(1.0)); ]] 

[[ global_f16  &x = f16(s16(0)); ]] 
[[ global_f32  &x = f32(s32(0)); ]] 
[[ global_f64  &x = f64(s64(0)); ]] 

[[ global_f16  &x = f16(0); ]] 
[[ global_f32  &x = f32(0); ]] 
[[ global_f64  &x = f64(0); ]] 

[[ global_f16  &x = f16(0.0); ]] 
[[ global_f16  &x = f16(0.0f); ]] 
[[ global_f32  &x = f32(0.0h); ]] 
[[ global_f32  &x = f32(0.0); ]] 
[[ global_f64  &x = f64(0.0h); ]] 
[[ global_f64  &x = f64(0.0f); ]] 

[[ global_f64  &x = f64(sig64(0)); ]] 
[[ global_f64  &x = f64(f16x4(0.0h, 0.1h, 0.2h, 0.3h)); ]] 
[[ global_f64  &x = f64(u16x4(0, 0, 0, 0)); ]] 

[[ global_f64  &x = f64(woimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx)); ]]
[[ global_f64  &x = f64(samp(coord = normalized, filter = nearest, addressing = clamp_to_edge)); ]]

[[ global_f64  &x = f64(f16[](0.0h, 0.1h, 0.2h, 0.3h)); ]] 
[[ global_f64  &x = f64({f64(0.0)}); ]] 

// typed.const.packed.invalid.arg

[[ global_u16x2   &x = u16x2(u16(0), 1); ]] 
[[ global_u16x2   &x = u16x2(u16[](0), 1); ]] 
[[ global_u64x2   &x = u64x2(sig64(0), 1); ]] 

[[ global_u16x2   &x = u16x2(u16[](0,1)); ]] 

[[ global_f16x2   &x = f16x2(0.0h,   f16(1.0h)); ]] 
[[ global_f16x2   &x = f16x2(0.0h,   f16[](1.0h)); ]] 

// typed.const.sig.invalid.arg

[[ global_sig64 &x = sig64(0.0h); ]]
[[ global_sig64 &x = sig64(0.0f); ]]
[[ global_sig64 &x = sig64(0.0); ]]

[[ global_sig64 &x = sig64(u8(0)); ]]
[[ global_sig64 &x = sig64(u16(0)); ]]
[[ global_sig64 &x = sig64(u32(0)); ]]
[[ global_sig64 &x = sig64(u64(0)); ]]
[[ global_sig64 &x = sig64(f64(0.0)); ]]

[[ global_sig64 &x = sig64(u32x2(0,0)); ]]
[[ global_sig64 &x = sig64(sig64(0)); ]]
[[ global_sig64 &x = sig64(sig64[](0)); ]]
[[ global_sig64 &x = sig64({sig64(0)}); ]]

[[ global_sig64 &x = sig64(woimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx)); ]]
[[ global_sig64 &x = sig64(samp(coord = normalized, filter = nearest, addressing = clamp_to_edge)); ]]

// typed.const.arr.syntax

[[ global_u16  &x[4] = u16[4](1, 2, 3, 4); ]]
[[ global_u16  &x[]  = u16[(1, 2, 3, 4, -1, u16(0), u16(-1)); ]] 
[[ global_s16  &x[]  = s16](1, 2, 3, 4, -1, s16(0), s16(-1)); ]] 
[[ global_f16  &x[]  = f16[]1.2h, 3.0h, f16(0.0h)); ]] 

[[ global_s32  &x[] = s32[]; ]] 
[[ global_u32  &x[] = u32[](); ]] 
[[ global_f32  &x[] = f32[]{-1.0f, f32(1.0f)}; ]] 

[[ global_f32  &x[] = f32[](-1.0f,          ); ]] 
[[ global_f32  &x[] = f32[](     , f32(1.0f)); ]] 
[[ global_f32  &x[] = f32[](f32[]); ]] 

// typed.const.int.arr.invalid.arg

[[ global_u32 &x[] = u32[](0, 0.0f); ]] 
[[ global_u32 &x[] = u32[](0, f32(0.0f)); ]] 
[[ global_u32 &x[] = u32[](0, -u32(0)); ]] 

[[ global_u8  &x[] = u8[] (0, s8 (0)); ]] 
[[ global_u16 &x[] = u16[](0, s16(0)); ]] 
[[ global_u32 &x[] = u32[](0, s32(0)); ]] 
[[ global_u64 &x[] = u64[](0, s64(0)); ]] 

[[ global_u64 &x[] = u64[](0, +u64(0)); ]] 
[[ global_u64 &x[] = u64[](0, -u64(0)); ]] 

[[ global_s8  &x[] = s8[] (0, u8 (0)); ]] 
[[ global_s16 &x[] = s16[](0, u16(0)); ]] 
[[ global_s32 &x[] = s32[](0, u32(0)); ]] 
[[ global_s64 &x[] = s64[](0, u64(0)); ]] 

[[ global_s64 &x[] = s64[](0, +s64(0)); ]] 
[[ global_s64 &x[] = s64[](0, -s64(0)); ]] 

[[ global_u32 &x[] = u32[](0, s8(0)); ]] 
[[ global_u32 &x[] = u32[](0, u8(0)); ]] 
[[ global_u32 &x[] = u32[](0, s16(0)); ]] 
[[ global_u32 &x[] = u32[](0, u16(0)); ]] 
[[ global_u32 &x[] = u32[](0, u64(0)); ]] 
[[ global_u32 &x[] = u32[](0, s64(0)); ]] 

[[ global_u16 &x[] = u16[](0, f16(0.0h)); ]] 
[[ global_u32 &x[] = u32[](0, f32(0.0f)); ]] 
[[ global_u64 &x[] = u64[](0, f64(0.0)); ]] 

[[ global_u64  &x[] = u64[](0, sig64(0)); ]] 
[[ global_u64  &x[] = u64[](0, f16x4(0.0h, 0.1h, 0.2h, 0.3h)); ]] 
[[ global_u64  &x[] = u64[](0, u16x4(0, 0, 0, 0)); ]] 

[[ extension "IMAGE"; global_u64  &x[] = u64[](0, woimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx)); ]]
[[ extension "IMAGE"; global_u64  &x[] = u64[](0, samp(coord = normalized, filter = nearest, addressing = clamp_to_edge)); ]]

[[ global_u64  &x[] = u64[](0, u8[](0,0,0,0,0,0,0,0)); ]]
[[ global_u64  &x[] = u64[](0, {u64(0)}); ]]

// typed.const.float.arr.invalid.arg

[[ global_f32 &x[] = f32[](0.0f, 0); ]] 
[[ global_f32 &x[] = f32[](0.0f, u32(0)); ]] 

[[ global_f32 &x[] = f32[](0.0f, +f32(0.0f)); ]] 
[[ global_f32 &x[] = f32[](0.0f, -f32(0.0f)); ]] 

[[ global_f16 &x[] = f16[](0.0h, s16(0)); ]] 
[[ global_f32 &x[] = f32[](0.0f, s32(0)); ]] 
[[ global_f64 &x[] = f64[](0.0,  s64(0)); ]] 

[[ global_f16 &x[] = f16[](0.0h, u16(0)); ]] 
[[ global_f32 &x[] = f32[](0.0f, u32(0)); ]] 
[[ global_f64 &x[] = f64[](0.0,  u64(0)); ]] 

[[ global_f16 &x[] = f16[](0.0h, f64(0.0)); ]] 
[[ global_f32 &x[] = f32[](0.0f, f16(0.0h)); ]] 
[[ global_f64 &x[] = f64[](0.0,  f32(0.0f)); ]] 

[[ global_f64  &x[] = f64[](0.0, sig64(0)); ]] 
[[ global_f64  &x[] = f64[](0.0, f16x4(0.0h, 0.1h, 0.2h, 0.3h)); ]] 
[[ global_f64  &x[] = f64[](0.0, u16x4(0, 0, 0, 0)); ]] 

[[ extension "IMAGE"; global_f64  &x[] = f64[](0.0, woimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx)); ]]
[[ extension "IMAGE"; global_f64  &x[] = f64[](0.0, samp(coord = normalized, filter = nearest, addressing = clamp_to_edge)); ]]

[[ global_f64  &x[] = f64[](0.0, f32[](0.0f,0.0f)); ]]
[[ global_f64  &x[] = f64[](0.0, {f64(0)}); ]]

// typed.const.packed.arr.invalid.arg

[[ global_f32x2 &x[] = f32x2[](0); ]] 
[[ global_f32x2 &x[] = f32x2[](0.0); ]] 
[[ global_f32x2 &x[] = f32x2[](u64(0)); ]] 
[[ global_f32x2 &x[] = f32x2[](u32(0)); ]] 

[[ global_f16x2 &x[] = f16x2[](u16(0)); ]] 
[[ global_f32x2 &x[] = f32x2[](u32(0)); ]] 
[[ global_f64x2 &x[] = f64x2[](u64(0)); ]] 

[[ global_f16x2 &x[] = f16x2[](f16(0.0h)); ]] 
[[ global_f32x2 &x[] = f32x2[](f32(0.0f)); ]] 
[[ global_f64x2 &x[] = f64x2[](f64(0.0)); ]] 

[[ global_f16x2 &x[] = f16x2[](s16x2(0,0)); ]] 
[[ global_f32x2 &x[] = f32x2[](s32x2(0,0)); ]] 
[[ global_f64x2 &x[] = f64x2[](s64x2(0,0)); ]] 

[[ global_f16x2 &x[] = f16x2[](u16x2(0,0)); ]] 
[[ global_f32x2 &x[] = f32x2[](u32x2(0,0)); ]] 
[[ global_f64x2 &x[] = f64x2[](u64x2(0,0)); ]] 

[[ global_f32x2 &x[] = f32x2[](u32x2(0,0)); ]] 

[[ global_f16x2 &x[] = f16x2[](f64x2(0.0 ,0.0 )); ]] 
[[ global_f32x2 &x[] = f32x2[](f16x2(0.0h,0.0h)); ]] 
[[ global_f64x2 &x[] = f64x2[](f32x2(0.0f,0.0f)); ]] 

[[ global_f64x2 &x[] = f64x2[](sig64(0)); ]] 
[[ global_f64x2 &x[] = f64x2[](f32x4(0.0f, 0.1f, 0.2f, 0.3f)); ]] 
[[ global_f64x2 &x[] = f64x2[](u32x4(0, 0, 0, 0)); ]] 

[[ extension "IMAGE"; global_f64x2 &x[] = f64x2[](woimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx)); ]]
[[ extension "IMAGE"; global_f64x2 &x[] = f64x2[](samp(coord = normalized, filter = nearest, addressing = clamp_to_edge)); ]]

[[ global_f64x2 &x[] = f64x2[](f32[](0.0f,0.0f)); ]]
[[ global_f64x2 &x[] = f64x2[]({f64(0.0)}); ]]

[[ global_u32x2 &x[] = u32x2[](0); ]] 
[[ global_u32x2 &x[] = u32x2[](0.0); ]] 

[[ global_u16x2 &x[] = u16x2[](u16(0)); ]] 
[[ global_u32x2 &x[] = u32x2[](u32(0)); ]] 
[[ global_u64x2 &x[] = u64x2[](u64(0)); ]] 

[[ global_u16x2 &x[] = u16x2[](f16(0.0h)); ]] 
[[ global_u32x2 &x[] = u32x2[](f32(0.0f)); ]] 
[[ global_u64x2 &x[] = u64x2[](f64(0.0)); ]] 

[[ global_u16x2 &x[] = u16x2[](f16x2(0.0f,0.0f)); ]] 
[[ global_u32x2 &x[] = u32x2[](f32x2(0.0f,0.0f)); ]] 
[[ global_u64x2 &x[] = u64x2[](f64x2(0.0f,0.0f)); ]] 

[[ global_u16x2 &x[] = u16x2[](s16x2(0,0)); ]] 
[[ global_u32x2 &x[] = u32x2[](s32x2(0,0)); ]] 
[[ global_u64x2 &x[] = u64x2[](s64x2(0,0)); ]] 

[[ global_s16x2 &x[] = s16x2[](u16x2(0,0)); ]] 
[[ global_s32x2 &x[] = s32x2[](u32x2(0,0)); ]] 
[[ global_s64x2 &x[] = s64x2[](u64x2(0,0)); ]] 

[[ global_u64x2 &x[] = u64x2[](sig64(0)); ]] 
[[ global_u64x2 &x[] = u64x2[](u32x4(0,0,0,0)); ]] 
[[ global_u64x2 &x[] = u64x2[](f32x4(0.0f, 0.1f, 0.2f, 0.3f)); ]] 

[[ extension "IMAGE"; global_u64x2 &x[] = u64x2[](woimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx)); ]]
[[ extension "IMAGE"; global_u64x2 &x[] = u64x2[](samp(coord = normalized, uilter = nearest, addressing = clamp_to_edge)); ]]

[[ global_u64x2 &x[] = u64x2[](u32[](0,0)); ]]
[[ global_u64x2 &x[] = u64x2[]({u64(0)}); ]]

// typed.const.img.arr.invalid.arg

[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = rwimg[]( rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx), roimg(geometry = 2d, width = 5, height = 4, channel_type = unorm_short_555, channel_order = rgb) ); ]]
[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = rwimg[]( rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx), woimg(geometry = 2d, width = 5, height = 4, channel_type = unorm_short_555, channel_order = rgb) ); ]]

[[ extension "IMAGE"; alloc(agent) global_roimg &x[] = roimg[]( roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx), rwimg(geometry = 2d, width = 5, height = 4, channel_type = unorm_short_555, channel_order = rgb) ); ]]
[[ extension "IMAGE"; alloc(agent) global_roimg &x[] = roimg[]( roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx), woimg(geometry = 2d, width = 5, height = 4, channel_type = unorm_short_555, channel_order = rgb) ); ]]

[[ extension "IMAGE"; alloc(agent) global_woimg &x[] = woimg[]( woimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx), roimg(geometry = 2d, width = 5, height = 4, channel_type = unorm_short_555, channel_order = rgb) ); ]]
[[ extension "IMAGE"; alloc(agent) global_woimg &x[] = woimg[]( woimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx), rwimg(geometry = 2d, width = 5, height = 4, channel_type = unorm_short_555, channel_order = rgb) ); ]]

[[ extension "IMAGE"; alloc(agent) global_woimg &x[] = woimg[]( samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border), samp(coord = normalized, filter = linear, addressing = mirrored_repeat)); ]]

[[ extension "IMAGE"; alloc(agent) global_woimg &x[] = woimg[]( sig64(0) ); ]]
[[ extension "IMAGE"; alloc(agent) global_woimg &x[] = woimg[](0); ]] 
[[ extension "IMAGE"; alloc(agent) global_woimg &x[] = woimg[](0.0); ]] 
[[ extension "IMAGE"; alloc(agent) global_woimg &x[] = woimg[](u16(0)); ]] 
[[ extension "IMAGE"; alloc(agent) global_woimg &x[] = woimg[](u32(0)); ]] 
[[ extension "IMAGE"; alloc(agent) global_woimg &x[] = woimg[](u64(0)); ]] 
[[ extension "IMAGE"; alloc(agent) global_woimg &x[] = woimg[](f16(0.0h)); ]] 
[[ extension "IMAGE"; alloc(agent) global_woimg &x[] = woimg[](f32(0.0f)); ]] 
[[ extension "IMAGE"; alloc(agent) global_woimg &x[] = woimg[](f64(0.0)); ]] 
[[ extension "IMAGE"; alloc(agent) global_woimg &x[] = woimg[](f16x2(0.0f,0.0f)); ]] 
[[ extension "IMAGE"; alloc(agent) global_woimg &x[] = woimg[](f32x2(0.0f,0.0f)); ]] 
[[ extension "IMAGE"; alloc(agent) global_woimg &x[] = woimg[](f64x2(0.0f,0.0f)); ]] 
[[ extension "IMAGE"; alloc(agent) global_woimg &x[] = woimg[](s16x2(0,0)); ]] 
[[ extension "IMAGE"; alloc(agent) global_woimg &x[] = woimg[](s32x2(0,0)); ]] 
[[ extension "IMAGE"; alloc(agent) global_woimg &x[] = woimg[](s64x2(0,0)); ]] 
[[ extension "IMAGE"; alloc(agent) global_woimg &x[] = woimg[](u16x2(0,0)); ]] 
[[ extension "IMAGE"; alloc(agent) global_woimg &x[] = woimg[](u32x2(0,0)); ]] 
[[ extension "IMAGE"; alloc(agent) global_woimg &x[] = woimg[](u64x2(0,0)); ]] 
[[ extension "IMAGE"; alloc(agent) global_woimg &x[] = woimg[](sig64(0)); ]] 
[[ extension "IMAGE"; alloc(agent) global_woimg &x[] = woimg[](u32x4(0,0,0,0)); ]] 
[[ extension "IMAGE"; alloc(agent) global_woimg &x[] = woimg[](f32x4(0.0f, 0.1f, 0.2f, 0.3f)); ]] 
[[ extension "IMAGE"; alloc(agent) global_woimg &x[] = woimg[](u32[](0,0)); ]]
[[ extension "IMAGE"; alloc(agent) global_woimg &x[] = woimg[]({u64(0)}); ]]

// typed.const.samp.arr.invalid.arg

[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = samp[]( rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx) ); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = samp[]( sig64(0) ); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = samp[](0); ]] 
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = samp[](0.0); ]] 
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = samp[](u16(0)); ]] 
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = samp[](u32(0)); ]] 
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = samp[](u64(0)); ]] 
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = samp[](f16(0.0h)); ]] 
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = samp[](f32(0.0f)); ]] 
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = samp[](f64(0.0)); ]] 
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = samp[](f16x2(0.0f,0.0f)); ]] 
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = samp[](f32x2(0.0f,0.0f)); ]] 
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = samp[](f64x2(0.0f,0.0f)); ]] 
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = samp[](s16x2(0,0)); ]] 
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = samp[](s32x2(0,0)); ]] 
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = samp[](s64x2(0,0)); ]] 
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = samp[](u16x2(0,0)); ]] 
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = samp[](u32x2(0,0)); ]] 
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = samp[](u64x2(0,0)); ]] 
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = samp[](sig64(0)); ]] 
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = samp[](u32x4(0,0,0,0)); ]] 
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = samp[](f32x4(0.0f, 0.1f, 0.2f, 0.3f)); ]] 
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = samp[](u32[](0,0)); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = samp[]({u64(0)}); ]]


// typed.const.signal.arr.invalid.arg

[[ extension "IMAGE"; global_sig64  &x[] = sig64[]( rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx) ); ]]
[[ extension "IMAGE"; global_sig64  &x[] = sig64[]( samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border), samp(coord = normalized, filter = linear, addressing = mirrored_repeat)); ]]
[[ global_sig64  &x[] = sig64[](0); ]] 
[[ global_sig64  &x[] = sig64[](0.0); ]] 
[[ global_sig64  &x[] = sig64[](u16(0)); ]] 
[[ global_sig64  &x[] = sig64[](u32(0)); ]] 
[[ global_sig64  &x[] = sig64[](u64(0)); ]] 
[[ global_sig64  &x[] = sig64[](f16(0.0h)); ]] 
[[ global_sig64  &x[] = sig64[](f32(0.0f)); ]] 
[[ global_sig64  &x[] = sig64[](f64(0.0)); ]] 
[[ global_sig64  &x[] = sig64[](f16x2(0.0f,0.0f)); ]] 
[[ global_sig64  &x[] = sig64[](f32x2(0.0f,0.0f)); ]] 
[[ global_sig64  &x[] = sig64[](f64x2(0.0f,0.0f)); ]] 
[[ global_sig64  &x[] = sig64[](s16x2(0,0)); ]] 
[[ global_sig64  &x[] = sig64[](s32x2(0,0)); ]] 
[[ global_sig64  &x[] = sig64[](s64x2(0,0)); ]] 
[[ global_sig64  &x[] = sig64[](u16x2(0,0)); ]] 
[[ global_sig64  &x[] = sig64[](u32x2(0,0)); ]] 
[[ global_sig64  &x[] = sig64[](u64x2(0,0)); ]] 
[[ global_sig64  &x[] = sig64[](sig32(0)); ]] 
[[ global_sig64  &x[] = sig64[](u32x4(0,0,0,0)); ]] 
[[ global_sig64  &x[] = sig64[](f32x4(0.0f, 0.1f, 0.2f, 0.3f)); ]] 
[[ global_sig64  &x[] = sig64[](u32[](0,0)); ]]
[[ global_sig64  &x[] = sig64[]({u64(0)}); ]]

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// AGGREGATES

// aggregate.const.syntax

[[ global_b8 &x[] = { u8(-1), f16(-1.0h), s32(1), f64(-1.0), -s8(0) }; ]] 
[[ global_b8 &x[] = { u8(-1), f16(-1.0h), s32(1), f64(-1.0), +s8(0) }; ]] 

[[ global_b8 &x[] = { u8(-1), f16(-1.0h), s32(1), f64(-1.0), s8(0), }; ]] 
[[ global_b8 &x[] = { , u8(-1), f16(-1.0h), s32(1), f64(-1.0), s8(0) }; ]] 
[[ global_b8 &x[] = { u8(-1), f16(-1.0h), s32(1), f64(-1.0)  s8(0) }; ]] 
[[ global_b8 &x[] = { u8(-1), f16(-1.0h), s32(1), f64(-1.0), s8(0) ; ]] 
[[ global_b8 &x[] =   u8(-1), f16(-1.0h), s32(1), f64(-1.0), s8(0) }; ]] 
[[ global_b8 &x[] =   u8(-1), f16(-1.0h), s32(1), f64(-1.0), s8(0) ; ]] 

// aggregate.const.align.syntax

[[ global_b8 &x[] = { u8(-1), align    }; ]] 
[[ global_b8 &x[] = { u8(-1), align()  }; ]] 
[[ global_b8 &x[] = { u8(-1), align(8  }; ]] 
[[ global_b8 &x[] = { u8(-1), align 8) }; ]] 
[[ global_b8 &x[] = { u8(-1), align 8  }; ]] 
[[ global_b8 &x[] = { u8(-1), align[8] }; ]] 
[[ global_b8 &x[] = { u8(-1), align[] }; ]] 

// aggregate.const.align.arg

[[ global_b8 &x[] = { u8(-1), align(4.0)   }; ]] 
[[ global_b8 &x[] = { u8(-1), align(u8(4))   }; ]] 
[[ global_b8 &x[] = { u8(-1), align(s16(4))   }; ]] 
[[ global_b8 &x[] = { u8(-1), align(u64(4))   }; ]] 
[[ global_b8 &x[] = { u8(-1), align(u32x2(0, 4))   }; ]] 
[[ global_b8 &x[] = { u8(-1), align(u64[](4)   }; ]] 

// aggregate.const.align.value

[[ global_b8 &x[] = { u8(-1), align(0)   }; ]] 
[[ global_b8 &x[] = { u8(-1), align(3)   }; ]] 
[[ global_b8 &x[] = { u8(-1), align(512) }; ]] 
[[ global_b8 &x[] = { u8(-1), align(-4)  }; ]] 
[[ global_b8 &x[] = { u8(-1), align(+4)  }; ]] 
[[ global_b8 &x[] = { u8(-1), align(0xFFFFFFFF00000004)  }; ]] 

// aggregate.const.border.cases

[[ global_b8 &x[] = { }; ]] 
[[ global_b8 &x[] = { align(8) }; ]] 
[[ global_b8 &x[] = { align(8), align(16) }; ]] 

// aggregate.const.invalid.arg

[[ global_b8 &x[] = { s8(1), 1,   u8(3) }; ]] 
[[ global_b8 &x[] = { s8(1), 1.0, u8(3) }; ]] 
[[ global_b8 &x[] = { s8(1), $s0, u8(3) }; ]] 
[[ global_b8 &x[] = { s8(1), &x,  u8(3) }; ]] 
[[ global_b8 &x[] = { s8(1), %x,  u8(3) }; ]] 
[[ global_b8 &x[] = { s8(1), @lab,u8(3) }; ]] 
[[ global_b8 &x[] = { s8(1), "z", u8(3) }; ]] 

// aggregate.const.invalid.size

[[ global_b8 &x[1]    = { s8(0), s8(0) }; ]] 
[[ global_b8 &x[1]    = { s8(0), align(4) }; ]] 

[[ global_b128 &x[1]  = { s8(0) }; ]] 
[[ global_b128 &x[1]  = { u64(0), s32(0), s16(0), u8(0) }; ]] 
[[ global_b128 &x[1]  = { u64(0), s32(0), s32(0), u8(0) }; ]] 
[[ global_b128 &x[1]  = { u64(0), s64(0), align(32) }; ]] 
[[ global_b128 &x[1]  = { u64(0), align(16), u8(0) }; ]] 
[[ global_b128 &x[1]  = { u64(0), s32(0), u8(0), align(2) }; ]] 

[[ global_b128 &x[1]  = { u8[](0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14) }; ]] 
[[ global_b128 &x[1]  = { u8[](0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) }; ]] 
[[ global_b128 &x[1]  = { u8[](0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15), align(32) }; ]] 
[[ global_b128 &x[1]  = { u8[](0, 1, 2, 3, 4, 5, 6, 7), align(16), u8(0) }; ]] 
[[ global_b128 &x[1]  = { u8[](0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), align(2) }; ]] 

[[ global_b128 &x[1]  = { sig64(0), s32(0), s16(0), u8(0) }; ]] 
[[ global_b128 &x[1]  = { sig64[](sig64(0)), s32(0), s32(0), u8(0) }; ]] 

[[ extension "IMAGE"; global_b128 &x[1]  = { samp(coord = normalized, filter = nearest, addressing = clamp_to_edge), s32(0), s16(0), u8(0) }; ]] 
[[ extension "IMAGE"; global_b128 &x[1]  = { samp[](samp(coord = normalized, filter = nearest, addressing = clamp_to_edge)), s32(0), s32(0), u8(0) }; ]] 

[[ global_b128 &x[1]  = { s8(0),  align(8), align(4), f32(-1.0f) }; ]] 

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// CONSTANT CONVERSIONS

// conv1.int.to.bit.128

[[ global_b128 &x = 0; ]] 

// conv1.typed.int.to.bit

[[ global_b8 &x  = u16(0); ]] 
[[ global_b8 &x  = s32(0); ]] 
[[ global_b8 &x  = u64(0); ]] 

[[ global_b16 &x = u8(0); ]] 
[[ global_b16 &x = u32(0); ]] 
[[ global_b16 &x = u64(0); ]] 

[[ global_b32 &x = u8(0); ]] 
[[ global_b32 &x = u16(0); ]] 
[[ global_b32 &x = u64(0); ]] 

[[ global_b64 &x = u8(0); ]] 
[[ global_b64 &x = u16(0); ]] 
[[ global_b64 &x = u32(0); ]] 

[[ global_b128 &x = u8(0); ]] 
[[ global_b128 &x = u64(0); ]] 

// conv1.typed.int.to.int

[[ global_s8 &x  = u8(0); ]] 
[[ global_s8 &x  = s16(0); ]] 
[[ global_s8 &x  = s32(0); ]] 
[[ global_s8 &x  = s64(0); ]] 

[[ global_s16 &x = s8(0); ]] 
[[ global_s16 &x = u16(0); ]] 
[[ global_s16 &x = s32(0); ]] 
[[ global_s16 &x = s64(0); ]] 

[[ global_s32 &x = s8(0); ]] 
[[ global_s32 &x = s16(0); ]] 
[[ global_s32 &x = u32(0); ]] 
[[ global_s32 &x = s64(0); ]] 

[[ global_s64 &x = s8(0); ]] 
[[ global_s64 &x = s16(0); ]] 
[[ global_s64 &x = s32(0); ]] 
[[ global_s64 &x = u64(0); ]] 


[[ global_u8 &x  = s8(0); ]] 
[[ global_u8 &x  = u16(0); ]] 
[[ global_u8 &x  = u32(0); ]] 
[[ global_u8 &x  = u64(0); ]] 
       
[[ global_u16 &x = u8(0); ]] 
[[ global_u16 &x = s16(0); ]] 
[[ global_u16 &x = u32(0); ]] 
[[ global_u16 &x = u64(0); ]] 
       
[[ global_u32 &x = u8(0); ]] 
[[ global_u32 &x = u16(0); ]] 
[[ global_u32 &x = s32(0); ]] 
[[ global_u32 &x = u64(0); ]] 
       
[[ global_u64 &x = u8(0); ]] 
[[ global_u64 &x = u16(0); ]] 
[[ global_u64 &x = u32(0); ]] 
[[ global_u64 &x = s64(0); ]] 

// conv1.int.to.float

[[ global_f16 &x = 0; ]] 
[[ global_f32 &x = 0; ]] 
[[ global_f64 &x = 0; ]] 

[[ global_f16 &x = u16(0); ]] 
[[ global_f32 &x = u32(0); ]] 
[[ global_f64 &x = u64(0); ]] 

// conv1.int.to.packed

[[ global_u8x4  &x = 0; ]]
[[ global_s8x4  &x = 0; ]]
[[ global_u16x2 &x = 0; ]]
[[ global_s16x2 &x = 0; ]]
[[ global_u8x8  &x = 0; ]]
[[ global_s8x8  &x = 0; ]]
[[ global_u16x4 &x = 0; ]]
[[ global_s16x4 &x = 0; ]]
[[ global_u32x2 &x = 0; ]]
[[ global_s32x2 &x = 0; ]]
[[ global_u8x16 &x = 0; ]]
[[ global_s8x16 &x = 0; ]]
[[ global_u16x8 &x = 0; ]]
[[ global_s16x8 &x = 0; ]]
[[ global_u32x4 &x = 0; ]]
[[ global_s32x4 &x = 0; ]]
[[ global_u64x2 &x = 0; ]]
[[ global_s64x2 &x = 0; ]]
[[ global_f16x2 &x = 0; ]]
[[ global_f16x4 &x = 0; ]]
[[ global_f16x8 &x = 0; ]]
[[ global_f32x2 &x = 0; ]]
[[ global_f32x4 &x = 0; ]]
[[ global_f64x2 &x = 0; ]]

[[ global_u8x4  &x = u32(0); ]]
[[ global_s8x4  &x = u32(0); ]]
[[ global_u16x2 &x = u32(0); ]]
[[ global_s16x2 &x = u32(0); ]]
[[ global_u8x8  &x = u64(0); ]]
[[ global_s8x8  &x = u64(0); ]]
[[ global_u16x4 &x = u64(0); ]]
[[ global_s16x4 &x = u64(0); ]]
[[ global_u32x2 &x = u64(0); ]]
[[ global_s32x2 &x = u64(0); ]]
[[ global_u8x16 &x = u64(0); ]]
[[ global_s8x16 &x = u64(0); ]]
[[ global_u16x8 &x = u64(0); ]]
[[ global_s16x8 &x = u64(0); ]]
[[ global_u32x4 &x = u64(0); ]]
[[ global_s32x4 &x = u64(0); ]]
[[ global_u64x2 &x = u64(0); ]]
[[ global_s64x2 &x = u64(0); ]]
[[ global_f16x2 &x = u32(0); ]]
[[ global_f16x4 &x = u64(0); ]]
[[ global_f16x8 &x = u64(0); ]]
[[ global_f32x2 &x = u64(0); ]]
[[ global_f32x4 &x = u64(0); ]]
[[ global_f64x2 &x = u64(0); ]]

// conv1.int.to.opaque

[[ extension "IMAGE"; alloc(agent) global_rwimg &x = 0; ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x = 0; ]]

[[ extension "IMAGE"; alloc(agent) global_rwimg &x = u64(0); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x = u64(0); ]]

[[ global_sig64 &x = 0; ]]
[[ global_sig64 &x = u64(0); ]]

// conv1.int.to.array

[[ global_u8  &x[] = 0; ]] 
[[ global_u16 &x[] = 0; ]] 
[[ global_u32 &x[] = 0; ]] 
[[ global_u64 &x[] = 0; ]] 
[[ global_u8  &x[] = u8(0); ]] 
[[ global_u16 &x[] = u16(0); ]] 
[[ global_u32 &x[] = u32(0); ]] 
[[ global_u64 &x[] = u64(0); ]] 

[[ global_s8  &x[] = 0; ]] 
[[ global_s16 &x[] = 0; ]] 
[[ global_s32 &x[] = 0; ]] 
[[ global_s64 &x[] = 0; ]] 
[[ global_s8  &x[] = s8(0); ]] 
[[ global_s16 &x[] = s16(0); ]] 
[[ global_s32 &x[] = s32(0); ]] 
[[ global_s64 &x[] = s64(0); ]] 

[[ global_f16 &x[] = 0; ]] 
[[ global_f32 &x[] = 0; ]] 
[[ global_f64 &x[] = 0; ]] 
[[ global_f16 &x[] = s16(0); ]] 
[[ global_f32 &x[] = s32(0); ]] 
[[ global_f64 &x[] = s64(0); ]] 

[[ global_u8x4  &x[] = 0; ]]
[[ global_s8x4  &x[] = 0; ]]
[[ global_u16x2 &x[] = 0; ]]
[[ global_s16x2 &x[] = 0; ]]
[[ global_u8x8  &x[] = 0; ]]
[[ global_s8x8  &x[] = 0; ]]
[[ global_u16x4 &x[] = 0; ]]
[[ global_s16x4 &x[] = 0; ]]
[[ global_u32x2 &x[] = 0; ]]
[[ global_s32x2 &x[] = 0; ]]
[[ global_u8x16 &x[] = 0; ]]
[[ global_s8x16 &x[] = 0; ]]
[[ global_u16x8 &x[] = 0; ]]
[[ global_s16x8 &x[] = 0; ]]
[[ global_u32x4 &x[] = 0; ]]
[[ global_s32x4 &x[] = 0; ]]
[[ global_u64x2 &x[] = 0; ]]
[[ global_s64x2 &x[] = 0; ]]
[[ global_f16x2 &x[] = 0; ]]
[[ global_f16x4 &x[] = 0; ]]
[[ global_f16x8 &x[] = 0; ]]
[[ global_f32x2 &x[] = 0; ]]
[[ global_f32x4 &x[] = 0; ]]
[[ global_f64x2 &x[] = 0; ]]

[[ global_u8x4  &x[] = u32(0); ]]
[[ global_s8x4  &x[] = u32(0); ]]
[[ global_u16x2 &x[] = u32(0); ]]
[[ global_s16x2 &x[] = u32(0); ]]
[[ global_u8x8  &x[] = u64(0); ]]
[[ global_s8x8  &x[] = u64(0); ]]
[[ global_u16x4 &x[] = u64(0); ]]
[[ global_s16x4 &x[] = u64(0); ]]
[[ global_u32x2 &x[] = u64(0); ]]
[[ global_s32x2 &x[] = u64(0); ]]
[[ global_u8x16 &x[] = u64(0); ]]
[[ global_s8x16 &x[] = u64(0); ]]
[[ global_u16x8 &x[] = u64(0); ]]
[[ global_s16x8 &x[] = u64(0); ]]
[[ global_u32x4 &x[] = u64(0); ]]
[[ global_s32x4 &x[] = u64(0); ]]
[[ global_u64x2 &x[] = u64(0); ]]
[[ global_s64x2 &x[] = u64(0); ]]
[[ global_f16x2 &x[] = u32(0); ]]
[[ global_f16x4 &x[] = u64(0); ]]
[[ global_f16x8 &x[] = u64(0); ]]
[[ global_f32x2 &x[] = u64(0); ]]
[[ global_f32x4 &x[] = u64(0); ]]
[[ global_f64x2 &x[] = u64(0); ]]

[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = 0; ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = 0; ]]
[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = u64(0); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = u64(0); ]]

[[ global_sig64 &x[] = 0; ]]
[[ global_sig64 &x[] = u64(0); ]]

/////////////////////////////////////////////////////////////////////////////////////////////////////////

// conv1.float.to.bit.128

[[ global_b128 &x = 0.0; ]] 

// conv1.typed.float.to.bit

[[ global_b8 &x  = f16(0.0h); ]] 
[[ global_b8 &x  = f32(0.0f); ]] 
[[ global_b8 &x  = f64(0.0); ]] 

[[ global_b16 &x = f32(0.0f); ]] 
[[ global_b16 &x = f64(0.0); ]] 

[[ global_b32 &x = f16(0.0h); ]] 
[[ global_b32 &x = f64(0.0); ]] 

[[ global_b64 &x = f16(0.0h); ]] 
[[ global_b64 &x = f32(0.0f); ]] 

[[ global_b128 &x = f16(0.0h); ]] 
[[ global_b128 &x = f32(0.0f); ]] 
[[ global_b128 &x = f64(0.0); ]] 

// conv1.typed.float.to.int

[[ global_s8 &x  = f16(0.0h); ]] 
[[ global_s8 &x  = f32(0.0f); ]] 
[[ global_s8 &x  = f64(0.0); ]] 

[[ global_s16 &x = f16(0.0h); ]] 
[[ global_s16 &x = f32(0.0f); ]] 
[[ global_s16 &x = f64(0.0); ]] 

[[ global_s32 &x = f16(0.0h); ]] 
[[ global_s32 &x = f32(0.0f); ]] 
[[ global_s32 &x = f64(0.0); ]] 

[[ global_s64 &x = f16(0.0h); ]] 
[[ global_s64 &x = f32(0.0f); ]] 
[[ global_s64 &x = f64(0.0); ]] 

[[ global_u8 &x  = f16(0.0h); ]] 
[[ global_u8 &x  = f32(0.0f); ]] 
[[ global_u8 &x  = f64(0.0); ]] 
       
[[ global_u16 &x = f16(0.0h); ]] 
[[ global_u16 &x = f32(0.0f); ]] 
[[ global_u16 &x = f64(0.0); ]] 
       
[[ global_u32 &x = f16(0.0h); ]] 
[[ global_u32 &x = f32(0.0f); ]] 
[[ global_u32 &x = f64(0.0); ]] 
       
[[ global_u64 &x = f16(0.0h); ]] 
[[ global_u64 &x = f32(0.0f); ]] 
[[ global_u64 &x = f64(0.0); ]] 

// conv1.float.to.float

[[ global_f16 &x = 0.0; ]] 
[[ global_f32 &x = 0.0; ]] 
[[ global_f64 &x = 0.0h; ]] 

[[ global_f16 &x = f32(0.0f); ]] 
[[ global_f32 &x = f64(0.0); ]] 
[[ global_f64 &x = f16(0.0h); ]] 

// conv1.float.to.packed

[[ global_u8x4  &x = 0.0; ]]
[[ global_s8x4  &x = 0.0; ]]
[[ global_u16x2 &x = 0.0; ]]
[[ global_s16x2 &x = 0.0; ]]
[[ global_u8x8  &x = 0.0; ]]
[[ global_s8x8  &x = 0.0; ]]
[[ global_u16x4 &x = 0.0; ]]
[[ global_s16x4 &x = 0.0; ]]
[[ global_u32x2 &x = 0.0; ]]
[[ global_s32x2 &x = 0.0; ]]
[[ global_u8x16 &x = 0.0; ]]
[[ global_s8x16 &x = 0.0; ]]
[[ global_u16x8 &x = 0.0; ]]
[[ global_s16x8 &x = 0.0; ]]
[[ global_u32x4 &x = 0.0; ]]
[[ global_s32x4 &x = 0.0; ]]
[[ global_u64x2 &x = 0.0; ]]
[[ global_s64x2 &x = 0.0; ]]
[[ global_f16x2 &x = 0.0; ]]
[[ global_f16x4 &x = 0.0; ]]
[[ global_f16x8 &x = 0.0; ]]
[[ global_f32x2 &x = 0.0; ]]
[[ global_f32x4 &x = 0.0; ]]
[[ global_f64x2 &x = 0.0; ]]

[[ global_u8x4  &x = f32(0.0f); ]]
[[ global_s8x4  &x = f32(0.0f); ]]
[[ global_u16x2 &x = f32(0.0f); ]]
[[ global_s16x2 &x = f32(0.0f); ]]
[[ global_u8x8  &x = f64(0.0); ]]
[[ global_s8x8  &x = f64(0.0); ]]
[[ global_u16x4 &x = f64(0.0); ]]
[[ global_s16x4 &x = f64(0.0); ]]
[[ global_u32x2 &x = f64(0.0); ]]
[[ global_s32x2 &x = f64(0.0); ]]
[[ global_u8x16 &x = f64(0.0); ]]
[[ global_s8x16 &x = f64(0.0); ]]
[[ global_u16x8 &x = f64(0.0); ]]
[[ global_s16x8 &x = f64(0.0); ]]
[[ global_u32x4 &x = f64(0.0); ]]
[[ global_s32x4 &x = f64(0.0); ]]
[[ global_u64x2 &x = f64(0.0); ]]
[[ global_s64x2 &x = f64(0.0); ]]
[[ global_f16x2 &x = f32(0.0f); ]]
[[ global_f16x4 &x = f64(0.0); ]]
[[ global_f16x8 &x = f64(0.0); ]]
[[ global_f32x2 &x = f64(0.0); ]]
[[ global_f32x4 &x = f64(0.0); ]]
[[ global_f64x2 &x = f64(0.0); ]]

// conv1.float.to.opaque

[[ extension "IMAGE"; alloc(agent) global_rwimg &x = 0.0; ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x = 0.0; ]]
 
[[ extension "IMAGE"; alloc(agent) global_rwimg &x = f64(0.0); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x = f64(0.0); ]]

[[ global_sig64 &x = 0.0; ]]
[[ global_sig64 &x = f64(0.0); ]]

// conv1.float.to.array

[[ global_u8  &x[] = 0.0; ]] 
[[ global_u16 &x[] = 0.0; ]] 
[[ global_u32 &x[] = 0.0; ]] 
[[ global_u64 &x[] = 0.0; ]] 
[[ global_u16 &x[] = f16(0.0h); ]] 
[[ global_u32 &x[] = f32(0.0f); ]] 
[[ global_u64 &x[] = f64(0.0); ]] 

[[ global_s8  &x[] = 0.0; ]] 
[[ global_s16 &x[] = 0.0; ]] 
[[ global_s32 &x[] = 0.0; ]] 
[[ global_s64 &x[] = 0.0; ]] 
[[ global_s16 &x[] = f16(0.0h); ]] 
[[ global_s32 &x[] = f32(0.0f); ]] 
[[ global_s64 &x[] = f64(0.0); ]] 

[[ global_f16 &x[] = 0.0; ]] 
[[ global_f32 &x[] = 0.0; ]] 
[[ global_f64 &x[] = 0.0; ]] 
[[ global_f16 &x[] = f16(0.0h); ]] 
[[ global_f32 &x[] = f32(0.0f); ]] 
[[ global_f64 &x[] = f64(0.0); ]] 

[[ global_u8x4  &x[] = 0.0; ]]
[[ global_s8x4  &x[] = 0.0; ]]
[[ global_u16x2 &x[] = 0.0; ]]
[[ global_s16x2 &x[] = 0.0; ]]
[[ global_u8x8  &x[] = 0.0; ]]
[[ global_s8x8  &x[] = 0.0; ]]
[[ global_u16x4 &x[] = 0.0; ]]
[[ global_s16x4 &x[] = 0.0; ]]
[[ global_u32x2 &x[] = 0.0; ]]
[[ global_s32x2 &x[] = 0.0; ]]
[[ global_u8x16 &x[] = 0.0; ]]
[[ global_s8x16 &x[] = 0.0; ]]
[[ global_u16x8 &x[] = 0.0; ]]
[[ global_s16x8 &x[] = 0.0; ]]
[[ global_u32x4 &x[] = 0.0; ]]
[[ global_s32x4 &x[] = 0.0; ]]
[[ global_u64x2 &x[] = 0.0; ]]
[[ global_s64x2 &x[] = 0.0; ]]
[[ global_f16x2 &x[] = 0.0; ]]
[[ global_f16x4 &x[] = 0.0; ]]
[[ global_f16x8 &x[] = 0.0; ]]
[[ global_f32x2 &x[] = 0.0; ]]
[[ global_f32x4 &x[] = 0.0; ]]
[[ global_f64x2 &x[] = 0.0; ]]

[[ global_u8x4  &x[] = f32(0.0f); ]]
[[ global_s8x4  &x[] = f32(0.0f); ]]
[[ global_u16x2 &x[] = f32(0.0f); ]]
[[ global_s16x2 &x[] = f32(0.0f); ]]
[[ global_u8x8  &x[] = f64(0.0); ]]
[[ global_s8x8  &x[] = f64(0.0); ]]
[[ global_u16x4 &x[] = f64(0.0); ]]
[[ global_s16x4 &x[] = f64(0.0); ]]
[[ global_u32x2 &x[] = f64(0.0); ]]
[[ global_s32x2 &x[] = f64(0.0); ]]
[[ global_u8x16 &x[] = f64(0.0); ]]
[[ global_s8x16 &x[] = f64(0.0); ]]
[[ global_u16x8 &x[] = f64(0.0); ]]
[[ global_s16x8 &x[] = f64(0.0); ]]
[[ global_u32x4 &x[] = f64(0.0); ]]
[[ global_s32x4 &x[] = f64(0.0); ]]
[[ global_u64x2 &x[] = f64(0.0); ]]
[[ global_s64x2 &x[] = f64(0.0); ]]
[[ global_f16x2 &x[] = f32(0.0f); ]]
[[ global_f16x4 &x[] = f64(0.0); ]]
[[ global_f16x8 &x[] = f64(0.0); ]]
[[ global_f32x2 &x[] = f64(0.0); ]]
[[ global_f32x4 &x[] = f64(0.0); ]]
[[ global_f64x2 &x[] = f64(0.0); ]]

[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = 0.0; ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = 0.0; ]]

[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = f64(0.0); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = f64(0.0); ]]

[[ global_sig64 &x[] = 0.0; ]]
[[ global_sig64 &x[] = f64(0.0); ]]

/////////////////////////////////////////////////////////////////////////////////////////////////////////

// conv1.packed.to.bit

[[ global_b8 &x  = u8x4 (-1, -1, -1, -1); ]]
[[ global_b8 &x  = s8x4 (-1, -1, -1, -1); ]]
[[ global_b8 &x  = u16x2(-1, -1); ]]
[[ global_b8 &x  = s16x2(-1, -1); ]]
[[ global_b8 &x  = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_b8 &x  = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_b8 &x  = u16x4(-1, 0, 0, 0); ]]
[[ global_b8 &x  = s16x4(-1, 0, 0, 0); ]]
[[ global_b8 &x  = u32x2(-1, 0); ]]
[[ global_b8 &x  = s32x2(-1, 0); ]]
[[ global_b8 &x  = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_b8 &x  = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_b8 &x  = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_b8 &x  = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_b8 &x  = u32x4(-1, 0, 0, 0); ]]
[[ global_b8 &x  = s32x4(-1, 0, 0, 0); ]]
[[ global_b8 &x  = u64x2(-1, 0); ]]
[[ global_b8 &x  = s64x2(-1, 0); ]]
[[ global_b8 &x  = f16x2(1.0h, 0.0h); ]]
[[ global_b8 &x  = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_b8 &x  = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_b8 &x  = f32x2(1.0f, 0.0f); ]]
[[ global_b8 &x  = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_b8 &x  = f64x2(1.0, 0.0); ]]

[[ global_b16 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_b16 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_b16 &x = u16x2(-1, -1); ]]
[[ global_b16 &x = s16x2(-1, -1); ]]
[[ global_b16 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_b16 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_b16 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_b16 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_b16 &x = u32x2(-1, 0); ]]
[[ global_b16 &x = s32x2(-1, 0); ]]
[[ global_b16 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_b16 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_b16 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_b16 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_b16 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_b16 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_b16 &x = u64x2(-1, 0); ]]
[[ global_b16 &x = s64x2(-1, 0); ]]
[[ global_b16 &x = f16x2(1.0h, 0.0h); ]]
[[ global_b16 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_b16 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_b16 &x = f32x2(1.0f, 0.0f); ]]
[[ global_b16 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_b16 &x = f64x2(1.0, 0.0); ]]

[[ global_b32 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_b32 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_b32 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_b32 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_b32 &x = u32x2(-1, 0); ]]
[[ global_b32 &x = s32x2(-1, 0); ]]
[[ global_b32 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_b32 &x = f32x2(1.0f, 0.0f); ]]
[[ global_b32 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_b32 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_b32 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_b32 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_b32 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_b32 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_b32 &x = u64x2(-1, 0); ]]
[[ global_b32 &x = s64x2(-1, 0); ]]
[[ global_b32 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_b32 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_b32 &x = f64x2(1.0, 0.0); ]]

[[ global_b64 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_b64 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_b64 &x = u16x2(-1, -1); ]]
[[ global_b64 &x = s16x2(-1, -1); ]]
[[ global_b64 &x = f16x2(1.0h, 0.0h); ]]
[[ global_b64 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_b64 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_b64 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_b64 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_b64 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_b64 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_b64 &x = u64x2(-1, 0); ]]
[[ global_b64 &x = s64x2(-1, 0); ]]
[[ global_b64 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_b64 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_b64 &x = f64x2(1.0, 0.0); ]]

[[ global_b128 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_b128 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_b128 &x = u16x2(-1, -1); ]]
[[ global_b128 &x = s16x2(-1, -1); ]]
[[ global_b128 &x = f16x2(1.0h, 0.0h); ]]
[[ global_b128 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_b128 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_b128 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_b128 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_b128 &x = u32x2(-1, 0); ]]
[[ global_b128 &x = s32x2(-1, 0); ]]
[[ global_b128 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_b128 &x = f32x2(1.0f, 0.0f); ]]

// conv1.packed.to.int

[[ global_s8 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_s8 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_s8 &x = u16x2(-1, -1); ]]
[[ global_s8 &x = s16x2(-1, -1); ]]
[[ global_s8 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s8 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s8 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_s8 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_s8 &x = u32x2(-1, 0); ]]
[[ global_s8 &x = s32x2(-1, 0); ]]
[[ global_s8 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s8 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s8 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s8 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s8 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_s8 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_s8 &x = u64x2(-1, 0); ]]
[[ global_s8 &x = s64x2(-1, 0); ]]
[[ global_s8 &x = f16x2(1.0h, 0.0h); ]]
[[ global_s8 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_s8 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_s8 &x = f32x2(1.0f, 0.0f); ]]
[[ global_s8 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_s8 &x = f64x2(1.0, 0.0); ]]

[[ global_u8 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_u8 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_u8 &x = u16x2(-1, -1); ]]
[[ global_u8 &x = s16x2(-1, -1); ]]
[[ global_u8 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u8 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u8 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_u8 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_u8 &x = u32x2(-1, 0); ]]
[[ global_u8 &x = s32x2(-1, 0); ]]
[[ global_u8 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u8 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u8 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u8 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u8 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_u8 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_u8 &x = u64x2(-1, 0); ]]
[[ global_u8 &x = s64x2(-1, 0); ]]
[[ global_u8 &x = f16x2(1.0h, 0.0h); ]]
[[ global_u8 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_u8 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_u8 &x = f32x2(1.0f, 0.0f); ]]
[[ global_u8 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_u8 &x = f64x2(1.0, 0.0); ]]

[[ global_s16 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_s16 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_s16 &x = u16x2(-1, -1); ]]
[[ global_s16 &x = s16x2(-1, -1); ]]
[[ global_s16 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s16 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s16 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_s16 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_s16 &x = u32x2(-1, 0); ]]
[[ global_s16 &x = s32x2(-1, 0); ]]
[[ global_s16 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s16 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s16 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s16 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s16 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_s16 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_s16 &x = u64x2(-1, 0); ]]
[[ global_s16 &x = s64x2(-1, 0); ]]
[[ global_s16 &x = f16x2(1.0h, 0.0h); ]]
[[ global_s16 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_s16 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_s16 &x = f32x2(1.0f, 0.0f); ]]
[[ global_s16 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_s16 &x = f64x2(1.0, 0.0); ]]

[[ global_u16 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_u16 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_u16 &x = u16x2(-1, -1); ]]
[[ global_u16 &x = s16x2(-1, -1); ]]
[[ global_u16 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u16 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u16 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_u16 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_u16 &x = u32x2(-1, 0); ]]
[[ global_u16 &x = s32x2(-1, 0); ]]
[[ global_u16 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u16 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u16 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u16 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u16 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_u16 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_u16 &x = u64x2(-1, 0); ]]
[[ global_u16 &x = s64x2(-1, 0); ]]
[[ global_u16 &x = f16x2(1.0h, 0.0h); ]]
[[ global_u16 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_u16 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_u16 &x = f32x2(1.0f, 0.0f); ]]
[[ global_u16 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_u16 &x = f64x2(1.0, 0.0); ]]

[[ global_s32 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_s32 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_s32 &x = u16x2(-1, -1); ]]
[[ global_s32 &x = s16x2(-1, -1); ]]
[[ global_s32 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s32 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s32 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_s32 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_s32 &x = u32x2(-1, 0); ]]
[[ global_s32 &x = s32x2(-1, 0); ]]
[[ global_s32 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s32 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s32 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s32 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s32 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_s32 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_s32 &x = u64x2(-1, 0); ]]
[[ global_s32 &x = s64x2(-1, 0); ]]
[[ global_s32 &x = f16x2(1.0h, 0.0h); ]]
[[ global_s32 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_s32 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_s32 &x = f32x2(1.0f, 0.0f); ]]
[[ global_s32 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_s32 &x = f64x2(1.0, 0.0); ]]

[[ global_u32 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_u32 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_u32 &x = u16x2(-1, -1); ]]
[[ global_u32 &x = s16x2(-1, -1); ]]
[[ global_u32 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u32 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u32 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_u32 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_u32 &x = u32x2(-1, 0); ]]
[[ global_u32 &x = s32x2(-1, 0); ]]
[[ global_u32 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u32 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u32 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u32 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u32 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_u32 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_u32 &x = u64x2(-1, 0); ]]
[[ global_u32 &x = s64x2(-1, 0); ]]
[[ global_u32 &x = f16x2(1.0h, 0.0h); ]]
[[ global_u32 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_u32 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_u32 &x = f32x2(1.0f, 0.0f); ]]
[[ global_u32 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_u32 &x = f64x2(1.0, 0.0); ]]

[[ global_s64 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_s64 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_s64 &x = u16x2(-1, -1); ]]
[[ global_s64 &x = s16x2(-1, -1); ]]
[[ global_s64 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s64 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s64 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_s64 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_s64 &x = u32x2(-1, 0); ]]
[[ global_s64 &x = s32x2(-1, 0); ]]
[[ global_s64 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s64 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s64 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s64 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s64 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_s64 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_s64 &x = u64x2(-1, 0); ]]
[[ global_s64 &x = s64x2(-1, 0); ]]
[[ global_s64 &x = f16x2(1.0h, 0.0h); ]]
[[ global_s64 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_s64 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_s64 &x = f32x2(1.0f, 0.0f); ]]
[[ global_s64 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_s64 &x = f64x2(1.0, 0.0); ]]

[[ global_u64 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_u64 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_u64 &x = u16x2(-1, -1); ]]
[[ global_u64 &x = s16x2(-1, -1); ]]
[[ global_u64 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u64 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u64 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_u64 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_u64 &x = u32x2(-1, 0); ]]
[[ global_u64 &x = s32x2(-1, 0); ]]
[[ global_u64 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u64 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u64 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u64 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u64 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_u64 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_u64 &x = u64x2(-1, 0); ]]
[[ global_u64 &x = s64x2(-1, 0); ]]
[[ global_u64 &x = f16x2(1.0h, 0.0h); ]]
[[ global_u64 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_u64 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_u64 &x = f32x2(1.0f, 0.0f); ]]
[[ global_u64 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_u64 &x = f64x2(1.0, 0.0); ]]

// conv1.packed.to.float

[[ global_f16 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_f16 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_f16 &x = u16x2(-1, -1); ]]
[[ global_f16 &x = s16x2(-1, -1); ]]
[[ global_f16 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f16 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f16 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_f16 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_f16 &x = u32x2(-1, 0); ]]
[[ global_f16 &x = s32x2(-1, 0); ]]
[[ global_f16 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f16 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f16 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f16 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f16 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_f16 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_f16 &x = u64x2(-1, 0); ]]
[[ global_f16 &x = s64x2(-1, 0); ]]
[[ global_f16 &x = f16x2(1.0h, 0.0h); ]]
[[ global_f16 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_f16 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_f16 &x = f32x2(1.0f, 0.0f); ]]
[[ global_f16 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_f16 &x = f64x2(1.0, 0.0); ]]

[[ global_f32 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_f32 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_f32 &x = u16x2(-1, -1); ]]
[[ global_f32 &x = s16x2(-1, -1); ]]
[[ global_f32 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f32 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f32 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_f32 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_f32 &x = u32x2(-1, 0); ]]
[[ global_f32 &x = s32x2(-1, 0); ]]
[[ global_f32 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f32 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f32 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f32 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f32 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_f32 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_f32 &x = u64x2(-1, 0); ]]
[[ global_f32 &x = s64x2(-1, 0); ]]
[[ global_f32 &x = f16x2(1.0h, 0.0h); ]]
[[ global_f32 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_f32 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_f32 &x = f32x2(1.0f, 0.0f); ]]
[[ global_f32 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_f32 &x = f64x2(1.0, 0.0); ]]

[[ global_f64 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_f64 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_f64 &x = u16x2(-1, -1); ]]
[[ global_f64 &x = s16x2(-1, -1); ]]
[[ global_f64 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f64 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f64 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_f64 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_f64 &x = u32x2(-1, 0); ]]
[[ global_f64 &x = s32x2(-1, 0); ]]
[[ global_f64 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f64 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f64 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f64 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f64 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_f64 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_f64 &x = u64x2(-1, 0); ]]
[[ global_f64 &x = s64x2(-1, 0); ]]
[[ global_f64 &x = f16x2(1.0h, 0.0h); ]]
[[ global_f64 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_f64 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_f64 &x = f32x2(1.0f, 0.0f); ]]
[[ global_f64 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_f64 &x = f64x2(1.0, 0.0); ]]

// conv1.packed.to.packed

[[ global_u8x4 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_u8x4 &x = u16x2(-1, -1); ]]
[[ global_u8x4 &x = s16x2(-1, -1); ]]
[[ global_u8x4 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u8x4 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u8x4 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_u8x4 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_u8x4 &x = u32x2(-1, 0); ]]
[[ global_u8x4 &x = s32x2(-1, 0); ]]
[[ global_u8x4 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u8x4 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u8x4 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u8x4 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u8x4 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_u8x4 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_u8x4 &x = u64x2(-1, 0); ]]
[[ global_u8x4 &x = s64x2(-1, 0); ]]
[[ global_u8x4 &x = f16x2(1.0h, 0.0h); ]]
[[ global_u8x4 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_u8x4 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_u8x4 &x = f32x2(1.0f, 0.0f); ]]
[[ global_u8x4 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_u8x4 &x = f64x2(1.0, 0.0); ]]

[[ global_s8x4 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_s8x4 &x = u16x2(-1, -1); ]]
[[ global_s8x4 &x = s16x2(-1, -1); ]]
[[ global_s8x4 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s8x4 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s8x4 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_s8x4 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_s8x4 &x = u32x2(-1, 0); ]]
[[ global_s8x4 &x = s32x2(-1, 0); ]]
[[ global_s8x4 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s8x4 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s8x4 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s8x4 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s8x4 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_s8x4 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_s8x4 &x = u64x2(-1, 0); ]]
[[ global_s8x4 &x = s64x2(-1, 0); ]]
[[ global_s8x4 &x = f16x2(1.0h, 0.0h); ]]
[[ global_s8x4 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_s8x4 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_s8x4 &x = f32x2(1.0f, 0.0f); ]]
[[ global_s8x4 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_s8x4 &x = f64x2(1.0, 0.0); ]]

[[ global_u16x2 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_u16x2 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_u16x2 &x = s16x2(-1, -1); ]]
[[ global_u16x2 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u16x2 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u16x2 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_u16x2 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_u16x2 &x = u32x2(-1, 0); ]]
[[ global_u16x2 &x = s32x2(-1, 0); ]]
[[ global_u16x2 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u16x2 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u16x2 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u16x2 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u16x2 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_u16x2 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_u16x2 &x = u64x2(-1, 0); ]]
[[ global_u16x2 &x = s64x2(-1, 0); ]]
[[ global_u16x2 &x = f16x2(1.0h, 0.0h); ]]
[[ global_u16x2 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_u16x2 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_u16x2 &x = f32x2(1.0f, 0.0f); ]]
[[ global_u16x2 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_u16x2 &x = f64x2(1.0, 0.0); ]]

[[ global_s16x2 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_s16x2 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_s16x2 &x = u16x2(-1, -1); ]]
[[ global_s16x2 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s16x2 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s16x2 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_s16x2 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_s16x2 &x = u32x2(-1, 0); ]]
[[ global_s16x2 &x = s32x2(-1, 0); ]]
[[ global_s16x2 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s16x2 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s16x2 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s16x2 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s16x2 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_s16x2 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_s16x2 &x = u64x2(-1, 0); ]]
[[ global_s16x2 &x = s64x2(-1, 0); ]]
[[ global_s16x2 &x = f16x2(1.0h, 0.0h); ]]
[[ global_s16x2 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_s16x2 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_s16x2 &x = f32x2(1.0f, 0.0f); ]]
[[ global_s16x2 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_s16x2 &x = f64x2(1.0, 0.0); ]]

[[ global_u8x8 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_u8x8 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_u8x8 &x = u16x2(-1, -1); ]]
[[ global_u8x8 &x = s16x2(-1, -1); ]]
[[ global_u8x8 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u8x8 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_u8x8 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_u8x8 &x = u32x2(-1, 0); ]]
[[ global_u8x8 &x = s32x2(-1, 0); ]]
[[ global_u8x8 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u8x8 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u8x8 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u8x8 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u8x8 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_u8x8 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_u8x8 &x = u64x2(-1, 0); ]]
[[ global_u8x8 &x = s64x2(-1, 0); ]]
[[ global_u8x8 &x = f16x2(1.0h, 0.0h); ]]
[[ global_u8x8 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_u8x8 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_u8x8 &x = f32x2(1.0f, 0.0f); ]]
[[ global_u8x8 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_u8x8 &x = f64x2(1.0, 0.0); ]]

[[ global_s8x8 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_s8x8 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_s8x8 &x = u16x2(-1, -1); ]]
[[ global_s8x8 &x = s16x2(-1, -1); ]]
[[ global_s8x8 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s8x8 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_s8x8 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_s8x8 &x = u32x2(-1, 0); ]]
[[ global_s8x8 &x = s32x2(-1, 0); ]]
[[ global_s8x8 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s8x8 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s8x8 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s8x8 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s8x8 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_s8x8 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_s8x8 &x = u64x2(-1, 0); ]]
[[ global_s8x8 &x = s64x2(-1, 0); ]]
[[ global_s8x8 &x = f16x2(1.0h, 0.0h); ]]
[[ global_s8x8 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_s8x8 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_s8x8 &x = f32x2(1.0f, 0.0f); ]]
[[ global_s8x8 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_s8x8 &x = f64x2(1.0, 0.0); ]]

[[ global_u16x4 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_u16x4 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_u16x4 &x = u16x2(-1, -1); ]]
[[ global_u16x4 &x = s16x2(-1, -1); ]]
[[ global_u16x4 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u16x4 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u16x4 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_u16x4 &x = u32x2(-1, 0); ]]
[[ global_u16x4 &x = s32x2(-1, 0); ]]
[[ global_u16x4 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u16x4 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u16x4 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u16x4 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u16x4 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_u16x4 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_u16x4 &x = u64x2(-1, 0); ]]
[[ global_u16x4 &x = s64x2(-1, 0); ]]
[[ global_u16x4 &x = f16x2(1.0h, 0.0h); ]]
[[ global_u16x4 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_u16x4 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_u16x4 &x = f32x2(1.0f, 0.0f); ]]
[[ global_u16x4 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_u16x4 &x = f64x2(1.0, 0.0); ]]

[[ global_s16x4 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_s16x4 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_s16x4 &x = u16x2(-1, -1); ]]
[[ global_s16x4 &x = s16x2(-1, -1); ]]
[[ global_s16x4 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s16x4 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s16x4 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_s16x4 &x = u32x2(-1, 0); ]]
[[ global_s16x4 &x = s32x2(-1, 0); ]]
[[ global_s16x4 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s16x4 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s16x4 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s16x4 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s16x4 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_s16x4 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_s16x4 &x = u64x2(-1, 0); ]]
[[ global_s16x4 &x = s64x2(-1, 0); ]]
[[ global_s16x4 &x = f16x2(1.0h, 0.0h); ]]
[[ global_s16x4 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_s16x4 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_s16x4 &x = f32x2(1.0f, 0.0f); ]]
[[ global_s16x4 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_s16x4 &x = f64x2(1.0, 0.0); ]]

[[ global_u32x2 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_u32x2 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_u32x2 &x = u16x2(-1, -1); ]]
[[ global_u32x2 &x = s16x2(-1, -1); ]]
[[ global_u32x2 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u32x2 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u32x2 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_u32x2 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_u32x2 &x = s32x2(-1, 0); ]]
[[ global_u32x2 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u32x2 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u32x2 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u32x2 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u32x2 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_u32x2 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_u32x2 &x = u64x2(-1, 0); ]]
[[ global_u32x2 &x = s64x2(-1, 0); ]]
[[ global_u32x2 &x = f16x2(1.0h, 0.0h); ]]
[[ global_u32x2 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_u32x2 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_u32x2 &x = f32x2(1.0f, 0.0f); ]]
[[ global_u32x2 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_u32x2 &x = f64x2(1.0, 0.0); ]]

[[ global_s32x2 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_s32x2 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_s32x2 &x = u16x2(-1, -1); ]]
[[ global_s32x2 &x = s16x2(-1, -1); ]]
[[ global_s32x2 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s32x2 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s32x2 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_s32x2 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_s32x2 &x = u32x2(-1, 0); ]]
[[ global_s32x2 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s32x2 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s32x2 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s32x2 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s32x2 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_s32x2 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_s32x2 &x = u64x2(-1, 0); ]]
[[ global_s32x2 &x = s64x2(-1, 0); ]]
[[ global_s32x2 &x = f16x2(1.0h, 0.0h); ]]
[[ global_s32x2 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_s32x2 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_s32x2 &x = f32x2(1.0f, 0.0f); ]]
[[ global_s32x2 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_s32x2 &x = f64x2(1.0, 0.0); ]]

[[ global_u8x16 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_u8x16 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_u8x16 &x = u16x2(-1, -1); ]]
[[ global_u8x16 &x = s16x2(-1, -1); ]]
[[ global_u8x16 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u8x16 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u8x16 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_u8x16 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_u8x16 &x = u32x2(-1, 0); ]]
[[ global_u8x16 &x = s32x2(-1, 0); ]]
[[ global_u8x16 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u8x16 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u8x16 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u8x16 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_u8x16 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_u8x16 &x = u64x2(-1, 0); ]]
[[ global_u8x16 &x = s64x2(-1, 0); ]]
[[ global_u8x16 &x = f16x2(1.0h, 0.0h); ]]
[[ global_u8x16 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_u8x16 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_u8x16 &x = f32x2(1.0f, 0.0f); ]]
[[ global_u8x16 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_u8x16 &x = f64x2(1.0, 0.0); ]]

[[ global_s8x16 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_s8x16 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_s8x16 &x = u16x2(-1, -1); ]]
[[ global_s8x16 &x = s16x2(-1, -1); ]]
[[ global_s8x16 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s8x16 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s8x16 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_s8x16 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_s8x16 &x = u32x2(-1, 0); ]]
[[ global_s8x16 &x = s32x2(-1, 0); ]]
[[ global_s8x16 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s8x16 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s8x16 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s8x16 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_s8x16 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_s8x16 &x = u64x2(-1, 0); ]]
[[ global_s8x16 &x = s64x2(-1, 0); ]]
[[ global_s8x16 &x = f16x2(1.0h, 0.0h); ]]
[[ global_s8x16 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_s8x16 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_s8x16 &x = f32x2(1.0f, 0.0f); ]]
[[ global_s8x16 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_s8x16 &x = f64x2(1.0, 0.0); ]]

[[ global_u16x8 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_u16x8 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_u16x8 &x = u16x2(-1, -1); ]]
[[ global_u16x8 &x = s16x2(-1, -1); ]]
[[ global_u16x8 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u16x8 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u16x8 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_u16x8 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_u16x8 &x = u32x2(-1, 0); ]]
[[ global_u16x8 &x = s32x2(-1, 0); ]]
[[ global_u16x8 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u16x8 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u16x8 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u16x8 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_u16x8 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_u16x8 &x = u64x2(-1, 0); ]]
[[ global_u16x8 &x = s64x2(-1, 0); ]]
[[ global_u16x8 &x = f16x2(1.0h, 0.0h); ]]
[[ global_u16x8 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_u16x8 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_u16x8 &x = f32x2(1.0f, 0.0f); ]]
[[ global_u16x8 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_u16x8 &x = f64x2(1.0, 0.0); ]]

[[ global_s16x8 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_s16x8 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_s16x8 &x = u16x2(-1, -1); ]]
[[ global_s16x8 &x = s16x2(-1, -1); ]]
[[ global_s16x8 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s16x8 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s16x8 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_s16x8 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_s16x8 &x = u32x2(-1, 0); ]]
[[ global_s16x8 &x = s32x2(-1, 0); ]]
[[ global_s16x8 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s16x8 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s16x8 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s16x8 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_s16x8 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_s16x8 &x = u64x2(-1, 0); ]]
[[ global_s16x8 &x = s64x2(-1, 0); ]]
[[ global_s16x8 &x = f16x2(1.0h, 0.0h); ]]
[[ global_s16x8 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_s16x8 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_s16x8 &x = f32x2(1.0f, 0.0f); ]]
[[ global_s16x8 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_s16x8 &x = f64x2(1.0, 0.0); ]]

[[ global_u32x4 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_u32x4 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_u32x4 &x = u16x2(-1, -1); ]]
[[ global_u32x4 &x = s16x2(-1, -1); ]]
[[ global_u32x4 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u32x4 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u32x4 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_u32x4 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_u32x4 &x = u32x2(-1, 0); ]]
[[ global_u32x4 &x = s32x2(-1, 0); ]]
[[ global_u32x4 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u32x4 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u32x4 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u32x4 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u32x4 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_u32x4 &x = u64x2(-1, 0); ]]
[[ global_u32x4 &x = s64x2(-1, 0); ]]
[[ global_u32x4 &x = f16x2(1.0h, 0.0h); ]]
[[ global_u32x4 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_u32x4 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_u32x4 &x = f32x2(1.0f, 0.0f); ]]
[[ global_u32x4 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_u32x4 &x = f64x2(1.0, 0.0); ]]

[[ global_s32x4 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_s32x4 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_s32x4 &x = u16x2(-1, -1); ]]
[[ global_s32x4 &x = s16x2(-1, -1); ]]
[[ global_s32x4 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s32x4 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s32x4 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_s32x4 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_s32x4 &x = u32x2(-1, 0); ]]
[[ global_s32x4 &x = s32x2(-1, 0); ]]
[[ global_s32x4 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s32x4 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s32x4 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s32x4 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s32x4 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_s32x4 &x = u64x2(-1, 0); ]]
[[ global_s32x4 &x = s64x2(-1, 0); ]]
[[ global_s32x4 &x = f16x2(1.0h, 0.0h); ]]
[[ global_s32x4 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_s32x4 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_s32x4 &x = f32x2(1.0f, 0.0f); ]]
[[ global_s32x4 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_s32x4 &x = f64x2(1.0, 0.0); ]]

[[ global_u64x2 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_u64x2 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_u64x2 &x = u16x2(-1, -1); ]]
[[ global_u64x2 &x = s16x2(-1, -1); ]]
[[ global_u64x2 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u64x2 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u64x2 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_u64x2 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_u64x2 &x = u32x2(-1, 0); ]]
[[ global_u64x2 &x = s32x2(-1, 0); ]]
[[ global_u64x2 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u64x2 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u64x2 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u64x2 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u64x2 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_u64x2 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_u64x2 &x = s64x2(-1, 0); ]]
[[ global_u64x2 &x = f16x2(1.0h, 0.0h); ]]
[[ global_u64x2 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_u64x2 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_u64x2 &x = f32x2(1.0f, 0.0f); ]]
[[ global_u64x2 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_u64x2 &x = f64x2(1.0, 0.0); ]]

[[ global_s64x2 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_s64x2 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_s64x2 &x = u16x2(-1, -1); ]]
[[ global_s64x2 &x = s16x2(-1, -1); ]]
[[ global_s64x2 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s64x2 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s64x2 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_s64x2 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_s64x2 &x = u32x2(-1, 0); ]]
[[ global_s64x2 &x = s32x2(-1, 0); ]]
[[ global_s64x2 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s64x2 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s64x2 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s64x2 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s64x2 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_s64x2 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_s64x2 &x = u64x2(-1, 0); ]]
[[ global_s64x2 &x = f16x2(1.0h, 0.0h); ]]
[[ global_s64x2 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_s64x2 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_s64x2 &x = f32x2(1.0f, 0.0f); ]]
[[ global_s64x2 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_s64x2 &x = f64x2(1.0, 0.0); ]]

[[ global_f16x2 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_f16x2 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_f16x2 &x = u16x2(-1, -1); ]]
[[ global_f16x2 &x = s16x2(-1, -1); ]]
[[ global_f16x2 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f16x2 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f16x2 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_f16x2 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_f16x2 &x = u32x2(-1, 0); ]]
[[ global_f16x2 &x = s32x2(-1, 0); ]]
[[ global_f16x2 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f16x2 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f16x2 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f16x2 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f16x2 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_f16x2 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_f16x2 &x = u64x2(-1, 0); ]]
[[ global_f16x2 &x = s64x2(-1, 0); ]]
[[ global_f16x2 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_f16x2 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_f16x2 &x = f32x2(1.0f, 0.0f); ]]
[[ global_f16x2 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_f16x2 &x = f64x2(1.0, 0.0); ]]

[[ global_f16x4 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_f16x4 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_f16x4 &x = u16x2(-1, -1); ]]
[[ global_f16x4 &x = s16x2(-1, -1); ]]
[[ global_f16x4 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f16x4 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f16x4 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_f16x4 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_f16x4 &x = u32x2(-1, 0); ]]
[[ global_f16x4 &x = s32x2(-1, 0); ]]
[[ global_f16x4 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f16x4 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f16x4 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f16x4 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f16x4 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_f16x4 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_f16x4 &x = u64x2(-1, 0); ]]
[[ global_f16x4 &x = s64x2(-1, 0); ]]
[[ global_f16x4 &x = f16x2(1.0h, 0.0h); ]]
[[ global_f16x4 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_f16x4 &x = f32x2(1.0f, 0.0f); ]]
[[ global_f16x4 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_f16x4 &x = f64x2(1.0, 0.0); ]]

[[ global_f16x8 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_f16x8 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_f16x8 &x = u16x2(-1, -1); ]]
[[ global_f16x8 &x = s16x2(-1, -1); ]]
[[ global_f16x8 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f16x8 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f16x8 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_f16x8 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_f16x8 &x = u32x2(-1, 0); ]]
[[ global_f16x8 &x = s32x2(-1, 0); ]]
[[ global_f16x8 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f16x8 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f16x8 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f16x8 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f16x8 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_f16x8 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_f16x8 &x = u64x2(-1, 0); ]]
[[ global_f16x8 &x = s64x2(-1, 0); ]]
[[ global_f16x8 &x = f16x2(1.0h, 0.0h); ]]
[[ global_f16x8 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_f16x8 &x = f32x2(1.0f, 0.0f); ]]
[[ global_f16x8 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_f16x8 &x = f64x2(1.0, 0.0); ]]

[[ global_f32x2 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_f32x2 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_f32x2 &x = u16x2(-1, -1); ]]
[[ global_f32x2 &x = s16x2(-1, -1); ]]
[[ global_f32x2 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f32x2 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f32x2 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_f32x2 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_f32x2 &x = u32x2(-1, 0); ]]
[[ global_f32x2 &x = s32x2(-1, 0); ]]
[[ global_f32x2 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f32x2 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f32x2 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f32x2 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f32x2 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_f32x2 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_f32x2 &x = u64x2(-1, 0); ]]
[[ global_f32x2 &x = s64x2(-1, 0); ]]
[[ global_f32x2 &x = f16x2(1.0h, 0.0h); ]]
[[ global_f32x2 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_f32x2 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_f32x2 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_f32x2 &x = f64x2(1.0, 0.0); ]]

[[ global_f32x4 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_f32x4 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_f32x4 &x = u16x2(-1, -1); ]]
[[ global_f32x4 &x = s16x2(-1, -1); ]]
[[ global_f32x4 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f32x4 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f32x4 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_f32x4 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_f32x4 &x = u32x2(-1, 0); ]]
[[ global_f32x4 &x = s32x2(-1, 0); ]]
[[ global_f32x4 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f32x4 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f32x4 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f32x4 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f32x4 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_f32x4 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_f32x4 &x = u64x2(-1, 0); ]]
[[ global_f32x4 &x = s64x2(-1, 0); ]]
[[ global_f32x4 &x = f16x2(1.0h, 0.0h); ]]
[[ global_f32x4 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_f32x4 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_f32x4 &x = f32x2(1.0f, 0.0f); ]]
[[ global_f32x4 &x = f64x2(1.0, 0.0); ]]

[[ global_f64x2 &x = u8x4 (-1, -1, -1, -1); ]]
[[ global_f64x2 &x = s8x4 (-1, -1, -1, -1); ]]
[[ global_f64x2 &x = u16x2(-1, -1); ]]
[[ global_f64x2 &x = s16x2(-1, -1); ]]
[[ global_f64x2 &x = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f64x2 &x = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f64x2 &x = u16x4(-1, 0, 0, 0); ]]
[[ global_f64x2 &x = s16x4(-1, 0, 0, 0); ]]
[[ global_f64x2 &x = u32x2(-1, 0); ]]
[[ global_f64x2 &x = s32x2(-1, 0); ]]
[[ global_f64x2 &x = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f64x2 &x = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f64x2 &x = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f64x2 &x = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f64x2 &x = u32x4(-1, 0, 0, 0); ]]
[[ global_f64x2 &x = s32x4(-1, 0, 0, 0); ]]
[[ global_f64x2 &x = u64x2(-1, 0); ]]
[[ global_f64x2 &x = s64x2(-1, 0); ]]
[[ global_f64x2 &x = f16x2(1.0h, 0.0h); ]]
[[ global_f64x2 &x = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_f64x2 &x = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_f64x2 &x = f32x2(1.0f, 0.0f); ]]
[[ global_f64x2 &x = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]

// conv1.packed.to.opaque

[[ extension "IMAGE"; alloc(agent) global_rwimg &x = u8x4 (-1, -1, -1, -1); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x = s32x4(-1, 0, 0, 0); ]]

[[ global_sig64 &x = f32x2(1.0f, 0.0f); ]]

// conv1.packed.to.array

[[ global_u8  &x[] = u8x4 (-1, -1, -1, -1); ]]
[[ global_u16 &x[] = s8x4 (-1, -1, -1, -1); ]]
[[ global_u32 &x[] = u16x2(-1, -1); ]]
[[ global_u64 &x[] = s16x2(-1, -1); ]]
[[ global_u16 &x[] = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u32 &x[] = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u64 &x[] = u16x4(-1, 0, 0, 0); ]]
[[ global_s8  &x[] = s16x4(-1, 0, 0, 0); ]]
[[ global_s16 &x[] = u32x2(-1, 0); ]]
[[ global_s32 &x[] = s32x2(-1, 0); ]]
[[ global_s64 &x[] = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s16 &x[] = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s32 &x[] = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s64 &x[] = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_f16 &x[] = u32x4(-1, 0, 0, 0); ]]
[[ global_f32 &x[] = s32x4(-1, 0, 0, 0); ]]
[[ global_f64 &x[] = u64x2(-1, 0); ]]
[[ global_f16 &x[] = s64x2(-1, 0); ]]
[[ global_f32 &x[] = f16x2(1.0h, 0.0h); ]]
[[ global_f64 &x[] = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]

[[ global_u8x4  &x[] = u8x4 (-1, -1, -1, -1); ]]
[[ global_s8x4  &x[] = s8x4 (-1, -1, -1, -1); ]]
[[ global_u16x2 &x[] = u16x2(-1, -1); ]]
[[ global_s16x2 &x[] = s16x2(-1, -1); ]]
[[ global_u8x8  &x[] = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s8x8  &x[] = s8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u16x4 &x[] = u16x4(-1, 0, 0, 0); ]]
[[ global_s16x4 &x[] = s16x4(-1, 0, 0, 0); ]]
[[ global_u32x2 &x[] = u32x2(-1, 0); ]]
[[ global_s32x2 &x[] = s32x2(-1, 0); ]]
[[ global_u8x16 &x[] = u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s8x16 &x[] = s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u16x8 &x[] = u16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_s16x8 &x[] = s16x8(-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_u32x4 &x[] = u32x4(-1, 0, 0, 0); ]]
[[ global_s32x4 &x[] = s32x4(-1, 0, 0, 0); ]]
[[ global_u64x2 &x[] = u64x2(-1, 0); ]]
[[ global_s64x2 &x[] = s64x2(-1, 0); ]]
[[ global_f16x2 &x[] = f16x2(1.0h, 0.0h); ]]
[[ global_f16x4 &x[] = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_f16x8 &x[] = f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_f32x2 &x[] = f32x2(1.0f, 0.0f); ]]
[[ global_f32x4 &x[] = f32x4(1.0f, 0.0f, 1.0f, 0.0f); ]]
[[ global_f64x2 &x[] = f64x2(1.0, 0.0); ]]

[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = u32x2(-1, 0); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = f16x4(1.0h, 0.0h, 0.0h, 0.0h); ]]

[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = f32x2(1.0f, 0.0f); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = s16x4(-1, 0, 0, 0); ]]

[[ global_sig64 &x[] = u8x8 (-1, 0, 0, 0, 0, 0, 0, 0); ]]
[[ global_sig64 &x[] = f64x2(1.0, 0.0); ]]

/////////////////////////////////////////////////////////////////////////////////////////////////////////

// conv1.image.to.bit

[[ extension "IMAGE"; global_b8 &x   = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_b16 &x  = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_b32 &x  = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_b64 &x  = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_b128 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]

// conv1.image.to.int

[[ extension "IMAGE"; global_s8 &x  = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s16 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s32 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s64 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_u8 &x  = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_u16 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_u32 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_u64 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]

// conv1.image.to.float

[[ extension "IMAGE"; global_f16 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_f32 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_f64 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]] 

// conv1.image.to.packed

[[ extension "IMAGE"; global_u8x4  &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s8x4  &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_u16x2 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s16x2 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_u8x8  &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s8x8  &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_u16x4 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s16x4 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_u32x2 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s32x2 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_u8x16 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s8x16 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_u16x8 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s16x8 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_u32x4 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s32x4 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_u64x2 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s64x2 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_f16x2 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_f16x4 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_f16x8 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_f32x2 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_f32x4 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_f64x2 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]

// conv1.image.to.opaque

[[ extension "IMAGE"; alloc(agent) global_samp  &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_sig64 &x = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]

// conv1.image.to.array

[[ extension "IMAGE"; global_u8  &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_u16 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_u32 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_u64 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_u16 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_u32 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_u64 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s8  &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s16 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s32 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s64 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s16 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s32 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s64 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_f16 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_f32 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_f64 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_f16 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_f32 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_f64 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]

[[ extension "IMAGE"; global_u8x4  &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s8x4  &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_u16x2 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s16x2 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_u8x8  &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s8x8  &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_u16x4 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s16x4 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_u32x2 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s32x2 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_u8x16 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s8x16 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_u16x8 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s16x8 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_u32x4 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s32x4 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_u64x2 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_s64x2 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_f16x2 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_f16x4 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_f16x8 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_f32x2 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_f32x4 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; global_f64x2 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]

[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]

[[ extension "IMAGE"; global_sig64 &x[] = rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx); ]]

/////////////////////////////////////////////////////////////////////////////////////////////////////////

// conv1.sampler.to.bit

[[ extension "IMAGE"; global_b8 &x   = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_b16 &x  = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_b32 &x  = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_b64 &x  = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_b128 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]

// conv1.sampler.to.int

[[ extension "IMAGE"; global_s8 &x  = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s16 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s32 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s64 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_u8 &x  = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_u16 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_u32 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_u64 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]

// conv1.sampler.to.float

[[ extension "IMAGE"; global_f16 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_f32 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_f64 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]] 

// conv1.sampler.to.packed

[[ extension "IMAGE"; global_u8x4  &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s8x4  &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_u16x2 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s16x2 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_u8x8  &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s8x8  &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_u16x4 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s16x4 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_u32x2 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s32x2 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_u8x16 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s8x16 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_u16x8 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s16x8 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_u32x4 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s32x4 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_u64x2 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s64x2 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_f16x2 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_f16x4 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_f16x8 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_f32x2 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_f32x4 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_f64x2 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]

// conv1.sampler.to.opaque

[[ extension "IMAGE"; alloc(agent) global_rwimg &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]

[[ extension "IMAGE"; global_sig64 &x = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]

// conv1.sampler.to.array

[[ extension "IMAGE"; global_u8  &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_u16 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_u32 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_u64 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_u16 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_u32 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_u64 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s8  &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s16 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s32 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s64 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s16 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s32 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s64 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_f16 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_f32 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_f64 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_f16 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_f32 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_f64 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]

[[ extension "IMAGE"; global_u8x4  &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s8x4  &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_u16x2 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s16x2 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_u8x8  &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s8x8  &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_u16x4 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s16x4 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_u32x2 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s32x2 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_u8x16 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s8x16 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_u16x8 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s16x8 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_u32x4 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s32x4 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_u64x2 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_s64x2 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_f16x2 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_f16x4 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_f16x8 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_f32x2 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_f32x4 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; global_f64x2 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]

[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]

[[ extension "IMAGE"; global_sig64 &x[] = samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border); ]]

/////////////////////////////////////////////////////////////////////////////////////////////////////////

// conv1.signal.to.bit

[[ global_b8 &x   = sig64(0); ]]
[[ global_b16 &x  = sig64(0); ]]
[[ global_b32 &x  = sig64(0); ]]
[[ global_b64 &x  = sig64(0); ]]
[[ global_b128 &x = sig64(0); ]]

// conv1.signal.to.int

[[ global_s8 &x  = sig64(0); ]]
[[ global_s16 &x = sig64(0); ]]
[[ global_s32 &x = sig64(0); ]]
[[ global_s64 &x = sig64(0); ]]
[[ global_u8 &x  = sig64(0); ]]
[[ global_u16 &x = sig64(0); ]]
[[ global_u32 &x = sig64(0); ]]
[[ global_u64 &x = sig64(0); ]]

// conv1.signal.to.float

[[ global_f16 &x = sig64(0); ]]
[[ global_f32 &x = sig64(0); ]]
[[ global_f64 &x = sig64(0); ]] 

// conv1.signal.to.packed

[[ global_u8x4  &x = sig64(0); ]]
[[ global_s8x4  &x = sig64(0); ]]
[[ global_u16x2 &x = sig64(0); ]]
[[ global_s16x2 &x = sig64(0); ]]
[[ global_u8x8  &x = sig64(0); ]]
[[ global_s8x8  &x = sig64(0); ]]
[[ global_u16x4 &x = sig64(0); ]]
[[ global_s16x4 &x = sig64(0); ]]
[[ global_u32x2 &x = sig64(0); ]]
[[ global_s32x2 &x = sig64(0); ]]
[[ global_u8x16 &x = sig64(0); ]]
[[ global_s8x16 &x = sig64(0); ]]
[[ global_u16x8 &x = sig64(0); ]]
[[ global_s16x8 &x = sig64(0); ]]
[[ global_u32x4 &x = sig64(0); ]]
[[ global_s32x4 &x = sig64(0); ]]
[[ global_u64x2 &x = sig64(0); ]]
[[ global_s64x2 &x = sig64(0); ]]
[[ global_f16x2 &x = sig64(0); ]]
[[ global_f16x4 &x = sig64(0); ]]
[[ global_f16x8 &x = sig64(0); ]]
[[ global_f32x2 &x = sig64(0); ]]
[[ global_f32x4 &x = sig64(0); ]]
[[ global_f64x2 &x = sig64(0); ]]

// conv1.signal.to.opaque

[[ extension "IMAGE"; alloc(agent) global_rwimg &x = sig64(0); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x = sig64(0); ]]

// conv1.signal.to.array

[[ global_u8  &x[] = sig64(0); ]]
[[ global_u16 &x[] = sig64(0); ]]
[[ global_u32 &x[] = sig64(0); ]]
[[ global_u64 &x[] = sig64(0); ]]
[[ global_u16 &x[] = sig64(0); ]]
[[ global_u32 &x[] = sig64(0); ]]
[[ global_u64 &x[] = sig64(0); ]]
[[ global_s8  &x[] = sig64(0); ]]
[[ global_s16 &x[] = sig64(0); ]]
[[ global_s32 &x[] = sig64(0); ]]
[[ global_s64 &x[] = sig64(0); ]]
[[ global_s16 &x[] = sig64(0); ]]
[[ global_s32 &x[] = sig64(0); ]]
[[ global_s64 &x[] = sig64(0); ]]
[[ global_f16 &x[] = sig64(0); ]]
[[ global_f32 &x[] = sig64(0); ]]
[[ global_f64 &x[] = sig64(0); ]]
[[ global_f16 &x[] = sig64(0); ]]
[[ global_f32 &x[] = sig64(0); ]]
[[ global_f64 &x[] = sig64(0); ]]

[[ global_u8x4  &x[] = sig64(0); ]]
[[ global_s8x4  &x[] = sig64(0); ]]
[[ global_u16x2 &x[] = sig64(0); ]]
[[ global_s16x2 &x[] = sig64(0); ]]
[[ global_u8x8  &x[] = sig64(0); ]]
[[ global_s8x8  &x[] = sig64(0); ]]
[[ global_u16x4 &x[] = sig64(0); ]]
[[ global_s16x4 &x[] = sig64(0); ]]
[[ global_u32x2 &x[] = sig64(0); ]]
[[ global_s32x2 &x[] = sig64(0); ]]
[[ global_u8x16 &x[] = sig64(0); ]]
[[ global_s8x16 &x[] = sig64(0); ]]
[[ global_u16x8 &x[] = sig64(0); ]]
[[ global_s16x8 &x[] = sig64(0); ]]
[[ global_u32x4 &x[] = sig64(0); ]]
[[ global_s32x4 &x[] = sig64(0); ]]
[[ global_u64x2 &x[] = sig64(0); ]]
[[ global_s64x2 &x[] = sig64(0); ]]
[[ global_f16x2 &x[] = sig64(0); ]]
[[ global_f16x4 &x[] = sig64(0); ]]
[[ global_f16x8 &x[] = sig64(0); ]]
[[ global_f32x2 &x[] = sig64(0); ]]
[[ global_f32x4 &x[] = sig64(0); ]]
[[ global_f64x2 &x[] = sig64(0); ]]

[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = sig64(0); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = sig64(0); ]]

[[ global_sig64 &x[] = sig64(0); ]]


/////////////////////////////////////////////////////////////////////////////////////////////////////////

// conv1.array.to.bit

[[ global_b8 &x   = u8[](0); ]]
[[ global_b16 &x  = u8[](0, 1); ]]
[[ global_b32 &x  = u8[](0, 1, 2, 3); ]]
[[ global_b64 &x  = u8[](0, 1, 2, 3, 4, 5, 6, 7); ]]
[[ global_b128 &x = u8[](0, 1, 2, 3, 4, 5, 6, 7, 11, 22, 33, 44, 55, 66, 77, 88); ]]

// conv1.array.to.int

[[ global_s8 &x  = s8[](0); ]]
[[ global_s16 &x = s8[](0, 1); ]]
[[ global_s32 &x = s8[](0, 1, 2, 3); ]]
[[ global_s64 &x = s8[](0, 1, 2, 3, 4, 5, 6, 7); ]]
[[ global_u8 &x  = u8[](0); ]]
[[ global_u16 &x = u8[](0, 1); ]]
[[ global_u32 &x = u8[](0, 1, 2, 3); ]]
[[ global_u64 &x = u8[](0, 1, 2, 3, 4, 5, 6, 7); ]]

// conv1.array.to.float

[[ global_f16 &x = f16[](0.0h); ]]
[[ global_f32 &x = f32[](0.0f); ]]
[[ global_f64 &x = f64[](0.0); ]] 

// conv1.array.to.packed

[[ global_u8x4  &x = u8[](0, 1, 2, 3); ]]
[[ global_s8x4  &x = s8[](0, 1, 2, 3); ]]
[[ global_u16x2 &x = u16[](0, 1); ]]
[[ global_s16x2 &x = s16[](0, 1); ]]
[[ global_u8x8  &x = u8[](0, 1, 2, 3, 4, 5, 6, 7); ]]
[[ global_s8x8  &x = s8[](0, 1, 2, 3, 4, 5, 6, 7); ]]
[[ global_u16x4 &x = u16[](0, 1, 2, 3); ]]
[[ global_s16x4 &x = s16[](0, 1, 2, 3); ]]
[[ global_u32x2 &x = u32[](0, 1); ]]
[[ global_s32x2 &x = s32[](0, 1); ]]
[[ global_u8x16 &x = u8[](0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7); ]]
[[ global_s8x16 &x = s8[](0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7); ]]
[[ global_u16x8 &x = u16[](0, 1, 2, 3, 4, 5, 6, 7); ]]
[[ global_s16x8 &x = s16[](0, 1, 2, 3, 4, 5, 6, 7); ]]
[[ global_u32x4 &x = u32[](0, 1, 2, 3); ]]
[[ global_s32x4 &x = s32[](0, 1, 2, 3); ]]
[[ global_u64x2 &x = u64[](0, 1); ]]
[[ global_s64x2 &x = s64[](0, 1); ]]
[[ global_f16x2 &x = f16[](0.0h, 0.0h); ]]
[[ global_f16x4 &x = f16[](0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_f16x8 &x = f16[](0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_f32x2 &x = f32[](0.0f, 0.0f); ]]
[[ global_f32x4 &x = f32[](0.0f, 0.0f, 0.0f, 0.0f); ]]
[[ global_f64x2 &x = f64[](0.0, 0.0); ]]

// conv1.array.to.opaque

[[ extension "IMAGE"; alloc(agent) global_rwimg &x = f32[](0.0f, 0.0f); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x = u32[](0, 1); ]]

// conv1.array.to.array

[[ global_u8  &x[] = s8 [](0, 1, 2, 3); ]]
[[ global_u16 &x[] = s16[](0, 1, 2, 3); ]]
[[ global_u32 &x[] = s32[](0, 1, 2, 3); ]]
[[ global_u64 &x[] = s64[](0, 1, 2, 3); ]]
[[ global_u16 &x[] = s16[](0, 1, 2, 3); ]]
[[ global_u32 &x[] = s32[](0, 1, 2, 3); ]]
[[ global_u64 &x[] = s64[](0, 1, 2, 3); ]]

[[ global_u8  &x[] = u16[](0, 1, 2, 3); ]]
[[ global_u16 &x[] = f16[](0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_u32 &x[] = f32[](0.0f, 0.0f); ]]
[[ global_u64 &x[] = f64[](0.0, 0.0); ]]
[[ global_u16 &x[] = u8 [](0, 1, 2, 3); ]]
[[ global_u32 &x[] = u64[](0, 1, 2, 3); ]]
[[ global_u64 &x[] = u32[](0, 1, 2, 3); ]]

[[ global_s8  &x[] = u8 [](0, 1, 2, 3); ]]
[[ global_s16 &x[] = u16[](0, 1, 2, 3); ]]
[[ global_s32 &x[] = u32[](0, 1, 2, 3); ]]
[[ global_s64 &x[] = u64[](0, 1, 2, 3); ]]
[[ global_s16 &x[] = u16[](0, 1, 2, 3); ]]
[[ global_s32 &x[] = u32[](0, 1, 2, 3); ]]
[[ global_s64 &x[] = u64[](0, 1, 2, 3); ]]

[[ global_s8  &x[] = s16[](0, 1, 2, 3); ]]
[[ global_s16 &x[] = f16[](0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_s32 &x[] = f32[](0.0f, 0.0f); ]]
[[ global_s64 &x[] = f64[](0.0, 0.0); ]]
[[ global_s16 &x[] = s8 [](0, 1, 2, 3); ]]
[[ global_s32 &x[] = s64[](0, 1, 2, 3); ]]
[[ global_s64 &x[] = s32[](0, 1, 2, 3); ]]

[[ global_f16 &x[] = f32[](0.0f); ]]
[[ global_f16 &x[] = f64[](0.0); ]]
[[ global_f32 &x[] = f16[](0.0h); ]]
[[ global_f32 &x[] = f64[](0.0); ]]
[[ global_f64 &x[] = f16[](0.0h); ]]
[[ global_f64 &x[] = f32[](0.0f); ]]

[[ global_f16 &x[] = s16[](0, 1, 2, 3); ]]
[[ global_f16 &x[] = u16[](0, 1, 2, 3); ]]
[[ global_f32 &x[] = s32[](0, 1, 2, 3); ]]
[[ global_f32 &x[] = u32[](0, 1, 2, 3); ]]
[[ global_f64 &x[] = s64[](0, 1, 2, 3); ]]
[[ global_f64 &x[] = u64[](0, 1, 2, 3); ]]

[[ global_u16 &x[] = u8x4 []( u8x4 (-1, -1, -1, -1) ); ]]
[[ global_s32 &x[] = s8x4 []( s8x4 (-1, -1, -1, -1) ); ]]
[[ global_f64 &x[] = u16x2[]( u16x2(-1, -1) ); ]]
[[ global_u16 &x[] = s16x2[]( s16x2(-1, -1) ); ]]
[[ global_s32 &x[] = u8x8 []( u8x8 (-1, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_f64 &x[] = s8x8 []( s8x8 (-1, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_u16 &x[] = u16x4[]( u16x4(-1, 0, 0, 0) ); ]]
[[ global_s32 &x[] = s16x4[]( s16x4(-1, 0, 0, 0) ); ]]
[[ global_f64 &x[] = u32x2[]( u32x2(-1, 0) ); ]]
[[ global_u16 &x[] = s32x2[]( s32x2(-1, 0) ); ]]
[[ global_s32 &x[] = u8x16[]( u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_f64 &x[] = s8x16[]( s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_u16 &x[] = u16x8[]( u16x8(-1, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_s32 &x[] = s16x8[]( s16x8(-1, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_f64 &x[] = u32x4[]( u32x4(-1, 0, 0, 0) ); ]]
[[ global_u16 &x[] = s32x4[]( s32x4(-1, 0, 0, 0) ); ]]
[[ global_s32 &x[] = u64x2[]( u64x2(-1, 0) ); ]]
[[ global_f64 &x[] = s64x2[]( s64x2(-1, 0) ); ]]
[[ global_u16 &x[] = f16x2[]( f16x2(1.0h, 0.0h) ); ]]
[[ global_s32 &x[] = f16x4[]( f16x4(1.0h, 0.0h, 0.0h, 0.0h) ); ]]
[[ global_f64 &x[] = f16x8[]( f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h) ); ]]
[[ global_u16 &x[] = f32x2[]( f32x2(1.0f, 0.0f) ); ]]
[[ global_s32 &x[] = f32x4[]( f32x4(1.0f, 0.0f, 1.0f, 0.0f) ); ]]
[[ global_f64 &x[] = f64x2[]( f64x2(1.0, 0.0) ); ]]

[[ extension "IMAGE"; global_u16 &x[] = rwimg[]( rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx) ); ]]
[[ extension "IMAGE"; global_s32 &x[] = roimg[]( roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx) ); ]]
[[ extension "IMAGE"; global_f64 &x[] = woimg[]( woimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx) ); ]]
[[ extension "IMAGE"; global_u16 &x[] = samp[](  samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border) ); ]]

[[ global_s32 &x[] = sig64[]( sig64(-0), sig64(0x00) ); ]]
[[ global_f64 &x[] = sig64[]( sig64(0), sig64(0x00), sig64(0)); ]]

[[ global_u8x4  &x[] = u8 [](0, 1, 2, 3); ]]
[[ global_s8x4  &x[] = s8 [](0, 1, 2, 3); ]]
[[ global_u16x2 &x[] = u16[](0, 1); ]]
[[ global_s16x2 &x[] = s16[](0, 1); ]]
[[ global_u8x8  &x[] = u8 [](0, 1, 2, 3, 0, 1, 2, 3); ]]
[[ global_s8x8  &x[] = s8 [](0, 1, 2, 3, 0, 1, 2, 3); ]]
[[ global_u16x4 &x[] = u16[](0, 1, 2, 3); ]]
[[ global_s16x4 &x[] = s16[](0, 1, 2, 3); ]]
[[ global_u32x2 &x[] = u32[](0, 1); ]]
[[ global_s32x2 &x[] = s32[](0, 1); ]]
[[ global_u8x16 &x[] = u8 [](0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3); ]]
[[ global_s8x16 &x[] = s8 [](0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3); ]]
[[ global_u16x8 &x[] = u16[](0, 1, 2, 3, 0, 1, 2, 3); ]]
[[ global_s16x8 &x[] = s16[](0, 1, 2, 3, 0, 1, 2, 3); ]]
[[ global_u32x4 &x[] = u32[](0, 1, 2, 3); ]]
[[ global_s32x4 &x[] = s32[](0, 1, 2, 3); ]]
[[ global_u64x2 &x[] = u64[](0, 1); ]]
[[ global_s64x2 &x[] = s64[](0, 1); ]]
[[ global_f16x2 &x[] = f16[](0.0h, 0.0h); ]]
[[ global_f16x4 &x[] = f16[](0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_f16x8 &x[] = f16[](0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ global_f32x2 &x[] = f32[](0.0f, 0.0f); ]]
[[ global_f32x4 &x[] = f32[](0.0f, 0.0f, 0.0f, 0.0f); ]]
[[ global_f64x2 &x[] = f64[](0.0, 0.0); ]]

[[ global_u8x4  &x[] = s8x4 []( u8x4 (-1, -1, -1, -1) ); ]]
[[ global_s8x4  &x[] = u8x4 []( s8x4 (-1, -1, -1, -1) ); ]]
[[ global_u16x2 &x[] = s16x2[]( u16x2(-1, -1) ); ]]
[[ global_s16x2 &x[] = u16x2[]( s16x2(-1, -1) ); ]]
[[ global_u8x8  &x[] = s8x8 []( u8x8 (-1, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_s8x8  &x[] = u8x8 []( s8x8 (-1, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_u16x4 &x[] = s16x4[]( u16x4(-1, 0, 0, 0) ); ]]
[[ global_s16x4 &x[] = u16x4[]( s16x4(-1, 0, 0, 0) ); ]]
[[ global_u32x2 &x[] = s32x2[]( u32x2(-1, 0) ); ]]
[[ global_s32x2 &x[] = u32x2[]( s32x2(-1, 0) ); ]]
[[ global_u8x16 &x[] = s8x16[]( u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_s8x16 &x[] = u8x16[]( s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_u16x8 &x[] = s16x8[]( u16x8(-1, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_s16x8 &x[] = u16x8[]( s16x8(-1, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_u32x4 &x[] = s32x4[]( u32x4(-1, 0, 0, 0) ); ]]
[[ global_s32x4 &x[] = u32x4[]( s32x4(-1, 0, 0, 0) ); ]]
[[ global_u64x2 &x[] = s64x2[]( u64x2(-1, 0) ); ]]
[[ global_s64x2 &x[] = u64x2[]( s64x2(-1, 0) ); ]]
[[ global_f16x2 &x[] = f32x2[]( f32x2(1.0f, 0.0f) ); ]]
[[ global_f16x4 &x[] = f32x4[]( f32x4(1.0f, 0.0f, 1.0f, 0.0f) ); ]]
[[ global_f16x8 &x[] = f64x2[]( f64x2(1.0, 0.0) ); ]]
[[ global_f32x2 &x[] = f16x2[]( f16x2(1.0h, 0.0h) ); ]]
[[ global_f32x4 &x[] = f16x4[]( f16x4(1.0h, 0.0h, 0.0h, 0.0h) ); ]]
[[ global_f64x2 &x[] = f16x8[]( f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h) ); ]]

[[ global_u8x8  &x[] = u8x4 []( u8x4 (-1, -1, -1, -1) ); ]]
[[ global_u8x8  &x[] = s8x4 []( s8x4 (-1, -1, -1, -1) ); ]]
[[ global_u8x8  &x[] = u16x2[]( u16x2(-1, -1) ); ]]
[[ global_u8x8  &x[] = s16x2[]( s16x2(-1, -1) ); ]]
[[ global_u8x8  &x[] = s8x8 []( s8x8 (-1, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_u8x8  &x[] = u16x4[]( u16x4(-1, 0, 0, 0) ); ]]
[[ global_u8x8  &x[] = s16x4[]( s16x4(-1, 0, 0, 0) ); ]]
[[ global_u8x8  &x[] = u32x2[]( u32x2(-1, 0) ); ]]
[[ global_u8x8  &x[] = s32x2[]( s32x2(-1, 0) ); ]]
[[ global_u8x8  &x[] = u8x16[]( u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_u8x8  &x[] = s8x16[]( s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_u8x8  &x[] = u16x8[]( u16x8(-1, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_u8x8  &x[] = s16x8[]( s16x8(-1, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_u8x8  &x[] = u32x4[]( u32x4(-1, 0, 0, 0) ); ]]
[[ global_u8x8  &x[] = s32x4[]( s32x4(-1, 0, 0, 0) ); ]]
[[ global_u8x8  &x[] = u64x2[]( u64x2(-1, 0) ); ]]
[[ global_u8x8  &x[] = s64x2[]( s64x2(-1, 0) ); ]]
[[ global_u8x8  &x[] = f16x2[]( f16x2(1.0h, 0.0h) ); ]]
[[ global_u8x8  &x[] = f16x4[]( f16x4(1.0h, 0.0h, 0.0h, 0.0h) ); ]]
[[ global_u8x8  &x[] = f16x8[]( f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h) ); ]]
[[ global_u8x8  &x[] = f32x2[]( f32x2(1.0f, 0.0f) ); ]]
[[ global_u8x8  &x[] = f32x4[]( f32x4(1.0f, 0.0f, 1.0f, 0.0f) ); ]]
[[ global_u8x8  &x[] = f64x2[]( f64x2(1.0, 0.0) ); ]]

[[ global_s32x4 &x[] = u8x4 []( u8x4 (-1, -1, -1, -1) ); ]]
[[ global_s32x4 &x[] = s8x4 []( s8x4 (-1, -1, -1, -1) ); ]]
[[ global_s32x4 &x[] = u16x2[]( u16x2(-1, -1) ); ]]
[[ global_s32x4 &x[] = s16x2[]( s16x2(-1, -1) ); ]]
[[ global_s32x4 &x[] = u8x8 []( u8x8 (-1, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_s32x4 &x[] = s8x8 []( s8x8 (-1, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_s32x4 &x[] = u16x4[]( u16x4(-1, 0, 0, 0) ); ]]
[[ global_s32x4 &x[] = s16x4[]( s16x4(-1, 0, 0, 0) ); ]]
[[ global_s32x4 &x[] = u32x2[]( u32x2(-1, 0) ); ]]
[[ global_s32x4 &x[] = s32x2[]( s32x2(-1, 0) ); ]]
[[ global_s32x4 &x[] = u8x16[]( u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_s32x4 &x[] = s8x16[]( s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_s32x4 &x[] = u16x8[]( u16x8(-1, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_s32x4 &x[] = s16x8[]( s16x8(-1, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_s32x4 &x[] = u32x4[]( u32x4(-1, 0, 0, 0) ); ]]
[[ global_s32x4 &x[] = u64x2[]( u64x2(-1, 0) ); ]]
[[ global_s32x4 &x[] = s64x2[]( s64x2(-1, 0) ); ]]
[[ global_s32x4 &x[] = f16x2[]( f16x2(1.0h, 0.0h) ); ]]
[[ global_s32x4 &x[] = f16x4[]( f16x4(1.0h, 0.0h, 0.0h, 0.0h) ); ]]
[[ global_s32x4 &x[] = f16x8[]( f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h) ); ]]
[[ global_s32x4 &x[] = f32x2[]( f32x2(1.0f, 0.0f) ); ]]
[[ global_s32x4 &x[] = f32x4[]( f32x4(1.0f, 0.0f, 1.0f, 0.0f) ); ]]
[[ global_s32x4 &x[] = f64x2[]( f64x2(1.0, 0.0) ); ]]

[[ global_f16x8 &x[] = u8x4 []( u8x4 (-1, -1, -1, -1) ); ]]
[[ global_f16x8 &x[] = s8x4 []( s8x4 (-1, -1, -1, -1) ); ]]
[[ global_f16x8 &x[] = u16x2[]( u16x2(-1, -1) ); ]]
[[ global_f16x8 &x[] = s16x2[]( s16x2(-1, -1) ); ]]
[[ global_f16x8 &x[] = u8x8 []( u8x8 (-1, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_f16x8 &x[] = s8x8 []( s8x8 (-1, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_f16x8 &x[] = u16x4[]( u16x4(-1, 0, 0, 0) ); ]]
[[ global_f16x8 &x[] = s16x4[]( s16x4(-1, 0, 0, 0) ); ]]
[[ global_f16x8 &x[] = u32x2[]( u32x2(-1, 0) ); ]]
[[ global_f16x8 &x[] = s32x2[]( s32x2(-1, 0) ); ]]
[[ global_f16x8 &x[] = u8x16[]( u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_f16x8 &x[] = s8x16[]( s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_f16x8 &x[] = u16x8[]( u16x8(-1, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_f16x8 &x[] = s16x8[]( s16x8(-1, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_f16x8 &x[] = u32x4[]( u32x4(-1, 0, 0, 0) ); ]]
[[ global_f16x8 &x[] = s32x4[]( s32x4(-1, 0, 0, 0) ); ]]
[[ global_f16x8 &x[] = u64x2[]( u64x2(-1, 0) ); ]]
[[ global_f16x8 &x[] = s64x2[]( s64x2(-1, 0) ); ]]
[[ global_f16x8 &x[] = f16x2[]( f16x2(1.0h, 0.0h) ); ]]
[[ global_f16x8 &x[] = f16x4[]( f16x4(1.0h, 0.0h, 0.0h, 0.0h) ); ]]
[[ global_f16x8 &x[] = f32x2[]( f32x2(1.0f, 0.0f) ); ]]
[[ global_f16x8 &x[] = f32x4[]( f32x4(1.0f, 0.0f, 1.0f, 0.0f) ); ]]
[[ global_f16x8 &x[] = f64x2[]( f64x2(1.0, 0.0) ); ]]

[[ extension "IMAGE"; global_u8x4  &x[] = rwimg[]( rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx) ); ]]
[[ extension "IMAGE"; global_s8x4  &x[] = roimg[]( roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx) ); ]]
[[ extension "IMAGE"; global_u16x2 &x[] = woimg[]( woimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx) ); ]]
[[ extension "IMAGE"; global_s16x2 &x[] = samp[](  samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border) ); ]]
[[ extension "IMAGE"; global_u16x4 &x[] = rwimg[]( rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx) ); ]]
[[ extension "IMAGE"; global_s16x4 &x[] = roimg[]( roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx) ); ]]
[[ extension "IMAGE"; global_u32x2 &x[] = woimg[]( woimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx) ); ]]
[[ extension "IMAGE"; global_s32x2 &x[] = samp[](  samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border) ); ]]
[[ extension "IMAGE"; global_u16x8 &x[] = rwimg[]( rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx) ); ]]
[[ extension "IMAGE"; global_s16x8 &x[] = roimg[]( roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx) ); ]]
[[ extension "IMAGE"; global_u32x4 &x[] = woimg[]( woimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx) ); ]]
[[ extension "IMAGE"; global_s32x4 &x[] = samp[](  samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border) ); ]]
[[ extension "IMAGE"; global_f16x2 &x[] = rwimg[]( rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx) ); ]]
[[ extension "IMAGE"; global_f16x4 &x[] = roimg[]( roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx) ); ]]
[[ extension "IMAGE"; global_f16x8 &x[] = woimg[]( woimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx) ); ]]
[[ extension "IMAGE"; global_f32x2 &x[] = samp[](  samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border) ); ]]

[[ global_u8x8  &x[] = sig64[]( sig64(-0), sig64(0x00) ); ]]
[[ global_s8x8  &x[] = sig64[]( sig64(0), sig64(0x00), sig64(0)); ]]
[[ global_u8x16 &x[] = sig64[]( sig64(-0), sig64(0x00) ); ]]
[[ global_s8x16 &x[] = sig64[]( sig64(0), sig64(0x00), sig64(0)); ]]
[[ global_u64x2 &x[] = sig64[]( sig64(-0), sig64(0x00) ); ]]
[[ global_s64x2 &x[] = sig64[]( sig64(0), sig64(0x00), sig64(0)); ]]
[[ global_f32x4 &x[] = sig64[]( sig64(-0), sig64(0x00) ); ]]
[[ global_f64x2 &x[] = sig64[]( sig64(0), sig64(0x00), sig64(0)); ]]

[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = s8 [](0, 1, 2, 3); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = s16[](0, 1, 2, 3); ]]
[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = s64[](0, 1, 2, 3); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = s16[](0, 1, 2, 3); ]]
[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = s64[](0, 1, 2, 3); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = u64[](0, 1, 2, 3); ]]
[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = f16[](0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = f32[](0.0f, 0.0f); ]]
[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = u8 [](0, 1, 2, 3); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = u64[](0, 1, 2, 3); ]]

[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = u8x4 []( u8x4 (-1, -1, -1, -1) ); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = s8x4 []( s8x4 (-1, -1, -1, -1) ); ]]
[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = s16x2[]( s16x2(-1, -1) ); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = u8x8 []( u8x8 (-1, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = u16x4[]( u16x4(-1, 0, 0, 0) ); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = s16x4[]( s16x4(-1, 0, 0, 0) ); ]]
[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = s32x2[]( s32x2(-1, 0) ); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = u8x16[]( u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = u16x8[]( u16x8(-1, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = s16x8[]( s16x8(-1, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = s32x4[]( s32x4(-1, 0, 0, 0) ); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = u64x2[]( u64x2(-1, 0) ); ]]
[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = f16x2[]( f16x2(1.0h, 0.0h) ); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = f16x4[]( f16x4(1.0h, 0.0h, 0.0h, 0.0h) ); ]]
[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = f32x2[]( f32x2(1.0f, 0.0f) ); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = f32x4[]( f32x4(1.0f, 0.0f, 1.0f, 0.0f) ); ]]

[[ global_sig64 &x[] = u16x2[]( u16x2(-1, -1) ); ]]
[[ global_sig64 &x[] = s8x8 []( s8x8 (-1, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_sig64 &x[] = u32x2[]( u32x2(-1, 0) ); ]]
[[ global_sig64 &x[] = s8x16[]( s8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) ); ]]
[[ global_sig64 &x[] = u32x4[]( u32x4(-1, 0, 0, 0) ); ]]
[[ global_sig64 &x[] = s64x2[]( s64x2(-1, 0) ); ]]
[[ global_sig64 &x[] = f16x8[]( f16x8(1.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h, 0.0h) ); ]]
[[ global_sig64 &x[] = f64x2[]( f64x2(1.0, 0.0) ); ]]
[[ global_sig64 &x[] = s32[](0, 1, 2, 3); ]]
[[ global_sig64 &x[] = s32[](0, 1, 2, 3); ]]
[[ global_sig64 &x[] = u16[](0, 1, 2, 3); ]]
[[ global_sig64 &x[] = f64[](0.0, 0.0); ]]
[[ global_sig64 &x[] = u32[](0, 1, 2, 3); ]]

[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = woimg[]( woimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx) ); ]]
[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = roimg[]( roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx) ); ]]
[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = samp[](  samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border) ); ]]
[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = sig64[]( sig64(-0), sig64(0x00) ); ]]

[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = woimg[]( woimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx) ); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = roimg[]( roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx) ); ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = sig64[]( sig64(-0), sig64(0x00) ); ]]

[[ extension "IMAGE";  global_sig64 &x[] = samp[](  samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border) ); ]]
[[ extension "IMAGE";  global_sig64 &x[] = woimg[]( woimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx) ); ]]
[[ extension "IMAGE";  global_sig64 &x[] = roimg[]( roimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx) ); ]]

                                 
/////////////////////////////////////////////////////////////////////////////////////////////////////////

// conv1.aggregate.to.bit

[[ global_b8 &x   = {u8(0) }; ]]
[[ global_b16 &x  = {u16(0)}; ]]
[[ global_b32 &x  = {u32(0)}; ]]
[[ global_b64 &x  = {u64(0)}; ]]
[[ global_b128 &x = {u64(0), u64(0)}; ]]

// conv1.aggregate.to.int

[[ global_s8 &x  = {s8(0) }; ]]
[[ global_s16 &x = {s16(0)}; ]]
[[ global_s32 &x = {s32(0)}; ]]
[[ global_s64 &x = {s64(0)}; ]]
[[ global_u8 &x  = {u8(0) }; ]]
[[ global_u16 &x = {u16(0)}; ]]
[[ global_u32 &x = {u32(0)}; ]]
[[ global_u64 &x = {u64(0)}; ]]

// conv1.aggregate.to.float

[[ global_f16 &x = {u16(0)}; ]]
[[ global_f32 &x = {u32(0)}; ]]
[[ global_f64 &x = {u64(0)}; ]]

// conv1.aggregate.to.packed

[[ global_u8x4  &x = {u8(0), u8(0), u8(0), u8(0)}; ]]
[[ global_s8x4  &x = {s32(0) }; ]]
[[ global_u16x2 &x = {u16(0) }; ]]
[[ global_s16x2 &x = {s16(0), s16(0)}; ]]
[[ global_u8x8  &x = {s64(0) }; ]]
[[ global_s8x8  &x = {s64(0) }; ]]
[[ global_u16x4 &x = {s64(0) }; ]]
[[ global_s16x4 &x = {s64(0) }; ]]
[[ global_u32x2 &x = {s64(0) }; ]]
[[ global_s32x2 &x = {s64(0) }; ]]
[[ global_u8x16 &x = {s64(0), s64(0) }; ]]
[[ global_s8x16 &x = {s64(0), s64(0) }; ]]
[[ global_u16x8 &x = {s64(0), s64(0) }; ]]
[[ global_s16x8 &x = {s64(0), s64(0) }; ]]
[[ global_u32x4 &x = {s64(0), s64(0) }; ]]
[[ global_s32x4 &x = {s64(0), s64(0) }; ]]
[[ global_u64x2 &x = {u64(0), u64(0) }; ]]
[[ global_s64x2 &x = {s64(0), s64(0) }; ]]
[[ global_f16x2 &x = {f16(0.0h), f16(0.0h)}; ]]
[[ global_f16x4 &x = {f16(0.0h), f16(0.0h), f16(0.0h), f16(0.0h)}; ]]
[[ global_f16x8 &x = {f16(0.0h), f16(0.0h), f16(0.0h), f16(0.0h), f16(0.0h), f16(0.0h), f16(0.0h), f16(0.0h)}; ]]
[[ global_f32x2 &x = {f32(0.0f), f32(0.0f)}; ]]
[[ global_f32x4 &x = {f32(0.0f), f32(0.0f), f32(0.0f), f32(0.0f)}; ]]
[[ global_f64x2 &x = {f64(0.0), f64(0.0)}; ]]

// conv1.aggregate.to.opaque

[[ extension "IMAGE"; alloc(agent) global_rwimg &x = {u64(0)}; ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x = {u64(0)}; ]]
[[ global_sig64 &x = {u64(0)}; ]]

// conv1.aggregate.to.array

[[ global_u8  &x[] = { u8(0)  }; ]]
[[ global_u16 &x[] = { u16(0) }; ]]
[[ global_u32 &x[] = { u32(0) }; ]]
[[ global_u64 &x[] = { u64(0) }; ]]
[[ global_u16 &x[] = { u16(0) }; ]]
[[ global_u32 &x[] = { u32(0) }; ]]
[[ global_u64 &x[] = { u64(0) }; ]]

[[ global_s8  &x[] = { s8(0)  }; ]]
[[ global_s16 &x[] = { s16(0) }; ]]
[[ global_s32 &x[] = { s32(0) }; ]]
[[ global_s64 &x[] = { s64(0) }; ]]
[[ global_s16 &x[] = { s16(0) }; ]]
[[ global_s32 &x[] = { s32(0) }; ]]
[[ global_s64 &x[] = { s64(0) }; ]]

[[ global_f32 &x[] = { f16(0.0h) }; ]]
[[ global_f64 &x[] = { f32(0.0f) }; ]]
[[ global_f64 &x[] = { f64(0.0 ) }; ]]
                  
[[ global_u8x4  &x[] = { u8 (0) }; ]]
[[ global_s8x4  &x[] = { s8 (0) }; ]]
[[ global_u16x2 &x[] = { u16(0) }; ]]
[[ global_s16x2 &x[] = { s16(0) }; ]]
[[ global_u8x8  &x[] = { u8 (0) }; ]]
[[ global_s8x8  &x[] = { s8 (0) }; ]]
[[ global_u16x4 &x[] = { u16(0) }; ]]
[[ global_s16x4 &x[] = { s16(0) }; ]]
[[ global_u32x2 &x[] = { u32(0) }; ]]
[[ global_s32x2 &x[] = { s32(0) }; ]]
[[ global_u8x16 &x[] = { u8 (0) }; ]]
[[ global_s8x16 &x[] = { s8 (0) }; ]]
[[ global_u16x8 &x[] = { u16(0) }; ]]
[[ global_s16x8 &x[] = { s16(0) }; ]]
[[ global_u32x4 &x[] = { u32(0) }; ]]
[[ global_s32x4 &x[] = { s32(0) }; ]]
[[ global_u64x2 &x[] = { u64(0) }; ]]
[[ global_s64x2 &x[] = { s64(0) }; ]]
[[ global_f16x2 &x[] = { f16(0.0h) }; ]]
[[ global_f16x4 &x[] = { f16(0.0h) }; ]]
[[ global_f16x8 &x[] = { f16(0.0h) }; ]]
[[ global_f32x2 &x[] = { f32(0.0f) }; ]]
[[ global_f32x4 &x[] = { f32(0.0f) }; ]]
[[ global_f64x2 &x[] = { f64(0.0) }; ]]

[[ extension "IMAGE"; alloc(agent) global_rwimg &x[] = { u64(0) }; ]]
[[ extension "IMAGE"; alloc(agent) global_samp  &x[] = { u64(0) }; ]]
[[ global_sig64 &x[] = { u64(0) }; ]]

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// CONSTANT CONVERSIONS IN INSTRUCTIONS

// conv1.inst.int.to.bit.128

mov_b128            $q1, 0;

// conv1.inst.typed.int.to.bit

mov_b1              $c1, s8(0);
mov_b1              $c1, u64(0);

mov_b32             $s1, s8(0);
mov_b32             $s1, u64(0);
mov_b64             $d1, s8(0);
mov_b64             $d1, u32(0);

mov_b128            $q1, s8(0);
mov_b128            $q1, u64(0);

// conv1.inst.typed.int.to.int

add_s32             $s1, $s1, s8(0);
add_s32             $s1, $s1, u32(0);
add_s32             $s1, $s1, u64(0);

add_u32             $s1, $s1, s8(0);
add_u32             $s1, $s1, s32(0);
add_u32             $s1, $s1, u64(0);

// conv1.inst.int.to.float

add_f32             $s3,$s2,0;
add_f32             $s3,$s2,u32(0);

// conv1.inst.int.to.packed

abs_p_s32x2         $d1, 0;
abs_p_s16x2         $s1, s32(0);
abs_p_f32x2         $d1, 0;
abs_p_f16x2         $s1, u32(0);

// conv1.inst.int.to.opaque

st_global_sig64            0,      [0];
st_global_sig64            u64(0), [0];

// conv1.inst.float.to.bit

mov_b1              $c1, 0.0h;
mov_b1              $c1, 0.0;

mov_b32             $s1, 0.0h;
mov_b32             $s1, 0.0;
mov_b64             $d1, 0.0h;
mov_b64             $d1, 0.0f;

mov_b128            $q1, 0.0;

// conv1.inst.typed.float.to.bit

mov_b1              $c1, f16(0.0h);
mov_b1              $c1, f64(0.0);

mov_b32             $s1, f16(0.0h);
mov_b32             $s1, f64(0.0);
mov_b64             $d1, f16(0.0h);
mov_b64             $d1, f32(0.0f);

mov_b128            $q1, s8(0);
mov_b128            $q1, u64(0);

// conv1.inst.typed.float.to.int

add_s32             $s1, $s1, f32(0.0);

// conv1.inst.float.to.float

add_f32             $s3,$s2,0.0;
add_f32             $s3,$s2,f64(0.0);
add_f32             $s3,$s2,f16(0.0h);

// conv1.inst.float.to.packed

abs_p_s32x2         $d1, 0.0;
abs_p_s16x2         $s1, f32(0.0f);
abs_p_f32x2         $d1, 0.0;
abs_p_f16x2         $s1, f32(0.0f);

// conv1.inst.float.to.opaque

st_global_sig64            0.0,      [0];
st_global_sig64            f64(0.0), [0];

// conv1.inst.packed.to.bit

mov_b1              $c1, u8x4 (-1, -1, -1, -1);

mov_b32             $s1, u8x8 (-1, 0, 0, 0, 0, 0, 0, 0);
mov_b32             $s1, u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
mov_b64             $d1, u8x4 (-1, -1, -1, -1);
mov_b64             $d1, u8x16(-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);

mov_b128            $q1, u8x4 (-1, -1, -1, -1);
mov_b128            $q1, u8x8 (-1, 0, 0, 0, 0, 0, 0, 0);

// conv1.inst.packed.to.int

add_s32             $s1, $s1, u8x4 (-1, -1, -1, -1);
add_u64             $d1, $d1, u8x8 (-1, 0, 0, 0, 0, 0, 0, 0);

// conv1.inst.packed.to.float

add_f32             $s3, $s2, f16x2(1.0h, 0.0h);
add_f32             $s3, $s2, f32x2(1.0f, 0.0f); 

// conv1.inst.packed.to.packed

abs_p_s32x2         $d1, u32x2(-1, 0);
abs_p_s32x2         $d1, f32x2(1.0f, 0.0f);
abs_p_s32x2         $d1, s16x4(-1, 0, 0, 0);

abs_p_f32x2         $d1, s32x2(-1, 0);
abs_p_f32x2         $d1, u32x2(-1, 0);
abs_p_f32x2         $d1, f16x4(1.0h, 0.0h, 0.0h, 0.0h);

// conv1.inst.packed.to.opaque

st_global_sig64            u32x2(-1, 0),  [0];

// conv1.inst.image.to.x

[[ extension "IMAGE"; ]] mov_b32        $s1,      rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx);
[[ extension "IMAGE"; ]] add_s32        $s1, $s1, rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx);
[[ extension "IMAGE"; ]] add_f32        $s3, $s2, rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx);
[[ extension "IMAGE"; ]] abs_p_s32x2    $d1,      rwimg(geometry = 3d, width = 5, height = 4, depth = 6, channel_type = unorm_int_101010, channel_order = rgbx);

// conv1.inst.sampler.to.x

[[ extension "IMAGE"; ]] mov_b32        $s1,      samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border);
[[ extension "IMAGE"; ]] add_s32        $s1, $s1, samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border);
[[ extension "IMAGE"; ]] add_f32        $s3, $s2, samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border);
[[ extension "IMAGE"; ]] abs_p_s32x2    $d1,      samp(coord = unnormalized, filter = nearest, addressing = clamp_to_border);

// conv1.inst.signal.to.x

mov_b32        $s1,      sig64(0);
add_s32        $s1, $s1, sig64(0);
add_f32        $s3, $s2, sig64(0);
abs_p_s32x2    $d1,      sig64(0);

// conv1.inst.array.to.x

mov_b32        $s1,      u32[](0);
add_s32        $s1, $s1, s32[](0);
add_f32        $s3, $s2, f32[](0.0f);
abs_p_s32x2    $d1,      s32x2[]( s32x2(0, 0) );

// conv1.inst.aggregate.to.x

mov_b32        $s1,      { u32(0)       };
add_s32        $s1, $s1, { s32(0)       };
add_f32        $s3, $s2, { f32(0.0f)    };
abs_p_s32x2    $d1,      { s32x2(0, 0)  };

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// PACKED LITERALS

// packed.const.syntax

add_pp_u8x4 $s1, $s2, u8x4;
add_pp_u8x4 $s1, $s2, u8x4();
add_pp_u8x4 $s1, $s2, u8x4(,0,0,0);
add_pp_u8x4 $s1, $s2, u8x4("",0,0,0);
add_pp_u8x4 $s1, $s2, u8x4(0,0,0);
add_pp_u8x4 $s1, $s2, u8x4(0,0,0,0,0);
add_pp_u8x4 $s1, $s2, u8x5(0,0,0,0,0);
add_pp_u8x5 $s1, $s2, u8x5(0,0,0,0,0);

// packed.const.int.elements: According to rules defined in "Packed Constants", for s/u types, the values must be integer

add_pp_u8x4  $s1, $s2, u8x4(0.0f,0,0,0);
add_pp_u8x4  $s1, $s2, u8x4(0.0,0,0,0);
add_pp_u8x4  $s1, $s2, u8x4(0.0h,0,0,0);
add_pp_u32x2 $d1, $d2, u32x2(0.0f,0);

// packed.const.float.ielements: According to rules defined in "Packed Constants", "For f types, the values must be floating-point."

add_pp_f16x2 $s1, $s2, f16x2(0,0);
add_pp_f32x2 $d1, $d2, f32x2(0,0);
add_pp_f64x2 $q1, $q2, f64x2(0,0);

// packed.const.float.felements: According to rules defined in "Packed Constants" for f types, "The floating-point constant is required to be the same size as the packed element type"

add_pp_f16x2 $s1, $s2, f16x2(0.0f,0.0f);
add_pp_f16x2 $s1, $s2, f16x2(0.0,0.0);  
add_pp_f32x2 $d1, $d2, f32x2(0.0,0.0);  
add_pp_f32x2 $d1, $d2, f32x2(0.0h,0.0h);
add_pp_f64x2 $q1, $q2, f64x2(0.0h,0.0h);
add_pp_f64x2 $q1, $q2, f64x2(0.0f,0.0f);

// packed.const.float2int: specified packed literals are incompatible with expected type

add_pp_s32x2 $d1, $d2, f32x2(0.0f,0.0f);
add_pp_s32x2 $d1, $d2, f32x4(0.0f,0.0f,0.0f,0.0f);
add_pp_s32x2 $d1, $d2, f16x2(0.0h,0.0h);

// packed.const.float2float: According to rules defined in "Packed Constants" for f types, "The floating-point constant is required to be the same size as the packed element type"

add_pp_f32x2 $s1, $s2, f16x4(0.0h,0.0h,0.0h,0.0h);
add_pp_f16x2 $s1, $s2, f32x2(0.0f,0.0f);  
add_pp_f32x2 $d1, $d2, f16x2(0.0h,0.0h);  
add_pp_f16x4 $d1, $d2, f32x2(0.0f,0.0f);
add_pp_f32x4 $q1, $q2, f64x2(0.0,0.0);
add_pp_f16x8 $q1, $q2, f64x2(0.0,0.0);
add_pp_f16x8 $q1, $q2, f32x2(0.0f,0.0f);
add_pp_f16x4 $d1, $d2, f32x2(0.0f,0.0f);
add_pp_f16x4 $d1, $d2, f64x2(0.0,0.0);
add_pp_f16x4 $d1, $d2, f16x2(0.0h,0.0h);

// packed.const.int2int: expected and actual operand types do not match. See "Type and length rule" in section "How Text Format Constants Are Converted to Bit String Constants"

add_pp_s8x4  $s1, $s2, u8x4(0,0,0,0);
add_pp_u8x4  $s1, $s2, s8x4(0,0,0,0);
add_pp_u32x2 $d1, $d2, u16x2(0,0);
add_pp_u32x2 $d1, $d2, u16x4(0,0,0,0);
add_pp_u32x2 $d1, $d2, u16x8(0,0,0,0,0,0,0,0);
add_pp_u32x2 $d1, $d2, s32x2(0,0);

// packed.const.int2float: specified packed literals are incompatible with expected type

add_pp_f16x2 $s1, $s2, s8x8(0,0,0,0,0,0,0,0);
add_pp_f16x2 $s1, $s2, s8x4(0,0,0,0);
add_pp_f32x2 $d1, $d2, s16x2(0,0);
add_pp_f32x2 $d1, $d2, s8x4(0,0,0,0);
add_pp_f32x2 $d1, $d2, s8x8(0,0,0,0,0,0,0,0);
add_pp_f32x2 $d1, $d2, s32x2(0,0);
add_pp_f32x2 $d1, $d2, u32x4(0,0,0,0);

// packed.const.typed.elements

add_pp_u8x4  $s1, $s2, u8x4(u8(0),0,0,0);
add_pp_s16x2 $s1, $s2, s16x2(0, s16(0));
add_pp_u32x2 $d1, $d2, u32x2(u32(0),0);
add_pp_f16x2 $s1, $s2, f16x2(f16(0.0h), 0.0h);
add_pp_f32x2 $d1, $d2, f32x2(f32(0.0f), 0.0f);
add_pp_f64x2 $q1, $q2, f64x2(f64(0.0), 0.0);

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// INTEGER LITERALS

// int.literal.limits

global_s32 %x[0xFFFFFFFFFFFFFFFFF]; 
global_s32 %k3 = 0xFFFFFFFFFFFFFFFFF;
global_s32 %k3 = 0x10000000000000001;
global_s32 %k3 = 0x10000000000000000;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// FLOATING_POINT LITERALS

// fp.literal.limits

global_f16 %k3 = 999999999999999999999999999999999999999.H;
global_f16 %k3 = .1e40H;

global_f32 %k3 = 999999999999999999999999999999999999999.F;
global_f32 %k3 = .1e40F;

global_f64 %k3 = 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999.;
global_f64 %k3 = .1e350;

global_f16 %k1 = 0h40280;
global_f32 %k2 = 0f4028b0a30;
global_f64 %k3 = 0d4028b0a3d70a3d710;

global_f64 %k3 = 0x1.8b0a3d70a3d71p+2147483648;
global_f64 %k3 = 0x1.8b0a3d70a3d71p+4294967295;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// CONVERSIONS OF CONSTANTS

// conv.packed2ipacked

add_pp_u32x2 $d1, $d2, f32x2(0.0f,0.0f);
add_pp_u32x2 $d1, $d2, f16x2(0.0h,0.0h);
add_pp_u32x2 $d1, $d2, f64x2(0.0,0.0);
add_pp_u32x2 $d1, $d2, s32x2(0,0);
add_pp_u32x2 $d1, $d2, u16x4(0,0,0,0);
add_pp_u32x2 $d1, $d2, u16x2(0,0);

// conv.f2ipacked

add_pp_u32x2 $d1, $d2, 0.0f;
add_pp_u32x2 $d1, $d2, 0.0;
add_pp_u32x2 $d1, $d2, 0.0h;

// conv.f2fpacked

add_pp_f32x2 $d1, $d2, 0.0f;
add_pp_f32x2 $d1, $d2, 0.0;
add_pp_f32x2 $d1, $d2, 0.0h;

// conv.i2fpacked

add_pp_f32x4  $q1, $q2, 0;

// conv.packed2f

add_f16  $s1, $s2, f64x2(0.0,  0.0);
add_f16  $s1, $s2, f32x2(0.0f, 0.0f);
add_f16  $s1, $s2, f16x2(0.0h, 0.0h);

add_f32  $s1, $s2, f64x2(0.0,  0.0);
add_f32  $s1, $s2, f32x2(0.0f, 0.0f);
add_f32  $s1, $s2, f16x2(0.0h, 0.0h);

add_f64  $d1, $d2, f64x2(0.0,  0.0);
add_f64  $d1, $d2, f32x2(0.0f, 0.0f);
add_f64  $d1, $d2, f16x2(0.0h, 0.0h);

// conv.i2f

add_f16  $s1, $s2, 0;
add_f32  $s1, $s2, 0;
add_f64  $d1, $d2, 0;

// conv.f2f

add_f16  $s1, $s2, 0.0; 
add_f16  $s1, $s2, 0.0f;
add_f32  $s1, $s2, 0.0h;
add_f32  $s1, $s2, 0.0; 
add_f64  $d1, $d2, 0.0h;
add_f64  $d1, $d2, 0.0f;

// conv.f2i

add_s32  $s1, $s2, 0.0h;
add_s32  $s1, $s2, 0.0f;
add_s32  $s1, $s2, 0.0;

// conv.packed2i

add_s32  $s1, $s2, f16x2(0.0h,0.0h);
add_s32  $s1, $s2, u16x2(0,0);
add_u32  $s1, $s2, u32x2(0,0);
add_u32  $s1, $s2, u32x4(0,0,0,0);
add_s64  $d1, $d2, u16x2(0,0);
add_u64  $d1, $d2, u32x2(0,0);
add_u64  $d1, $d2, u32x4(0,0,0,0);

// conv.f2b

mov_b64  $d1, 0.0f;
mov_b64  $d1, 0.0h;
mov_b32  $s1, 0.0;
mov_b32  $s1, 0.0h;

// conv.packed2b

mov_b64  $d1, u64x2(0,0);
mov_b64  $d1, f32x4(0.0f,0.0f,0.0f,0.0f);
mov_b128 $q1, s32x2(0,0);

// conv.i2b128: expected type is wider than 64 bit
mov_b128  $q1, 0;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// CONSTANTS IN DIRECTIVES AND MODIFIERS

// const.align.invalid

align(-4)   global_s32 %x01;
align(+4)   global_s32 %x01;
align(4.0)  global_s32 %x01;
ld_group_align(-4)_f64  $d1, [0];
ld_group_align(+4)_f64  $d1, [0];
ld_group_align(4.0)_f64 $d1, [0];

// const.dim.invalid

global_u32 %x02[-3];
global_u32 %x02[+3];
global_u32 %a02[3.0];

// const.equiv.invalid

ld_global_equiv(-1)_f64  $d1, [0];
ld_global_equiv(+1)_f64  $d1, [0];
ld_global_equiv(4.0)_f64 $d1, [0];

// const.width.invalid

ld_global_width(-2)_f64  $d1, [0];
ld_global_width(+2)_f64  $d1, [0];
ld_global_width(4.0)_f64 $d1, [0];

// const.offset.invalid

ld_global_width(2)_f64 $d1, [0.0];

// const.loc.invalid

loc -2;
loc +2;
loc 2.0;

// const.module.invalid

[[ module &name:+1:0:$full:$large:$zero; ]]
[[ module &name:-1:0:$full:$large:$zero; ]]
[[ module &name:1:+0:$full:$large:$zero; ]]
[[ module &name:1:-0:$full:$large:$zero; ]]

// const.image.invalid

[[ readonly_roimg &x1 = roimg(geometry = 3d, width = +5, height =  4, depth =  6, channel_type = unorm_int_101010, channel_order = r);       ]]
[[ readonly_roimg &x2 = roimg(geometry = 3d, width =  5, height = +4, depth =  6, channel_type = unorm_int_101010, channel_order = r);       ]]
[[ readonly_roimg &x3 = roimg(geometry = 3d, width =  5, height =  4, depth = +6, channel_type = unorm_int_101010, channel_order = r);       ]]
[[ readonly_roimg &x4 = roimg(geometry = 2da, width = 5, height =  4, array = +4, channel_type = unorm_int_101010, channel_order = rgbx);    ]]
[[ readonly_roimg &x5 = roimg(geometry = 3d, width = -5, height =  4, depth =  6, channel_type = unorm_int_101010, channel_order = r);       ]]
[[ readonly_roimg &x6 = roimg(geometry = 3d, width =  5, height = -4, depth =  6, channel_type = unorm_int_101010, channel_order = r);       ]]
[[ readonly_roimg &x7 = roimg(geometry = 3d, width =  5, height =  4, depth = -6, channel_type = unorm_int_101010, channel_order = r);       ]]
[[ readonly_roimg &x8 = roimg(geometry = 2da, width = 5, height =  4, array = -4, channel_type = unorm_int_101010, channel_order = rgbx);    ]]

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// CONSTANTS IN INITIALIZERS

// initializer.int

global_u32   %x = 0.0;
global_u64   %x = 0.0;
global_s64   %x = 0.0;
global_u32   %x = u16x2(0,0);
global_s64   %x[] = s64[](0, 0.0);

// initializer.bit

global_b16   %x   = 0.0f;
global_b16   %x   = 0.0;
global_b32   %x   = 0.0h;
global_b32   %x   = 0.0;
global_b64   %x   = 0.0h;
global_b64   %x   = 0.0f;
global_b64   %x[] = f64[](0.0, 0.1);
global_b32   %x   = s8x8(0,0,0,0,0,0,0,0);
global_b32   %x   = f64x2(0.0,0.0);
global_b64   %x   = s8x4(0,0,0,0);
global_b128  %x   = s16x2(0,0);
global_b128  %x[] = s16x8[](s16x8(0,0,0,0,0,0,0,0));

// initializer.bit128: 64-bit literals are not expanded to 128 bit

global_b128   %x = 0xFFFFFFFFFFFFFFFF;
global_b128   %x = 0;

// initializer.float

global_f16   %x   = f16x2(0.0h,0.0h);
global_f32   %x   = f16x2(0.0h,0.0h);
global_f64   %x   = f32x2(0.0f,0.0f);
global_f64   %x[] = f64[](0.0, f32x2(0.0f,0.0f));

// initializer.float.by.float

global_f16   %x = 0.0f;
global_f16   %x = 0.0d;
global_f32   %x = 0.0h;
global_f32   %x = 0.0d;
global_f64   %x = 0.0h;
global_f64   %x = 0.0f;
global_f64   %x[] = f64[](0.0f, 0.0h);

// initializer.float.by.int: conversion from int to float is not allowed

global_f16   %x = 0;
global_f32   %x = 0;
global_f64   %x = 0;
global_f64   %x[] = u64[](0, 0, 0);

// initializer.packed

global_u16x8  %x   = 0xFFFFFFFFFFFFFFFF;
global_u32x4  %x   = 0xFFFFFFFFFFFFFFFF;
global_s64x2  %x   = 0xFFFFFFFFFFFFFFFF;
global_s32x2  %x   = 0.0;
global_f32x2  %x   = 0.0;
global_f32x2  %x[] = f32x2[](f32x2(0.0f,0.0f), f32(0.0));
global_u16x4  %x = f16x4(0.0h,0.0h,0.0h,0.0h);
global_s32x2  %x = f32x2(0.0f,0.0f);
global_u64x2  %x = f64x2(0.0,0.0);
global_f16x4  %x = s16x4(0.0h,0.0h,0.0h,0.0h);
global_f32x2  %x = u32x2(0.0f,0.0f);
global_f64x2  %x = s64x2(0.0,0.0);

global_f32x2  %x = f16x4(0.0h,0.0h,0.0h,0.0h);
global_f16x4  %x = f32x2(0.0h,0.0h,0.0h,0.0h);

global_u8x4   %x = s8x4 (0,0,0,0);
global_s8x8   %x = u8x8 (0,0,0,0,0,0,0,0);
global_u16x4  %x = s16x4(0,0,0,0);
global_u32x2  %x = s32x2(0,0);
global_u32x2  %x[] = u32x2[](s32x2(0,0), s32x2(1,1));

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// CONSTANTS IN CONTROL DIRECTIVES

// const.control.float

enablebreakexceptions       7.0;
enabledetectexceptions      7.0;
maxdynamicgroupsize         1.0;
maxflatgridsize             1.0;          // Must be an immediate value greater than 0, or WAVESIZE.
maxflatworkgroupsize        1.0;          // Must be an immediate value greater than 0, or WAVESIZE.
requireddim                 3.0;          // Must be an immediate value with the value 1, 2, or 3.
requiredgridsize            7.0, 8, 9;    // Must be an immediate value greater than 0, or WAVESIZE.
requiredworkgroupsize       2.0, 2, 2;    // Must be an immediate value greater than 0, or WAVESIZE.

// const.control.packed

enablebreakexceptions       s8x4(0,0,0,0);
enabledetectexceptions      s8x4(0,0,0,0);
maxdynamicgroupsize         s8x4(0,0,0,0);
maxflatgridsize             s8x4(0,0,0,0);          // Must be an immediate value greater than 0, or WAVESIZE.
maxflatworkgroupsize        s8x4(0,0,0,0);          // Must be an immediate value greater than 0, or WAVESIZE.
requireddim                 s8x4(0,0,0,0);          // Must be an immediate value with the value 1, 2, or 3.
requiredgridsize            s8x4(0,0,0,0), 8, 9;    // Must be an immediate value greater than 0, or WAVESIZE.
requiredworkgroupsize       s8x4(0,0,0,0), 2, 2;    // Must be an immediate value greater than 0, or WAVESIZE.

// const.control.sign

enablebreakexceptions       +7;
enabledetectexceptions      +7;
maxdynamicgroupsize         +1;
maxflatgridsize             +1;          // Must be an immediate value greater than 0, or WAVESIZE.
maxflatworkgroupsize        +1;          // Must be an immediate value greater than 0, or WAVESIZE.
requireddim                 +3;          // Must be an immediate value with the value 1, 2, or 3.
requiredgridsize            +7, +8, +9;  // Must be an immediate value greater than 0, or WAVESIZE.
requiredworkgroupsize       +2, +2, +2;  // Must be an immediate value greater than 0, or WAVESIZE.

enablebreakexceptions       +0x7;
enabledetectexceptions      +0x7;
maxdynamicgroupsize         +0x1;
maxflatgridsize             +0x1;              // Must be an immediate value greater than 0, or WAVESIZE.
maxflatworkgroupsize        +0x1;              // Must be an immediate value greater than 0, or WAVESIZE.
requireddim                 +0x3;              // Must be an immediate value with the value 1, 2, or 3.
requiredgridsize            +0x7, +0x8, +0x9;    // Must be an immediate value greater than 0, or WAVESIZE.
requiredworkgroupsize       +0x2, +0x2, +0x2;    // Must be an immediate value greater than 0, or WAVESIZE.

enablebreakexceptions       -007;
enabledetectexceptions      -007;
maxdynamicgroupsize         -001;
maxflatgridsize             -001;              // Must be an immediate value greater than 0, or WAVESIZE.
maxflatworkgroupsize        -001;              // Must be an immediate value greater than 0, or WAVESIZE.

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// GLOBAL NAMESPACE

// namespace.global

[[ function &x()(){};           kernel     &x(){};      ]]
[[ function &x()(){};           signature  &x()();      ]]
[[ function &x()(){};           global_s32 &x;          ]]
[[ function &x()(){};           function &x()(){};      ]]

[[ kernel &x(){};               function   &x()(){};    ]]
[[ kernel &x(){};               signature  &x()();      ]]
[[ kernel &x(){};               global_s32 &x;          ]]
[[ kernel &x(){};               kernel     &x(){};      ]]

[[ signature &x()();            function   &x()(){};    ]]
[[ signature &x()();            kernel     &x(){};      ]]
[[ signature &x()();            global_s32 &x;          ]]

[[ global_s32 &x;               function   &x()(){};    ]]
[[ global_s32 &x;               kernel     &x(){};      ]]
[[ global_s32 &x;               signature  &x()();      ]]
[[ global_s32 &x;               global_s32 &x;          ]]

[[ function &x()(){};           fbarrier   &x;          ]]
[[ kernel &x(){};               fbarrier   &x;          ]]
[[ signature &x()();            fbarrier   &x;          ]]
[[ global_s32 &x;               fbarrier   &x;          ]]

[[ fbarrier &x;                 function   &x()(){};    ]]
[[ fbarrier &x;                 kernel     &x(){};      ]]
[[ fbarrier &x;                 global_s32 &x;          ]]
[[ fbarrier &x;                 signature  &x()();      ]]
[[ fbarrier &x;                 fbarrier   &x;          ]]


[[ function &x()(){};    kernel     &x(){};      ]]
[[ function &x()(){};    global_s32 &x;          ]]
[[ function &x()(){};    function &x()(){};      ]]
                         
[[ kernel &x(){};        function   &x()(){};    ]]
[[ kernel &x(){};        global_s32 &x;          ]]
[[ kernel &x(){};        kernel     &x(){};      ]]
                         
[[ global_s32 &x;        function   &x()(){};    ]]
[[ global_s32 &x;        kernel     &x(){};      ]]
[[ global_s32 &x;        global_s32 &x;          ]]


/// I assume that fbarriers and signatures have module linkage so the following tests are not necessary
///
/// [[ signature &x()();     function   &x()(){};    ]]
/// [[ signature &x()();     kernel     &x(){};      ]]
/// [[ signature &x()();     global_s32 &x;          ]]
/// [[ function &x()(){};    signature  &x()();      ]]
/// [[ kernel &x(){};        signature  &x()();      ]]
/// [[ global_s32 &x;        signature  &x()();      ]]
///
/// [[ function &x()(){};    fbarrier   &x;          ]]
/// [[ kernel &x(){};        fbarrier   &x;          ]]
/// [[ signature &x()();     fbarrier   &x;          ]]
/// [[ global_s32 &x;        fbarrier   &x;          ]]


[[ decl function &x()();                      kernel &x(){}; ]]
[[ prog function &x()(){};                    kernel &x(){}; ]]
[[ kernel &x(){};                               decl function &x()(); ]]
[[ kernel &x(){};                               prog function &x()(){}; ]]

[[ decl function &x()();                      global_s32 &x; ]]
[[ function &x()(){};                           global_s32 &x; ]]
[[ global_s32 &x;                               function &x()(){}; ]]

[[ prog function &x()(){};                    global_s32 &x; ]]
[[ function &x()(){};                           prog global_s32 &x; ]]
[[ global_s32 &x;                               prog function &x()(){}; ]]
[[ prog function &x()(){};                    prog global_s32 &x; ]]

[[ function &x()(){};                           decl global_s32 &x; ]]
[[ decl global_s32 &x;                        function &x()(){}; ]]
[[ decl global_s32 &x;                        decl function &x()();   ]]

[[ prog global_s32 &k; global_s32 &k; ]]
[[ global_s32 &k; prog global_s32 &k; ]]

[[ prog global_s32 &k; decl global_s32 &k; ]]
[[ decl global_s32 &k; prog global_s32 &k; ]]


/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// LOCAL NAMESPACE

// namespace.local

global_s32 %k; global_s32 %k;

[[ function &f(arg_u32 %x)(){ { call &f (%arg0) (); } } ]]
[[ function &f()(arg_u32 %x){ { call &f () (%arg0); } } ]]


/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// COMMENTS

/*

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// ADDRESSES

// address.expressions

[[ group_s32 &x; ]] ld_group_s8  $s1, [&x + 1];
[[ group_s32 &x; ]] ld_group_s8  $s1, [&x - 1];
[[ group_s32 &x; ]] ld_group_s8  $s1, [1 + &x];
[[ group_s32 &x; ]] ld_group_s8  $s1, [1 - &x];

[[ fbarrier &fb; ]] ld_group_s8  $s1, [&fb];
fbarrier %fb; ld_group_s8  $s1, [%fb];
fbarrier %fb; lda_group_u32    $s4, [%fb];


/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// REGISTERS

// register.number

st_v2_global_u8	($s2147483647, $s0), [0];
st_v2_global_u8	($s2147483648, $s0), [0];
st_v2_global_u8	($s2147483649, $s0), [0];
st_v2_global_u8	($s4294967295, $s0), [0];
st_v2_global_u8	($s4294967296, $s0), [0];
st_v2_global_u8	($s4294967297, $s0), [0];
st_v2_global_u8	($s0, $s65535), [0];
st_v3_global_u8	($s0, $s0, $s65536), [0];
st_v4_global_u8	($s0, $s0, $s0, $s65537), [0];

pragma $c2147483647;
pragma $c2147483648;
pragma $c2147483649;
pragma $c65535;
pragma $c65536;
pragma $c65537;

pragma $s2147483647;
pragma $d2147483648;
pragma $q2147483649;
pragma $s4294967295;
pragma $d4294967296;
pragma $q4294967297;
pragma $s65535;
pragma $d65536;
pragma $q65537;

// register.number.limit

cmov_b32        $s0, $c0, $s0, $s0;     cmov_b32        $s1, $c128, $s1, $s2;       cmov_b32        $s0, $c0, $s0, $s0;
abs_s32         $s0, $s0;               abs_s32         $s2048, $s2;                abs_s32         $s0, $s0;
abs_s_s8x8      $d0, $d0;               abs_s_s8x8      $d1024, $d1;                abs_s_s8x8      $d0, $d0;
abs_s_s64x2     $q0, $q0;               abs_s_s64x2     $q512,  $q1;                abs_s_s64x2     $q0, $q0;
abs_s_s64x2     $q0, $q0;               abs_s_s64x2     $q512,  $q2;                abs_s_s64x2     $q0, $q0;

abs_s_s64x2     $q511, $q1;             abs_s32         $s1, $s0;                   abs_s_s32x2     $d0, $d0;
abs_s_s64x2     $q510, $q1;             abs_s32         $s2, $s0;                   abs_s_s32x2     $d0, $d0;
abs_s_s64x2     $q510, $q1;             abs_s32         $s1, $s0;                   abs_s_s32x2     $d1, $d0;

// register.number.limit.with.vector

st_v2_global_u8	    ($s0, $s0), [0];            abs_s32         $s2048, $s2;						abs_s32         $s0, $s0;
st_v3_global_u64	($d0, $d0, $d0), [0];       abs_s_s8x8      $d1024, $d1;						abs_s_s8x8      $d0, $d0;
st_v4_global_b128	($q0, $q0, $q0, $q0), [0];  abs_s_s64x2     $q512,  $q1;						abs_s_s64x2     $q0, $q0;

abs_s32         $s0, $s0;						st_v2_global_u8	    ($s2048, $s0), [0];				abs_s32         $s0, $s0;
abs_s_s8x8      $d0, $d0;						st_v3_global_u64	($d0, $d1024, $d0), [0];        abs_s_s8x8      $d0, $d0;
abs_s_s64x2     $q0, $q0;						st_v4_global_b128	($q0, $q0, $q0, $q512), [0];    abs_s_s64x2     $q0, $q0;

abs_s32         $s0, $s0;						abs_s32         $s2048, $s2;						st_v2_global_u8	    ($s0, $s0), [0];          
abs_s_s8x8      $d0, $d0;						abs_s_s8x8      $d1024, $d1;						st_v3_global_u64	($d0, $d0, $d0), [0];     
abs_s_s64x2     $q0, $q0;						abs_s_s64x2     $q512,  $q1;						st_v4_global_b128	($q0, $q0, $q0, $q0), [0];

// register.number.limit.with.pragma

pragma          $s0, $c0, $s0, $s0;     cmov_b32        $s1, $c128, $s1, $s2;       cmov_b32        $s0, $c0, $s0, $s0;
pragma          $s0, $s0;               abs_s32         $s2048, $s2;                abs_s32         $s0, $s0;
pragma          $d0, $d0;               abs_s_s8x8      $d1024, $d1;                abs_s_s8x8      $d0, $d0;
pragma          $q0, $q0;               abs_s_s64x2     $q512,  $q1;                abs_s_s64x2     $q0, $q0;
pragma          $q0, $q0;               abs_s_s64x2     $q512,  $q2;                abs_s_s64x2     $q0, $q0;
pragma          $q511, $q1;             abs_s32         $s1, $s0;                   abs_s_s32x2     $d0, $d0;
pragma          $q510, $q1;             abs_s32         $s2, $s0;                   abs_s_s32x2     $d0, $d0;
pragma          $q510, $q1;             abs_s32         $s1, $s0;                   abs_s_s32x2     $d1, $d0;

cmov_b32        $s0, $c0, $s0, $s0;     pragma          $s1, $c128, $s1, $s2;       cmov_b32        $s0, $c0, $s0, $s0;
abs_s32         $s0, $s0;               pragma          $s2048, $s2;                abs_s32         $s0, $s0;
abs_s_s8x8      $d0, $d0;               pragma          $d1024, $d1;                abs_s_s8x8      $d0, $d0;
abs_s_s64x2     $q0, $q0;               pragma          $q512,  $q1;                abs_s_s64x2     $q0, $q0;
abs_s_s64x2     $q0, $q0;               pragma          $q512,  $q2;                abs_s_s64x2     $q0, $q0;
abs_s_s64x2     $q511, $q1;             pragma          $s1, $s0;                   abs_s_s32x2     $d0, $d0;
abs_s_s64x2     $q510, $q1;             pragma          $s2, $s0;                   abs_s_s32x2     $d0, $d0;
abs_s_s64x2     $q510, $q1;             pragma          $s1, $s0;                   abs_s_s32x2     $d1, $d0;

cmov_b32        $s0, $c0, $s0, $s0;     cmov_b32        $s1, $c128, $s1, $s2;       pragma    $s0, $c0, $s0, $s0;
abs_s32         $s0, $s0;               abs_s32         $s2048, $s2;                pragma    $s0, $s0;
abs_s_s8x8      $d0, $d0;               abs_s_s8x8      $d1024, $d1;                pragma    $d0, $d0;
abs_s_s64x2     $q0, $q0;               abs_s_s64x2     $q512,  $q1;                pragma    $q0, $q0;
abs_s_s64x2     $q0, $q0;               abs_s_s64x2     $q512,  $q2;                pragma    $q0, $q0;
abs_s_s64x2     $q511, $q1;             abs_s32         $s1, $s0;                   pragma    $d0, $d0;
abs_s_s64x2     $q510, $q1;             abs_s32         $s2, $s0;                   pragma    $d0, $d0;
abs_s_s64x2     $q510, $q1;             abs_s32         $s1, $s0;                   pragma    $d1, $d0;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// VECTORS

// register.vector.dst.dup

expand_v2_b32_b64       ($s0, $s0),             $d0;
ld_v3_s32               ($s0, $s6, $s0),        [$d3+4];
expand_v4_b32_b128      ($s0, $s1, $s2, $s0),   $q0;
ld_v4_b128	            ($q0, $q1, $q0, $q3),   [0];

// register.vector.size

expand_v2_b32_b64       ($s0, $d1),             $d0;
ld_v3_s32               ($s0, $s1, $d2),        [$d3+4];
expand_v4_b32_b128      ($s0, $s1, $s2, $d3),   $q0;
ld_v4_b128	            ($q0, $q1, $d2, $q3),   [0];
ld_v4_b128	            ($q0, $q1, $s2, $q3),   [0];

// register.vector.number

expand_v2_b32_b64       ($s0),                      $d0;
expand_v4_b32_b128      ($s0, $s1, $s2, $s3, $s4),  $q0;
ld_v4_b128	            ($q0, $q1, $q3),            [0];

// vector.imm.in.dst

expand_v4_b32_b128      (0, $s1, $s2, $s3),   $q0;                 
expand_v4_b32_b128      ($s0, 1, $s2, $s3),   $q0;                 
expand_v4_b32_b128      ($s0, $s1, 2, $s3),   $q0;                 
expand_v4_b32_b128      ($s0, $s1, $s2, 3),   $q0;                 

ld_v4_s8                (1,$s2,$s3,$s4), [$d3+4];
ld_v4_s8                ($s1,$s2,$s3,4), [$d3+4];

activelanemask_v4_b64_b1 (1, $d2, $d3, $d4), $c0;
activelanemask_v4_b64_b1 ($d1, $d2, $d3, 4), $c0;

ld_v4_b128	            ($q0, $q1, s64x2(0, 0), $q3),   [0];

// vector.ws.in.dst

expand_v4_b32_b128      (WAVESIZE, $s1, $s2, $s3),   $q0;                 
expand_v4_b32_b128      ($s0, WAVESIZE, $s2, $s3),   $q0;                 
expand_v4_b32_b128      ($s0, $s1, WAVESIZE, $s3),   $q0;                 
expand_v4_b32_b128      ($s0, $s1, $s2, WAVESIZE),   $q0;                 

ld_v4_s8                (WAVESIZE,$s2,$s3,$s4), [$d3+4];
ld_v4_s8                ($s1,$s2,$s3,WAVESIZE), [$d3+4];

activelanemask_v4_b64_b1 (WAVESIZE, $d2, $d3, $d4), $c0;
activelanemask_v4_b64_b1 ($d1, $d2, $d3, WAVESIZE), $c0;

ld_v4_b128	            ($q0, $q1, WAVESIZE, $q3),   [0];

// vector.imm.number

expand_v2_b32_b64       (0),              $d0;
expand_v4_b32_b128      (0, 1, 2, 3, 4),  $q0;
expand_v4_b32_b128      ($s0, $s1, $s2, $s3, 4),  $q0;

// vector.imm.type.mismatch

st_v4_u8                   (1,$s2,1.0h,$s4), [$d3+4];
st_v4_s16                  (1,$s2,1.0h,$s4), [$d3+4];
st_v4_s16                  (1.0h,$s2,1,$s4), [$d3+4];
st_v4_s16                  (1.0h,$s2,1.0,WAVESIZE), [$d3+4];

st_v4_f16                  (1.0h,$s2,1,$s4), [$d3+4];
st_v4_f32                  (1,$s2,1.0f,$s4), [$d3+4];
st_v4_f32                  (1.0h,$s2,1.0f,$s4), [$d3+4];
st_v4_b128	               ($q0, $q0, 0, $q0), [$d0];
st_v4_b128	               ($q0, $q0, sig64(0), $q0), [$d0];

st_v2_global_sig64         (0, 0),           [0];
st_v2_global_sig64         (u64(0), u64(0)), [0];

// vector.ws.type.mismatch

st_v4_f32                   (WAVESIZE,$s2,$s3,$s4), [$d3+4];
st_v4_f32                   ($s2,$s3,$s4,WAVESIZE), [$d3+4];
st_v4_f32                   (1.0f,WAVESIZE,1.0f,1.0f), [$d3+4];
st_v4_b128	                ($q0, $q0, WAVESIZE, $q0), [$d0];

// vector.reg.type.mismatch

st_v4_u8                   (1,$s2,0,$c4), [$d3+4];
st_v4_u8                   (1,$s2,0,$d4), [$d3+4];
st_v4_s16                  (1,$d2,0,$s4), [$d3+4];
st_v4_s16                  (1,$s2,0,$d4), [$d3+4];
st_v4_s16                  (1,$d2,1,$s4), [$d3+4];

// vector.imm.reg.mismatch

st_v2_u8                   (1.0h,$s4), [$d3+4];
st_v2_u8                   ($s4,1.0h), [$d3+4];
st_v2_u8                   (1,$d4), [$d3+4];
st_v2_u8                   ($d4,1), [$d3+4];
st_v2_u8                   (1,$c4), [$d3+4];
st_v2_u8                   ($c4,1), [$d3+4];
st_v2_u8                   (1,$q4), [$d3+4];
st_v2_u8                   ($q4,1), [$d3+4];

st_v2_f16                  (1.0h,$d4), [$d3+4];
st_v2_f16                  (1.0h,$c4), [$d3+4];

st_v2_f32                  (1.0f,$d4), [$d3+4];
st_v2_f64                  (1.0, $s4), [$d3+4];

st_v2_s64                  ($d4, s32x2(0,0)), [$d3+4];
st_v2_s64                  (s32x2(0,0), $d4), [$d3+4];

st_v2_u8                   (2,$c4), [$d3+4];
st_v2_u8                   ($c4,2), [$d3+4];

// vector.syntax

combine_v4_b128_b32     $q0 ($s0, $s1, $s2, $s3;   
expand_v4_b32_b128      $s0, $s1, $s2, $s3;

combine_v4_b128_b32     $q0 ($s0, $s1, $s2, $s3);   
expand_v4_b32_b128      $s0, $s1, $s2, $s3),   $q0;                 

combine_v4_b128_b32     $q0, ($s0, $s1, $s2, $s3;   
expand_v4_b32_b128      ($s0, $s1, $s2, $s3;

combine_v4_b128_b32     $q0 (0, 1, 2, 3;   
combine_v4_b128_b32     0 (0, 1, 2, 3);   
expand_v4_b32_b128      0, 1, 2, 3;

combine_v4_b128_b32     $q0 (0, 1, 2, 3);   
expand_v4_b32_b128      0, 1, 2, 3),   $q0;                 

combine_v4_b128_b32     $q0, (0, 1, 2, 3;   
expand_v4_b32_b128      (0, 1, 2, 3;
expand_v4_b32_b128      (0, 1, 2, 3

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// DELIMITERS: WHITESPACE IS REQUIRED BETWEEN LEXICAL TOKENS THAT CAN INCLUDE ALPHABETIC OR NUMERIC CHARACTERS

// lex.delimiters.comment

[[ /**/module &name:1:0:$full:$large:$zero; ]]
[[ /**/extension "";                        ]]
[[ /**///123                                ]]
[[ /**//*123*/                              ]]
[[ /**/loc 1 "abc";                         ]]
[[ /**/pragma "abc";                        ]]

[[ /**/global_f64 &x;                       ]]
[[ /**/prog global_f64 &x;                  ]]
[[ /**/decl global_f64 &x; global_f64 &x;   ]]
[[ /**/const global_f64 &x = 0.0;           ]]
[[ /**/align(16) global_f64 &x;             ]]
[[ /**/fbarrier &x;                         ]]
[[ /**/prog fbarrier &x;                    ]]
[[ /**/decl fbarrier &x; fbarrier &x;       ]]

[[ extension "IMAGE"; /**/alloc(agent) global_roimg &x;        ]]

[[ /**/function &fn()(){};                  ]]
[[ /**/decl prog function &fn()();          ]]
[[ /**/prog function &fn()(){};             ]]
[[ /**/indirect function &fn()(){};         ]]

[[ /**/kernel &k(){};                       ]]
[[ /**/decl prog kernel &k();               ]]
[[ /**/prog kernel &k(){};                  ]]

[[ /**/signature &x()();                    ]]

/**/@lab:

// lex.delimiters.string

[[ extension"";                             ]]
[[ loc 1"";                                 ]]
[[ loc 1 2"";                               ]]
[[ pragma"";                                ]]

// lex.delimiters.global.identifier

[[ module&name:1:0:$full:$large:$zero;      ]]
[[ global_f64&x;                            ]]
[[ fbarrier&x;                              ]]
[[ function&fn()(){};                       ]]
[[ kernel&k(){};                            ]]
[[ signature&x()();                         ]]
[[ global_f64 &x; pragma&x;                 ]]
[[ function &x()() { { call&x()(); } };     ]]

// lex.delimiters.local.identifier

global_f64%x;
fbarrier%x;
fbarrier %fb; initfbar%fb;
fbarrier %fb; joinfbar%fb;
fbarrier %fb; waitfbar%fb;
fbarrier %fb; arrivefbar%fb;
fbarrier %fb; leavefbar%fb;
fbarrier %fb; releasefbar%fb;
global_f64 %x; pragma%x;

[[ function &x()(arg_s32%x){}; ]]

// lex.delimiters.label

@lab: pragma@lab;
@lab: br@lab;

// lex.delimiters.register

pragma$c0;
pragma$s0;
pragma$d0;
pragma$q0;
not_b1$c0,$c1;
neg_s32$s0,$s1;
neg_s64$d0,$d1;
neg_s_s8x16$q0,$q1;

// lex.delimiters.number

[[ kernel &k() { st_global_f64.0,[0]; }; ]]
pragma.0;


/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/// ACCESS TO MEMORY ALLOCATED FOR VARIABLES AND ARRAYS

// named.memory.access.ld

[[ function &TestArgSeg()(arg_b128 %arg) { ld_arg_s8  $s1, [%arg][-1];                       }; ]]
[[ function &TestArgSeg()(arg_b128 %arg) { ld_arg_s8  $s1, [%arg][16];                       }; ]]
[[ function &TestArgSeg()(arg_b128 %arg) { ld_arg_s8  $s1, [%arg][17];                       }; ]]

[[ function &TestArgSeg()(arg_b128 %arg) { ld_v2_arg_s8  ($s1, $s2), [%arg][-1];             }; ]]
[[ function &TestArgSeg()(arg_b128 %arg) { ld_v2_arg_s8  ($s1, $s2), [%arg][-2];             }; ]]
[[ function &TestArgSeg()(arg_b128 %arg) { ld_v2_arg_s8  ($s1, $s2), [%arg][15];             }; ]]
[[ function &TestArgSeg()(arg_b128 %arg) { ld_v2_arg_s8  ($s1, $s2), [%arg][16];             }; ]]

[[ function &TestArgSeg()(arg_b128 %arg) { ld_v3_arg_s8  ($s1, $s2, $s3), [%arg][14];        }; ]]
[[ function &TestArgSeg()(arg_b128 %arg) { ld_v3_arg_s8  ($s1, $s2, $s3), [%arg][15];        }; ]]
[[ function &TestArgSeg()(arg_b128 %arg) { ld_v3_arg_s8  ($s1, $s2, $s3), [%arg][16];        }; ]]

[[ function &TestArgSeg()(arg_b128 %arg) { ld_v4_arg_s8  ($s1, $s2, $s3, $s4), [%arg][13];   }; ]]
[[ function &TestArgSeg()(arg_b128 %arg) { ld_v4_arg_s8  ($s1, $s2, $s3, $s4), [%arg][14];   }; ]]
[[ function &TestArgSeg()(arg_b128 %arg) { ld_v4_arg_s8  ($s1, $s2, $s3, $s4), [%arg][15];   }; ]]
[[ function &TestArgSeg()(arg_b128 %arg) { ld_v4_arg_s8  ($s1, $s2, $s3, $s4), [%arg][16];   }; ]]

[[ function &TestArgSeg()(arg_b128 %arg) { ld_arg_s16  $s1, [%arg][-1];                       }; ]]
[[ function &TestArgSeg()(arg_b128 %arg) { ld_arg_s16  $s1, [%arg][15];                       }; ]]
[[ function &TestArgSeg()(arg_b128 %arg) { ld_arg_s16  $s1, [%arg][16];                       }; ]]
[[ function &TestArgSeg()(arg_b128 %arg) { ld_arg_s16  $s1, [%arg][17];                       }; ]]


[[ function &TestArgSeg()(arg_b128 %arg) { ld_arg_s32  $s1, [%arg][-1];                       }; ]]
[[ function &TestArgSeg()(arg_b128 %arg) { ld_arg_s32  $s1, [%arg][13];                        }; ]]
[[ function &TestArgSeg()(arg_b128 %arg) { ld_arg_s32  $s1, [%arg][14];                        }; ]]
[[ function &TestArgSeg()(arg_b128 %arg) { ld_arg_s32  $s1, [%arg][15];                        }; ]]

[[ function &TestArgSeg()(arg_b128 %arg) { ld_arg_s64  $d1, [%arg][-1];                       }; ]]
[[ function &TestArgSeg()(arg_b128 %arg) { ld_arg_s64  $d1, [%arg][9];                        }; ]]
[[ function &TestArgSeg()(arg_b128 %arg) { ld_arg_s64  $d1, [%arg][10];                        }; ]]
[[ function &TestArgSeg()(arg_b128 %arg) { ld_arg_s64  $d1, [%arg][11];                        }; ]]
[[ function &TestArgSeg()(arg_b128 %arg) { ld_arg_s64  $d1, [%arg][12];                        }; ]]
[[ function &TestArgSeg()(arg_b128 %arg) { ld_arg_s64  $d1, [%arg][13];                        }; ]]
[[ function &TestArgSeg()(arg_b128 %arg) { ld_arg_s64  $d1, [%arg][14];                        }; ]]
[[ function &TestArgSeg()(arg_b128 %arg) { ld_arg_s64  $d1, [%arg][15];                        }; ]]

[[ function &TestArgSeg()(arg_b128 %arg)   { ld_v2_arg_f64 ($d1, $d2), [%arg][-1];                }; ]]
[[ function &TestArgSeg()(arg_b128 %arg)   { ld_v2_arg_f64 ($d1, $d2), [%arg][1];                 }; ]]
[[ function &TestArgSeg()(arg_b8 %arg[17]) { ld_v2_arg_f64 ($d1, $d2), [%arg][2];                 }; ]]
[[ function &TestArgSeg()(arg_b8 %arg[24]) { ld_v3_arg_f64 ($d1, $d2, $d3), [%arg][1];            }; ]]
[[ function &TestArgSeg()(arg_b8 %arg[24]) { ld_v4_arg_f64 ($d1, $d2, $d3, $d4), [%arg][1];       }; ]]

[[ function &TestArgSeg()(arg_b128 %arg)   { ld_arg_b128 $q1, [%arg][1];                 }; ]]

[[ extension "IMAGE"; function &TestArgSeg()(arg_samp %arg[2]) { ld_arg_samp    $d1,                  [%arg][-1];   }; ]]
[[ extension "IMAGE"; function &TestArgSeg()(arg_samp %arg[2]) { ld_arg_samp    $d1,                  [%arg][9];    }; ]]
[[ extension "IMAGE"; function &TestArgSeg()(arg_samp %arg[2]) { ld_arg_samp    $d1,                  [%arg][10];   }; ]]
[[ extension "IMAGE"; function &TestArgSeg()(arg_samp %arg[2]) { ld_arg_samp    $d1,                  [%arg][11];   }; ]]
[[ extension "IMAGE"; function &TestArgSeg()(arg_samp %arg[2]) { ld_arg_samp    $d1,                  [%arg][12];   }; ]]
[[ extension "IMAGE"; function &TestArgSeg()(arg_samp %arg[2]) { ld_arg_samp    $d1,                  [%arg][13];   }; ]]
[[ extension "IMAGE"; function &TestArgSeg()(arg_samp %arg[2]) { ld_arg_samp    $d1,                  [%arg][14];   }; ]]
[[ extension "IMAGE"; function &TestArgSeg()(arg_samp %arg[2]) { ld_arg_samp    $d1,                  [%arg][15];   }; ]]

// named.memory.access.st

[[ function &TestArgSeg(arg_b128 %arg) ()  { st_arg_s8  $s1, [%arg][-1];                       }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_arg_s8  $s1, [%arg][16];                       }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_arg_s8  $s1, [%arg][17];                       }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_v2_arg_s8  ($s1, $s2), [%arg][-1];             }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_v2_arg_s8  ($s1, $s2), [%arg][-2];             }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_v2_arg_s8  ($s1, $s2), [%arg][15];             }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_v2_arg_s8  ($s1, $s2), [%arg][16];             }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_v3_arg_s8  ($s1, $s2, $s3), [%arg][14];        }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_v3_arg_s8  ($s1, $s2, $s3), [%arg][15];        }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_v3_arg_s8  ($s1, $s2, $s3), [%arg][16];        }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_v4_arg_s8  ($s1, $s2, $s3, $s4), [%arg][13];   }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_v4_arg_s8  ($s1, $s2, $s3, $s4), [%arg][14];   }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_v4_arg_s8  ($s1, $s2, $s3, $s4), [%arg][15];   }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_v4_arg_s8  ($s1, $s2, $s3, $s4), [%arg][16];   }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_arg_s16  $s1, [%arg][-1];                       }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_arg_s16  $s1, [%arg][15];                       }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_arg_s16  $s1, [%arg][16];                       }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_arg_s16  $s1, [%arg][17];                       }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_arg_s32  $s1, [%arg][-1];                       }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_arg_s32  $s1, [%arg][13];                        }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_arg_s32  $s1, [%arg][14];                        }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_arg_s32  $s1, [%arg][15];                        }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_arg_s64  $d1, [%arg][-1];                       }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_arg_s64  $d1, [%arg][9];                        }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_arg_s64  $d1, [%arg][10];                        }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_arg_s64  $d1, [%arg][11];                        }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_arg_s64  $d1, [%arg][12];                        }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_arg_s64  $d1, [%arg][13];                        }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_arg_s64  $d1, [%arg][14];                        }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_arg_s64  $d1, [%arg][15];                        }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_v2_arg_f64 ($d1, $d2), [%arg][-1];                }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_v2_arg_f64 ($d1, $d2), [%arg][1];                 }; ]]
[[ function &TestArgSeg(arg_b8 %arg[17])() { st_v2_arg_f64 ($d1, $d2), [%arg][2];                 }; ]]
[[ function &TestArgSeg(arg_b8 %arg[24])() { st_v3_arg_f64 ($d1, $d2, $d3), [%arg][1];            }; ]]
[[ function &TestArgSeg(arg_b8 %arg[24])() { st_v4_arg_f64 ($d1, $d2, $d3, $d4), [%arg][1];       }; ]]
[[ function &TestArgSeg(arg_b128 %arg) ()  { st_arg_b128 $q1, [%arg][1];                 }; ]]

[[ extension "IMAGE"; function &TestArgSeg(arg_samp %arg[2])() { st_arg_samp    $d1,                  [%arg][-1];   }; ]]
[[ extension "IMAGE"; function &TestArgSeg(arg_samp %arg[2])() { st_arg_samp    $d1,                  [%arg][9];    }; ]]
[[ extension "IMAGE"; function &TestArgSeg(arg_samp %arg[2])() { st_arg_samp    $d1,                  [%arg][10];   }; ]]
[[ extension "IMAGE"; function &TestArgSeg(arg_samp %arg[2])() { st_arg_samp    $d1,                  [%arg][11];   }; ]]
[[ extension "IMAGE"; function &TestArgSeg(arg_samp %arg[2])() { st_arg_samp    $d1,                  [%arg][12];   }; ]]
[[ extension "IMAGE"; function &TestArgSeg(arg_samp %arg[2])() { st_arg_samp    $d1,                  [%arg][13];   }; ]]
[[ extension "IMAGE"; function &TestArgSeg(arg_samp %arg[2])() { st_arg_samp    $d1,                  [%arg][14];   }; ]]
[[ extension "IMAGE"; function &TestArgSeg(arg_samp %arg[2])() { st_arg_samp    $d1,                  [%arg][15];   }; ]]

// named.memory.access.st.max.offset

[[ global_s32 &x[0x3FFFFFFFFFFFFFFF]; function &tst()() { st_global_s32   $s0, [&x][0xFFFFFFFFFFFFFFF9]; }; ]]
[[ global_s32 &x[0x3FFFFFFFFFFFFFFF]; function &tst()() { st_global_s64   $d0, [&x][0xFFFFFFFFFFFFFFF5]; }; ]]
[[ global_s32 &x[0x3FFFFFFFFFFFFFFF]; function &tst()() { st_global_b128  $q0, [&x][0xFFFFFFFFFFFFFFED]; }; ]]

// named.memory.access.atomic

[[ function &TestArgSeg()()  { global_b128 %x; atomic_ld_global_rlx_system_b32     $s1, [%x][-1];                 }; ]]
[[ function &TestArgSeg()()  { global_b128 %x; atomic_ld_global_rlx_system_b32     $s1, [%x][13];                 }; ]]

// named.memory.access.atomicnoret

[[ function &TestArgSeg()()  { global_b128 %x; atomicnoret_st_global_rlx_wave_b32 [%x][-1],  $s1;                }; ]]
[[ function &TestArgSeg()()  { global_b128 %x; atomicnoret_st_global_rlx_wave_b32 [%x][13],  $s1;                }; ]]

/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
///F ADD GCN TESTS

///F POSTPONED: 
///F improve diagnostics for vector operands (show position inside), e.g. 
///F            st_v2_f32 (1.0f,$d4), [$d3+4];
///F
///F
///F code after sbr and scall is unreachable!