blob: 5c770077f7bbab017cd380f303338dc63c343023 [file] [log] [blame]
/*
* Copyright (c) 2014 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "media.h"
#pragma OPENCL EXTENSION cl_amd_media_ops2 : enable
__attribute__((overloadable,always_inline,const)) uint2 amd_bfm(uint2 v1, uint2 v2 )
{
uint2 ret;
ret.x = __hsail_bfm(v1.x,v2.x);
ret.y = __hsail_bfm(v1.y,v2.y);
return ret;
}
__attribute__((overloadable,always_inline,const)) uint3 amd_bfm(uint3 v1, uint3 v2)
{
uint3 ret;
ret.x = __hsail_bfm(v1.x,v2.x);
ret.y = __hsail_bfm(v1.y,v2.y);
ret.z = __hsail_bfm(v1.z,v2.z);
return ret;
}
__attribute__((overloadable,always_inline,const)) uint4 amd_bfm(uint4 v1, uint4 v2)
{
uint4 ret;
ret.x = __hsail_bfm(v1.x,v2.x);
ret.y = __hsail_bfm(v1.y,v2.y);
ret.z = __hsail_bfm(v1.z,v2.z);
ret.w = __hsail_bfm(v1.w,v2.w);
return ret;
}
__attribute__((overloadable,always_inline,const)) uint8 amd_bfm(uint8 v1, uint8 v2)
{
uint8 ret;
ret.s0 = __hsail_bfm(v1.s0,v2.s0);
ret.s1 = __hsail_bfm(v1.s1,v2.s1);
ret.s2 = __hsail_bfm(v1.s2,v2.s2);
ret.s3 = __hsail_bfm(v1.s3,v2.s3);
ret.s4 = __hsail_bfm(v1.s4,v2.s4) ;
ret.s5 = __hsail_bfm(v1.s5,v2.s5);
ret.s6 = __hsail_bfm(v1.s6,v2.s6 );
ret.s7 = __hsail_bfm(v1.s7,v2.s7);
return ret;
}
__attribute__((overloadable,always_inline,const)) uint16 amd_bfm(uint16 v1, uint16 v2)
{
uint16 ret;
ret.s0 = __hsail_bfm(v1.s0,v2.s0);
ret.s1 = __hsail_bfm(v1.s1,v2.s1);
ret.s2 = __hsail_bfm(v1.s2,v2.s2);
ret.s3 = __hsail_bfm(v1.s3,v2.s3);
ret.s4 = __hsail_bfm(v1.s4,v2.s4) ;
ret.s5 = __hsail_bfm(v1.s5,v2.s5);
ret.s6 = __hsail_bfm(v1.s6,v2.s6);
ret.s7 = __hsail_bfm(v1.s7,v2.s7);
ret.s8 = __hsail_bfm(v1.s8,v2.s8 );
ret.s9 = __hsail_bfm(v1.s9,v2.s9);
ret.sa = __hsail_bfm(v1.sa,v2.sa);
ret.sb = __hsail_bfm(v1.sb,v2.sb);
ret.sc = __hsail_bfm(v1.sc,v2.sc);
ret.sd = __hsail_bfm(v1.sd,v2.sd);
ret.se = __hsail_bfm(v1.se,v2.se);
ret.sf= __hsail_bfm(v1.sf,v2.sf);
return ret;
}
__attribute__((overloadable,always_inline,const)) uint amd_bfm(uint v1, uint v2)
{
return __hsail_bfm(v1,v2);
}