Tiny cleanups, doc update re int8/16 performance

This commit is contained in:
Matt Pharr
2011-07-21 16:04:16 +01:00
parent 8ef3df57c5
commit 165f90357f
3 changed files with 13 additions and 3 deletions

View File

@@ -93,6 +93,7 @@ Contents:
+ `Understanding How to Interoperate With the Application's Data`_ + `Understanding How to Interoperate With the Application's Data`_
+ `Communicating Between SPMD Program Instances`_ + `Communicating Between SPMD Program Instances`_
+ `Gather and Scatter`_ + `Gather and Scatter`_
+ `8 and 16-bit Integer Types`_
+ `Low-level Vector Tricks`_ + `Low-level Vector Tricks`_
+ `Debugging`_ + `Debugging`_
+ `The "Fast math" Option`_ + `The "Fast math" Option`_
@@ -2528,6 +2529,15 @@ do a vector load. For example, given:
A regular vector load is done from array, starting at offset ``2*x``. A regular vector load is done from array, starting at offset ``2*x``.
8 and 16-bit Integer Types
--------------------------
The code generated for 8 and 16-bit integer types is generally not as
efficient as the code generated for 32-bit integer types. It is generally
worthwhile to use 32-bit integer types for intermediate computations, even
if the final result will be stored in a smaller integer type.
Low-level Vector Tricks Low-level Vector Tricks
----------------------- -----------------------

View File

@@ -1659,7 +1659,7 @@ AssignExpr::TypeCheck() {
if (rvalue != NULL) if (rvalue != NULL)
rvalue = rvalue->TypeCheck(); rvalue = rvalue->TypeCheck();
if (rvalue != NULL && lvalue != NULL) if (rvalue != NULL && lvalue != NULL)
rvalue = rvalue->TypeConv(lvalue->GetType(), "operator ="); rvalue = rvalue->TypeConv(lvalue->GetType(), "assignment");
if (rvalue == NULL || lvalue == NULL) if (rvalue == NULL || lvalue == NULL)
return NULL; return NULL;

View File

@@ -2363,7 +2363,7 @@ static inline uniform float half_to_float(uniform unsigned int16 h) {
uniform unsigned int32 hs = h & (int32)0x8000u; // Pick off sign bit uniform unsigned int32 hs = h & (int32)0x8000u; // Pick off sign bit
uniform unsigned int32 he = h & (int32)0x7C00u; // Pick off exponent bits uniform unsigned int32 he = h & (int32)0x7C00u; // Pick off exponent bits
uniform unsigned int32 hm = h & (int32)0x03FFu; // Pick off mantissa bits uniform unsigned int32 hm = h & (int32)0x03FFu; // Pick off mantissa bits
cif (he == 0) { if (he == 0) {
// Denormal will convert to normalized // Denormal will convert to normalized
uniform int e = -1; uniform int e = -1;
// The following loop figures out how much extra to adjust the exponent // The following loop figures out how much extra to adjust the exponent
@@ -2485,7 +2485,7 @@ static inline uniform int16 float_to_half(uniform float f) {
ret = (xs >> 16); ret = (xs >> 16);
} }
else { else {
cif (xe == 0x7F800000u) { if (xe == 0x7F800000u) {
// Inf or NaN (all the exponent bits are set) // Inf or NaN (all the exponent bits are set)
if (xm == 0) if (xm == 0)
// Zero mantissa -> signed infinity // Zero mantissa -> signed infinity