Skip to content

Commit

Permalink
cleanup: simd.h deprecations (AcademySoftwareFoundation#4308)
Browse files Browse the repository at this point in the history
Fully remove some things that have had deprecation warnings for a long,
long time (mostly since 1.x), so we think it can't possibly break
anyone.

Add deprecation warnings to some things that have been nominally
deprecated for some time. The build warnings will serve as final notice
that they will fully disappear by OIIO 3.0 release.

This is part of a series of small steps to fully deprecate a whole lot
of cruft between now and the 3.0 release.

---------

Signed-off-by: Larry Gritz <[email protected]>
Co-authored-by: Thiago Ize <[email protected]>
  • Loading branch information
lgritz and ThiagoIze committed Jun 23, 2024
1 parent e4577d0 commit 92adbe0
Showing 1 changed file with 15 additions and 35 deletions.
50 changes: 15 additions & 35 deletions src/include/OpenImageIO/simd.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,14 @@ class vfloat16;
// These are removed from visibility for the OIIO codebase itself, or for any
// downstream project that defines OIIO_DISABLE_DEPRECATED to exclude
// declarations deprecated as of version 1.9 or later.
typedef vbool4 mask4; // old name
typedef vbool4 bool4;
typedef vbool8 bool8;
typedef vint4 int4;
typedef vint8 int8;
typedef vfloat3 float3;
typedef vfloat4 float4;
typedef vfloat8 float8;
OIIO_DEPRECATED("use vbool4") typedef vbool4 mask4; // old name
OIIO_DEPRECATED("use vbool4") typedef vbool4 bool4;
OIIO_DEPRECATED("use vbool8") typedef vbool8 bool8;
OIIO_DEPRECATED("use vint4") typedef vint4 int4;
OIIO_DEPRECATED("use vint8") typedef vint8 int8;
OIIO_DEPRECATED("use vfloat3") typedef vfloat3 float3;
OIIO_DEPRECATED("use vfloat4") typedef vfloat4 float4;
OIIO_DEPRECATED("use vfloat8") typedef vfloat8 float8;
#endif

} // namespace simd
Expand Down Expand Up @@ -964,10 +964,6 @@ class vint4 {
typedef vbool4 vbool_t; ///< bool type of the same length
typedef vfloat4 vfloat_t; ///< float type of the same length
typedef vint4 vint_t; ///< int type of the same length
OIIO_DEPRECATED("use vbool_t (1.8)")
typedef vbool4 bool_t; // old name (deprecated 1.8)
OIIO_DEPRECATED("use vfloat_t (1.8)")
typedef vfloat4 float_t; // old name (deprecated 1.8)
static constexpr size_t size() noexcept { return elements; }

/// Default constructor (contents undefined)
Expand Down Expand Up @@ -1225,6 +1221,7 @@ vint4 max (const vint4& a, const vint4& b);
/// Circular bit rotate by s bits, for N values at once.
vint4 rotl (const vint4& x, const int s);
// DEPRECATED(2.1)
OIIO_DEPRECATED("Use rotl instead")
vint4 rotl32 (const vint4& x, const unsigned int k);

/// andnot(a,b) returns ((~a) & b)
Expand Down Expand Up @@ -1260,10 +1257,6 @@ class vint8 {
typedef vbool8 vbool_t; ///< bool type of the same length
typedef vfloat8 vfloat_t; ///< float type of the same length
typedef vint8 vint_t; ///< int type of the same length
OIIO_DEPRECATED("use vbool_t (1.8)")
typedef vbool8 bool_t; // old name (deprecated 1.8)
OIIO_DEPRECATED("use vfloat_t (1.8)")
typedef vfloat8 float_t; // old name (deprecated 1.8)
static constexpr size_t size() noexcept { return elements; }

/// Default constructor (contents undefined)
Expand Down Expand Up @@ -1534,6 +1527,7 @@ vint8 max (const vint8& a, const vint8& b);
/// Circular bit rotate by s bits, for N values at once.
vint8 rotl (const vint8& x, const int s);
// DEPRECATED(2.1)
OIIO_DEPRECATED("Use rotl instead")
vint8 rotl32 (const vint8& x, const unsigned int k);

/// andnot(a,b) returns ((~a) & b)
Expand Down Expand Up @@ -1564,10 +1558,6 @@ class vint16 {
typedef vbool16 vbool_t; ///< bool type of the same length
typedef vfloat16 vfloat_t; ///< float type of the same length
typedef vint16 vint_t; ///< int type of the same length
OIIO_DEPRECATED("use vbool_t (1.8)")
typedef vbool16 bool_t; // old name (deprecated 1.8)
OIIO_DEPRECATED("use vfloat_t (1.8)")
typedef vfloat16 float_t; // old name (deprecated 1.8)
static constexpr size_t size() noexcept { return elements; }

/// Default constructor (contents undefined)
Expand Down Expand Up @@ -1850,6 +1840,7 @@ vint16 max (const vint16& a, const vint16& b);
/// Circular bit rotate by s bits, for N values at once.
vint16 rotl (const vint16& x, const int s);
// DEPRECATED(2.1)
OIIO_DEPRECATED("Use rotl instead")
vint16 rotl32 (const vint16& x, const unsigned int k);

/// andnot(a,b) returns ((~a) & b)
Expand Down Expand Up @@ -1881,10 +1872,6 @@ class vfloat4 {
typedef vfloat4 vfloat_t; ///< SIMD int type
typedef vint4 vint_t; ///< SIMD int type
typedef vbool4 vbool_t; ///< SIMD bool type
OIIO_DEPRECATED("use vbool_t (1.8)")
typedef vint4 int_t; // old name (deprecated 1.8)
OIIO_DEPRECATED("use vfloat_t (1.8)")
typedef vbool4 bool_t; // old name (deprecated 1.8)
static constexpr size_t size() noexcept { return elements; }

/// Default constructor (contents undefined)
Expand Down Expand Up @@ -2556,10 +2543,6 @@ class vfloat8 {
typedef vfloat8 vfloat_t; ///< SIMD int type
typedef vint8 vint_t; ///< SIMD int type
typedef vbool8 vbool_t; ///< SIMD bool type
OIIO_DEPRECATED("use vint_t (1.8)")
typedef vint8 int_t; // old name (deprecated 1.8)
OIIO_DEPRECATED("use vbool_t (1.8)")
typedef vbool8 bool_t; // old name (deprecated 1.8)
static constexpr size_t size() noexcept { return elements; }

/// Default constructor (contents undefined)
Expand Down Expand Up @@ -2823,6 +2806,7 @@ vfloat8 sign (const vfloat8& a); ///< 1.0 when value >= 0, -1 when negative
vfloat8 ceil (const vfloat8& a);
vfloat8 floor (const vfloat8& a);
vint8 ifloor (const vfloat8& a); ///< (int)floor
OIIO_DEPRECATED("Use ifloor instead")
inline vint8 floori (const vfloat8& a) { return ifloor(a); } // DEPRECATED(1.8) alias

/// Per-element round to nearest integer.
Expand Down Expand Up @@ -2874,10 +2858,6 @@ class vfloat16 {
typedef vfloat16 vfloat_t; ///< SIMD int type
typedef vint16 vint_t; ///< SIMD int type
typedef vbool16 vbool_t; ///< SIMD bool type
OIIO_DEPRECATED("use vint_t (1.8)")
typedef vint16 int_t; // old name (deprecated 1.8)
OIIO_DEPRECATED("use vbool_t (1.8)")
typedef vbool16 bool_t; // old name (deprecated 1.8)
static constexpr size_t size() noexcept { return elements; }

/// Default constructor (contents undefined)
Expand Down Expand Up @@ -4849,9 +4829,6 @@ OIIO_FORCEINLINE vint4 bitcast_to_int (const vbool4& x)
#endif
}

// Old names: (DEPRECATED 1.8)
OIIO_DEPRECATED("use bitcast_to_int() (1.8)")
inline vint4 bitcast_to_int4 (const vbool4& x) { return bitcast_to_int(x); }


OIIO_FORCEINLINE vint4 vreduce_add (const vint4& v) {
Expand Down Expand Up @@ -5003,6 +4980,7 @@ OIIO_FORCEINLINE vint4 rotl(const vint4& x, int s) {
}

// DEPRECATED (2.1)
OIIO_DEPRECATED("Use rotl instead")
OIIO_FORCEINLINE vint4 rotl32 (const vint4& x, const unsigned int k) {
return rotl(x, k);
}
Expand Down Expand Up @@ -5831,6 +5809,7 @@ OIIO_FORCEINLINE vint8 rotl(const vint8& x, int s) {
}

// DEPRECATED (2.1)
OIIO_DEPRECATED("Use rotl instead")
OIIO_FORCEINLINE vint8 rotl32 (const vint8& x, const unsigned int k) {
return rotl(x, k);
}
Expand Down Expand Up @@ -6638,6 +6617,7 @@ OIIO_FORCEINLINE vint16 rotl(const vint16& x, int s) {
}

// DEPRECATED (2.1)
OIIO_DEPRECATED("Use rotl instead")
OIIO_FORCEINLINE vint16 rotl32 (const vint16& x, const unsigned int k) {
return rotl(x, k);
}
Expand Down

0 comments on commit 92adbe0

Please sign in to comment.