search for: int16_min

Displaying 20 results from an estimated 28 matches for "int16_min".

2016 May 31
2
Signed Division and InstCombine
On 31 May 2016 at 15:42, Tim Northover <t.p.northover at gmail.com> wrote: > A 16-bit division of INT16_MIN by -1 is undefined behaviour but the > original ext/trunc version is well-defined as 0. Sorry, INT16_MIN again actually. The main point still stands though, I think. Tim.
2016 May 31
0
Signed Division and InstCombine
Just to verify, a 16-bit divion of INT16_MIN by -1 results in INT16_MIN again? If the issue only occurs in this case, why aren't there checks to see if we can simplify sdiv in cases where we know that numerator is not INT16_MIN or the denominator is not -1. For example, we could simplify divides involving one operand constants. Is it be...
2016 May 31
1
Signed Division and InstCombine
On 31 May 2016 at 16:02, Dilan Manatunga <manatunga at gmail.com> wrote: > Just to verify, a 16-bit divion of INT16_MIN by -1 results in INT16_MIN > again? No, "sdiv i16 -32768, -1" is undefined behaviour. The version with an "sext" and "trunc" avoids the undefined behaviour and does return -32768. > If the issue only occurs in this case, why aren't there checks to see if w...
2016 May 31
3
Signed Division and InstCombine
I was looking through the InstCombine pass, and I was wondering why signed division is not considered a valid operation to combine in the canEvaluateTruncated function. This means, given the following code: %conv = sext i16 %0 to i32 %conv1 = sext i16 %1 to i32 %div = sdiv i32 %conv, %conv1 %conv2 = trunc i32 %div to i16 * Assume %0 and %1 are registers created from simple 16-bit loads. We
2015 Jan 09
3
[RESEND/PATCH] nv50/ir: Handle OP_CVT when folding constant expressions
...default: + return; + } + i->setSrc(0, bld.mkImm(res.data.u32)); + break; + case TYPE_S16: + switch (i->sType) { + case TYPE_F32: + if (i->saturate) + res.data.s16 = util_iround(CLAMP(imm0.reg.data.f32, INT16_MIN, + INT16_MAX)); + else + res.data.s16 = util_iround(imm0.reg.data.f32); + break; + case TYPE_F64: + if (i->saturate) + res.data.s16 = util_iround(CLAMP(imm0.reg.data.f64, INT16_MIN...
2014 Jul 05
1
[PATCH v4] nv50/ir: Handle OP_CVT when folding constant expressions
...default: + return; + } + i->setSrc(0, bld.mkImm(res.data.u32)); + break; + case TYPE_S16: + switch (i->sType) { + case TYPE_F32: + if (i->saturate) + res.data.s16 = CLAMP(util_iround(imm0.reg.data.f32), INT16_MIN, + INT16_MAX); + else res.data.s16 = util_iround(imm0.reg.data.f32); + break; + case TYPE_F64: + if (i->saturate) + res.data.s16 = CLAMP(util_iround(imm0.reg.data.f64), INT16_MIN, +...
2015 Jan 10
0
[RESEND/PATCH] nv50/ir: Handle OP_CVT when folding constant expressions
...t; + } > + i->setSrc(0, bld.mkImm(res.data.u32)); > + break; > + case TYPE_S16: > + switch (i->sType) { > + case TYPE_F32: > + if (i->saturate) > + res.data.s16 = util_iround(CLAMP(imm0.reg.data.f32, INT16_MIN, > + INT16_MAX)); > + else > + res.data.s16 = util_iround(imm0.reg.data.f32); > + break; > + case TYPE_F64: > + if (i->saturate) > + res.data.s16 = util_iround...
2004 Jul 14
1
[LLVMdev] 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 static member function `static bool llvm::ConstantUInt::isValueValidForType(co...
2014 Jul 06
0
[PATCH v5] nv50/ir: Handle OP_CVT when folding constant expressions
...default: + return; + } + i->setSrc(0, bld.mkImm(res.data.u32)); + break; + case TYPE_S16: + switch (i->sType) { + case TYPE_F32: + if (i->saturate) + res.data.s16 = util_iround(CLAMP(imm0.reg.data.f32, INT16_MIN, + INT16_MAX)); + else + res.data.s16 = util_iround(imm0.reg.data.f32); + break; + case TYPE_F64: + if (i->saturate) + res.data.s16 = util_iround(CLAMP(imm0.reg.data.f64, INT16_MIN...
2015 Jan 10
2
[PATCH v2] nv50/ir: Handle OP_CVT when folding constant expressions
...default: + return; + } + i->setSrc(0, bld.mkImm(res.data.u32)); + break; + case TYPE_S16: + switch (i->sType) { + case TYPE_F32: + if (i->saturate) + res.data.s16 = util_iround(CLAMP(imm0.reg.data.f32, INT16_MIN, + INT16_MAX)); + else + res.data.s16 = util_iround(imm0.reg.data.f32); + break; + default: + return; + } + i->setSrc(0, bld.mkImm(res.data.s16)); + break; + case TY...
2004 Jul 15
2
[LLVMdev] Constants.cpp:368: error: `INT8_MAX' undeclared(firstuse this function)
...X #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_MAX - ULONG_MAX //unsigned UINT3...
2016 May 31
0
Signed Division and InstCombine
Hi Dilan, On 31 May 2016 at 15:34, Dilan Manatunga via llvm-dev <llvm-dev at lists.llvm.org> wrote: > What is the reason for the exclusion of sdiv from the operations considered > valid for execution in a truncated format. A 16-bit division of INT16_MIN by -1 is undefined behaviour but the original ext/trunc version is well-defined as 0. Cheers. Tim.
2015 Jan 11
0
[PATCH] nv50/ir: Handle OP_CVT when folding constant expressions
...default: + return; + } + i->setSrc(0, bld.mkImm(res.data.u32)); + break; + case TYPE_S16: + switch (i->sType) { + case TYPE_F32: + if (i->saturate) + res.data.s16 = util_iround(CLAMP(imm0.reg.data.f32, INT16_MIN, + INT16_MAX)); + else + res.data.s16 = util_iround(imm0.reg.data.f32); + break; + default: + return; + } + i->setSrc(0, bld.mkImm(res.data.s16)); + break; + case TY...
2004 Jul 14
0
[LLVMdev] Constants.cpp:368: error: `INT8_MAX' undeclared(firstuse this function)
...fine 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 - (implicitly defined as 0?) UINT32_MAX - U...
2015 Jan 11
0
[PATCH v2] nv50/ir: Handle OP_CVT when folding constant expressions
...t; + } > + i->setSrc(0, bld.mkImm(res.data.u32)); > + break; > + case TYPE_S16: > + switch (i->sType) { > + case TYPE_F32: > + if (i->saturate) > + res.data.s16 = util_iround(CLAMP(imm0.reg.data.f32, INT16_MIN, > + INT16_MAX)); > + else > + res.data.s16 = util_iround(imm0.reg.data.f32); > + break; > + default: > + return; > + } > + i->setSrc(0, bld.mkImm(res.dat...
2004 Jul 15
0
[LLVMdev] Constants.cpp:368: error: `INT8_MAX' undeclared(firstuse this function)
...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?) &...
2015 Jan 11
2
[PATCH v2] nv50/ir: Handle OP_CVT when folding constant expressions
On 11.01.2015 20:57, Ilia Mirkin wrote: > On Sun, Jan 11, 2015 at 2:56 PM, Tobias Klausmann > <tobias.johannes.klausmann at mni.thm.de> wrote: >> >> On 11.01.2015 20:19, Ilia Mirkin wrote: >>> On Sun, Jan 11, 2015 at 12:27 PM, Tobias Klausmann >>> <tobias.johannes.klausmann at mni.thm.de> wrote: >>>> >>>> On 11.01.2015 01:58,
2015 Jan 11
2
[PATCH v2] nv50/ir: Handle OP_CVT when folding constant expressions
...i->setSrc(0, bld.mkImm(res.data.u32)); >> + break; >> + case TYPE_S16: >> + switch (i->sType) { >> + case TYPE_F32: >> + if (i->saturate) >> + res.data.s16 = util_iround(CLAMP(imm0.reg.data.f32, INT16_MIN, >> + INT16_MAX)); >> + else >> + res.data.s16 = util_iround(imm0.reg.data.f32); >> + break; >> + default: >> + return; >> + } >> + i...
2015 Jan 11
2
[PATCH] nv50/ir: Handle OP_CVT when folding constant expressions
On Sun, Jan 11, 2015 at 5:48 PM, Tobias Klausmann <tobias.johannes.klausmann at mni.thm.de> wrote: > > > On 11.01.2015 23:12, Ilia Mirkin wrote: >> >> On Sun, Jan 11, 2015 at 5:08 PM, Tobias Klausmann >> <tobias.johannes.klausmann at mni.thm.de> wrote: >>> >>> >>> On 11.01.2015 22:54, Ilia Mirkin wrote: >>>>
2020 Mar 26
0
[PATCH nbdkit 5/9 patch split 2/5] lib: Move code for parsing, passwords and paths into libnbdkit.so.
...o = 0; - r = strtol (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) -...