PNaCl vector intrisics WIP.

This commit is contained in:
Branimir Karadžić
2014-06-26 22:36:04 -07:00
parent 2ea546dba0
commit bb01733bfc
12 changed files with 82 additions and 25 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 Branimir Karadzic. All rights reserved.
* Copyright 2010-2014 Branimir Karadzic. All rights reserved.
* License: http://www.opensource.org/licenses/BSD-2-Clause
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 Branimir Karadzic. All rights reserved.
* Copyright 2010-2014 Branimir Karadzic. All rights reserved.
* License: http://www.opensource.org/licenses/BSD-2-Clause
*/
@@ -42,6 +42,14 @@ namespace bx
return result;
}
BX_FLOAT4_INLINE float4_t float4_rcp_ni(float4_t _a)
{
const float4_t one = float4_splat(1.0f);
const float4_t result = float4_div(one, _a);
return result;
}
BX_FLOAT4_INLINE float4_t float4_div_nr_ni(float4_t _a, float4_t _b)
{
const float4_t oneish = float4_isplat(0x3f800001);
@@ -53,14 +61,6 @@ namespace bx
return result;
}
BX_FLOAT4_INLINE float4_t float4_rcp_ni(float4_t _a)
{
const float4_t one = float4_splat(1.0f);
const float4_t result = float4_div(one, _a);
return result;
}
BX_FLOAT4_INLINE float4_t float4_orx_ni(float4_t _a)
{
const float4_t zwxy = float4_swiz_zwxy(_a);
@@ -115,6 +115,22 @@ namespace bx
return result;
}
BX_FLOAT4_INLINE float4_t float4_min_ni(float4_t _a, float4_t _b)
{
const float4_t mask = float4_cmplt(_a, _b);
const float4_t result = float4_selb(mask, _a, _b);
return result;
}
BX_FLOAT4_INLINE float4_t float4_max_ni(float4_t _a, float4_t _b)
{
const float4_t mask = float4_cmpgt(_a, _b);
const float4_t result = float4_selb(mask, _a, _b);
return result;
}
BX_FLOAT4_INLINE float4_t float4_abs_ni(float4_t _a)
{
const float4_t a_neg = float4_neg(_a);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 Branimir Karadzic. All rights reserved.
* Copyright 2010-2014 Branimir Karadzic. All rights reserved.
* License: http://www.opensource.org/licenses/BSD-2-Clause
*/
@@ -47,7 +47,7 @@ namespace bx
uint32_t tmp = ( (_test.uxyzw[3]>>31)<<3) \
| ( (_test.uxyzw[2]>>31)<<2) \
| ( (_test.uxyzw[1]>>31)<<1) \
| (_test.uxyzw[0]>>31) \
| ( _test.uxyzw[0]>>31) \
; \
return 0 != (tmp&(_mask) ); \
} \
@@ -57,7 +57,7 @@ namespace bx
uint32_t tmp = ( (_test.uxyzw[3]>>31)<<3) \
| ( (_test.uxyzw[2]>>31)<<2) \
| ( (_test.uxyzw[1]>>31)<<1) \
| (_test.uxyzw[0]>>31) \
| ( _test.uxyzw[0]>>31) \
; \
return (_mask) == (tmp&(_mask) ); \
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 Branimir Karadzic. All rights reserved.
* Copyright 2010-2014 Branimir Karadzic. All rights reserved.
* License: http://www.opensource.org/licenses/BSD-2-Clause
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 Branimir Karadzic. All rights reserved.
* Copyright 2010-2014 Branimir Karadzic. All rights reserved.
* License: http://www.opensource.org/licenses/BSD-2-Clause
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 Branimir Karadzic. All rights reserved.
* Copyright 2010-2014 Branimir Karadzic. All rights reserved.
* License: http://www.opensource.org/licenses/BSD-2-Clause
*/
@@ -15,6 +15,8 @@
# include "float4_sse.h"
#elif __ARM_NEON__ && !BX_COMPILER_CLANG
# include "float4_neon.h"
#elif 0 // BX_COMPILER_CLANG
# include "float4_langext.h"
#else
# pragma message("************************************\nUsing SIMD reference implementation!\n************************************")
# include "float4_ref.h"

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 Branimir Karadzic. All rights reserved.
* Copyright 2010-2014 Branimir Karadzic. All rights reserved.
* License: http://www.opensource.org/licenses/BSD-2-Clause
*/