search for: int16_max

Displaying 20 results from an estimated 25 matches for "int16_max".

Did you mean: uint16_max
2015 Jan 09
3
[RESEND/PATCH] nv50/ir: Handle OP_CVT when folding constant expressions
...; /* make sure bld is init'ed */ + switch(i->dType) { + case TYPE_U16: + switch (i->sType) { + case TYPE_F32: + if (i->saturate) + res.data.u16 = util_iround(CLAMP(imm0.reg.data.f32, 0, + UINT16_MAX)); + else + res.data.u16 = util_iround(imm0.reg.data.f32); + break; + case TYPE_F64: + if (i->saturate) + res.data.u16 = util_iround(CLAMP(imm0.reg.data.f64, 0, + UINT16_MAX)); +...
2014 Jul 05
1
[PATCH v4] nv50/ir: Handle OP_CVT when folding constant expressions
...se TYPE_U16: + switch (i->sType) { + case TYPE_F32: + if (i->saturate) { + int32_t conv = util_iround(imm0.reg.data.f32); + res.data.u16 = (conv < 0) ? 0 : CLAMP((uint32_t)conv, 0, + UINT16_MAX); + } + else res.data.u16 = util_iround(imm0.reg.data.f32); + break; + case TYPE_F64: + if (i->saturate) { + int32_t conv = util_iround(imm0.reg.data.f64); + res.data.u16 = (conv < 0) ? 0 : CLAMP((uint32_t)conv, 0...
2013 Jul 24
1
QCONST16 cross compile inconsistency
...opus_val32 celt_ener; #define SCALEIN(a) (a) #define SCALEOUT(a) (a) +/** Compile-time conversion of float constant to 16-bit value */ +#define QCONST16(x,bits) (opus_val16)( \ + (( 0.5 + (double)(x) * ((opus_val32)(1)<<(bits)) ) >= (double)(INT16_MAX) ) ? \ + (opus_val16)(INT16_MAX) : \ + (opus_val16)( 0.5 + (double)(x) * (double)((opus_val32)(1)<<(bits))) ) + +/** Compile-time conversion of float constant to 32-bit value */ +#define QCONST32(x,bits) (opus_val32)(...
2015 Jan 10
0
[RESEND/PATCH] nv50/ir: Handle OP_CVT when folding constant expressions
.../ > + switch(i->dType) { > + case TYPE_U16: > + switch (i->sType) { > + case TYPE_F32: > + if (i->saturate) > + res.data.u16 = util_iround(CLAMP(imm0.reg.data.f32, 0, > + UINT16_MAX)); > + else > + res.data.u16 = util_iround(imm0.reg.data.f32); > + break; > + case TYPE_F64: The F64 stuff needs more thought, as I don't think we can always store the f64 immediates. In my patches, I just outlaw fp64 immediates in the fi...
2004 Jul 14
1
[LLVMdev] Constants.cpp:368: error: `INT8_MAX' undeclared (first use this function)
...;: Constants.cpp:368: error: `INT8_MAX' undeclared (first use this function) Constants.cpp:368: error: (Each undeclared identifier is reported only once for each function it appears in.) Constants.cpp:368: error: `INT8_MIN' undeclared (first use this function) Constants.cpp:370: error: `INT16_MAX' undeclared (first use this function) Constants.cpp:370: error: `INT16_MIN' undeclared (first use this function) Constants.cpp:372: error: `INT32_MAX' undeclared (first use this function) Constants.cpp:372: error: `INT32_MIN' undeclared (first use this function) Constants.cpp: In st...
2014 Jul 06
0
[PATCH v5] nv50/ir: Handle OP_CVT when folding constant expressions
...; /* make sure bld is init'ed */ + switch(i->dType) { + case TYPE_U16: + switch (i->sType) { + case TYPE_F32: + if (i->saturate) + res.data.u16 = util_iround(CLAMP(imm0.reg.data.f32, 0, + UINT16_MAX)); + else + res.data.u16 = util_iround(imm0.reg.data.f32); + break; + case TYPE_F64: + if (i->saturate) + res.data.u16 = util_iround(CLAMP(imm0.reg.data.f64, 0, + UINT16_MAX)); +...
2015 Jan 10
2
[PATCH v2] nv50/ir: Handle OP_CVT when folding constant expressions
...; /* make sure bld is init'ed */ + switch(i->dType) { + case TYPE_U16: + switch (i->sType) { + case TYPE_F32: + if (i->saturate) + res.data.u16 = util_iround(CLAMP(imm0.reg.data.f32, 0, + UINT16_MAX)); + else + res.data.u16 = util_iround(imm0.reg.data.f32); + break; + default: + return; + } + i->setSrc(0, bld.mkImm(res.data.u16)); + break; + case TYPE_U32: + switch (i->sType) { + case TYPE...
2004 Jul 15
2
[LLVMdev] Constants.cpp:368: error: `INT8_MAX' undeclared(firstuse this function)
...efine ULONG_LONG_MAX ULLONG_MAX #define QUAD_MIN LLONG_MIN #define QUAD_MAX LLONG_MAX #define UQUAD_MAX ULLONG_MAX ... --- /usr/include/limits.h --------------------- Which defintions do you think encompasses LLVMs expectations?: INT8_MAX - SCHAR_MAX //signed INT8_MIN - SCHAR_MIN //signed INT16_MAX - SHRT_MAX //signed INT16_MIN - SHRT_MIN //signed INT32_MAX - LONG_MAX //signed INT32_MIN - LONG_MIN //signed ... UINT8_MAX - CHAR_MIN //unsigned - #define _CHAR_UNSIGNED || __CHAR_UNSIGNED__ UINT8_MIN - (implicitly 0?) UINT16_MAX - USHRT_MAX //unsigned UINT16_MIN - (implicitly 0?) UINT32_MA...
2015 Jan 11
0
[PATCH] nv50/ir: Handle OP_CVT when folding constant expressions
...; /* make sure bld is init'ed */ + switch(i->dType) { + case TYPE_U16: + switch (i->sType) { + case TYPE_F32: + if (i->saturate) + res.data.u16 = util_iround(CLAMP(imm0.reg.data.f32, 0, + UINT16_MAX)); + else + res.data.u16 = util_iround(imm0.reg.data.f32); + break; + default: + return; + } + i->setSrc(0, bld.mkImm(res.data.u16)); + break; + case TYPE_U32: + assert(!i->saturate); + switch (...
2004 Jul 14
0
[LLVMdev] Constants.cpp:368: error: `INT8_MAX' undeclared(firstuse this function)
...ULONG_LONG_MAX ULLONG_MAX #define QUAD_MIN LLONG_MIN #define QUAD_MAX LLONG_MAX #define UQUAD_MAX ULLONG_MAX ... --- /usr/include/limits.h --------------------- Which defintions do you think encompasses LLVM's expectations? INT8_MAX - SCHAR_MAX //signed INT8_MIN - SCHAR_MIN //signed INT16_MAX - SHRT_MAX //signed INT16_MIN - SHRT_MIN //signed INT32_MAX - LONG_MAX //signed INT32_MIN - LONG_MIN //signed ... UINT8_MAX - CHAR_MIN //unsigned #define _CHAR_UNSIGNED || __CHAR_UNSIGNED__ UINT8_MIN - (implicitly defined as 0?) UINT16_MAX - USHRT_MAX //unsigned UINT16_MIN - (implicitl...
2015 Jan 11
0
[PATCH v2] nv50/ir: Handle OP_CVT when folding constant expressions
.../ > + switch(i->dType) { > + case TYPE_U16: > + switch (i->sType) { > + case TYPE_F32: > + if (i->saturate) > + res.data.u16 = util_iround(CLAMP(imm0.reg.data.f32, 0, > + UINT16_MAX)); Where did this saturate stuff come from? It doesn't make sense to saturate to a non-float dtype. I'd go ahead and just assert(!i->saturate) in the int dtype cases. One does wonder what the hw does if the float doesn't fit in the destination... whether it saturates or not. I don&...
2004 Jul 15
0
[LLVMdev] Constants.cpp:368: error: `INT8_MAX' undeclared(firstuse this function)
...MIN LLONG_MIN > #define QUAD_MAX LLONG_MAX > #define UQUAD_MAX ULLONG_MAX > ... > --- /usr/include/limits.h --------------------- > > Which defintions do you think encompasses LLVMs expectations?: > > INT8_MAX - SCHAR_MAX //signed > INT8_MIN - SCHAR_MIN //signed > INT16_MAX - SHRT_MAX //signed > INT16_MIN - SHRT_MIN //signed > INT32_MAX - LONG_MAX //signed > INT32_MIN - LONG_MIN //signed > ... > UINT8_MAX - CHAR_MIN //unsigned - #define _CHAR_UNSIGNED || > __CHAR_UNSIGNED__ > UINT8_MIN - (implicitly 0?) > UINT16_MAX - USHRT_MAX //unsigned...
2015 Jan 11
2
[PATCH v2] nv50/ir: Handle OP_CVT when folding constant expressions
...itch (i->sType) { >>>>>> + case TYPE_F32: >>>>>> + if (i->saturate) >>>>>> + res.data.u16 = util_iround(CLAMP(imm0.reg.data.f32, 0, >>>>>> + UINT16_MAX)); >>>>> Where did this saturate stuff come from? It doesn't make sense to >>>>> saturate to a non-float dtype. I'd go ahead and just >>>>> assert(!i->saturate) in the int dtype cases. >>>>> >>>>> One does wonder...
2015 Jan 11
2
[PATCH v2] nv50/ir: Handle OP_CVT when folding constant expressions
...gt;dType) { >> + case TYPE_U16: >> + switch (i->sType) { >> + case TYPE_F32: >> + if (i->saturate) >> + res.data.u16 = util_iround(CLAMP(imm0.reg.data.f32, 0, >> + UINT16_MAX)); > Where did this saturate stuff come from? It doesn't make sense to > saturate to a non-float dtype. I'd go ahead and just > assert(!i->saturate) in the int dtype cases. > > One does wonder what the hw does if the float doesn't fit in the > destination... whether...
2015 Jan 11
2
[PATCH] nv50/ir: Handle OP_CVT when folding constant expressions
...gt; + switch (i->sType) { >>>>> + case TYPE_F32: >>>>> + if (i->saturate) >>>>> + res.data.u16 = util_iround(CLAMP(imm0.reg.data.f32, 0, >>>>> + UINT16_MAX)); >>>>> + else >>>>> + res.data.u16 = util_iround(imm0.reg.data.f32); >>>>> + break; >>>>> + default: >>>>> + return; >>>>> + } >>>> &...
2020 Mar 26
0
[PATCH nbdkit 5/9 patch split 2/5] lib: Move code for parsing, passwords and paths into libnbdkit.so.
...(str, &end, 0); - if (r < INT8_MIN || r > INT8_MAX) - errno = ERANGE; - PARSE_COMMON_TAIL; -} - -int -nbdkit_parse_int16_t (const char *what, const char *str, int16_t *rp) -{ - long r; - char *end; - - errno = 0; - r = strtol (str, &end, 0); - if (r < INT16_MIN || r > INT16_MAX) - errno = ERANGE; - PARSE_COMMON_TAIL; -} - -int -nbdkit_parse_int32_t (const char *what, const char *str, int32_t *rp) -{ - long r; - char *end; - - errno = 0; - r = strtol (str, &end, 0); -#if INT32_MAX != LONG_MAX - if (r < INT32_MIN || r > INT32_MAX) - errno = ERANGE; -#e...
2019 Sep 23
0
Re: [PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers.
..._COMMON_TAIL; > +} I argue we don't want this one. > + > +int > +nbdkit_parse_int16_t (const char *what, const char *str, int16_t *rp) > +{ > + long r; > + char *end; > + > + errno = 0; > + r = strtol (str, &end, 0); > + if (r < INT16_MIN || r > INT16_MAX) > + errno = ERANGE; > + PARSE_COMMON_TAIL; > +} No int8_t counterpart? But looks correct. > + > +int > +nbdkit_parse_int32_t (const char *what, const char *str, int32_t *rp) > +{ > + long r; > + char *end; > + > + errno = 0; > + r = strtol (str, &...
2023 Mar 01
6
[libnbd PATCH 0/6] common: catch up with nbdkit
If we compare the "common" subdirectory between nbdkit @ 6b4178d0fdfe ("ci: Temporarily disable perl in MacOS", 2023-02-27) and libnbd @ d05cd8f384a7 ("Version 1.15.11.", 2023-02-28), we find differences. We can categorize these differences along two (orthogonal) axes: - Intentional or unintentional. Intentional differences are for example when one of the libnbd
2019 Sep 21
2
[PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers.
...g *rp) +{ + long r; + char *end; + + errno = 0; + r = strtol (str, &end, 0); + PARSE_COMMON_TAIL; +} + +int +nbdkit_parse_int16_t (const char *what, const char *str, int16_t *rp) +{ + long r; + char *end; + + errno = 0; + r = strtol (str, &end, 0); + if (r < INT16_MIN || r > INT16_MAX) + errno = ERANGE; + PARSE_COMMON_TAIL; +} + +int +nbdkit_parse_int32_t (const char *what, const char *str, int32_t *rp) +{ + long r; + char *end; + + errno = 0; + r = strtol (str, &end, 0); +#if INT32_MAX != LONG_MAX + if (r < INT32_MIN || r > INT32_MAX) + errno = ERANGE; +#e...
2020 Mar 26
9
[PATCH nbdkit 5/9 patch split 1/5] Create libnbdkit.so.
This is the previous 5/9 patch posted earlier today, split into reviewable chunks. This passes bisection with -x 'make && make check', but I didn't work very hard on the commit messages, so I refer you back to the original patch to explain how it works: https://www.redhat.com/archives/libguestfs/2020-March/msg00248.html Rich.