search for: trunc

Displaying 20 results from an estimated 1045 matches for "trunc".

Did you mean: trunk
2017 Sep 14
2
IVUsers pass is fragile. Is this okay? How can it be resolved?
...t datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:1" target triple = "x86_64-unknown-linux-gnu" define void @test(i64 %v1, i32 %v2, i64* %addr) { entry: br label %loop loop: %iv = phi i64 [%v1, %entry], [%iv.inc, %loop] %iv2 = phi i32 [%v2, %entry], [%5, %loop] %0 = trunc i64 %iv to i32 %1 = sub i32 %iv2, %0 %2 = sitofp i32 %1 to double %3 = sub i64 0, %iv %4 = trunc i64 %3 to i32 %5 = sub i32 %1, %4 %iv.inc = add i64 %iv, 1 store i64 %iv.inc, i64* %addr, align 8 br i1 undef, label %loop, label %exit exit: ret void ; uselistorder directives ---- ; uselist...
2017 Sep 15
2
IVUsers pass is fragile. Is this okay? How can it be resolved?
...t datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:1" target triple = "x86_64-unknown-linux-gnu" define void @test(i64 %v1, i32 %v2, i64* %addr) { entry: br label %loop loop: %iv = phi i64 [%v1, %entry], [%iv.inc, %loop] %iv2 = phi i32 [%v2, %entry], [%5, %loop] %0 = trunc i64 %iv to i32 %1 = sub i32 %iv2, %0 %2 = sitofp i32 %1 to double %3 = sub i64 0, %iv %4 = trunc i64 %3 to i32 %5 = sub i32 %1, %4 %iv.inc = add i64 %iv, 1 store i64 %iv.inc, i64* %addr, align 8 br i1 undef, label %loop, label %exit exit: ret void ; uselistorder directives ---- ; uselist...
2017 Jul 03
2
trunc nsw/nuw?
Hello, >From [1], trunc does not seems to have a nsw/nuw attribute. Is it possible to have that? Or do we have that and it is not up-to-date? The definition would be: If the nuw keyword is present, the result value of the trunc is a poison value if the truncated high order bits are non-zero. If the nsw keyword is presen...
2017 Jul 04
4
trunc nsw/nuw?
Hi, > Hi Alexandre, > > LLVM currently doesn't have trunc nsw/nuw, no. > Which frontend would emit such instructions? Any application in mind? > Just asking because if no frontend could emit those, then the motivation to > add nsw/nuw support to trunc would be very low I guess. I think the clang frontend could use that to allow better static anal...
2017 Sep 13
2
IVUsers pass is fragile. Is this okay? How can it be resolved?
...t datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:1" target triple = "x86_64-unknown-linux-gnu" define void @test(i64 %v1, i32 %v2, i64* %addr) { entry: br label %loop loop: %iv = phi i64 [%v1, %entry], [%iv.inc, %loop] %iv2 = phi i32 [%v2, %entry], [%5, %loop] %0 = trunc i64 %iv to i32 %1 = sub i32 %iv2, %0 %2 = sitofp i32 %1 to double %3 = sub i64 0, %iv %4 = trunc i64 %3 to i32 %5 = sub i32 %1, %4 %iv.inc = add i64 %iv, 1 store i64 %iv.inc, i64* %addr, align 8 br i1 undef, label %loop, label %exit exit: ret void ; uselistorder directives ---- ; uselist...
2017 Sep 16
0
IVUsers pass is fragile. Is this okay? How can it be resolved?
...%v1, i32 %v2, i64* %addr) { >>>>> entry: >>>>> br label %loop >>>>> >>>>> loop: >>>>> %iv = phi i64 [%v1, %entry], [%iv.inc, %loop] >>>>> %iv2 = phi i32 [%v2, %entry], [%5, %loop] >>>>> %0 = trunc i64 %iv to i32 >>>>> %1 = sub i32 %iv2, %0 >>>>> %2 = sitofp i32 %1 to double >>>>> %3 = sub i64 0, %iv >>>>> %4 = trunc i64 %3 to i32 >>>>> %5 = sub i32 %1, %4 >>>>> %iv.inc = add i64 %iv, 1 >>&gt...
2000 Mar 07
1
A simple question??
Dear all, I'm currently use R v0.99 on Windows 98 Second Edition. I have a question on some simple calculations. I wonder that I've done something wrong with the calculation. Here is the imput commands: > a <- 25.01 > b <- 56.08 > a.trunc <- trunc(a) > b.trunc <- trunc(b) > a.tail <- a - a.trunc > b.tail <- b - b.trunc > a.trunc [1] 25 > b.trunc [1] 56 > a.tail [1] 0.01 > b.tail [1] 0.08 > a.tail <- (a - a.trunc) * 100 > b.tail <- (b - b.trunc) * 100 > a.tail [1] 1 > b.tail [1] 8 &g...
2017 Jul 05
2
trunc nsw/nuw?
On Wed, Jul 5, 2017 at 3:59 PM, Hal Finkel via llvm-dev < llvm-dev at lists.llvm.org> wrote: > > On 07/04/2017 01:41 AM, Dr.-Ing. Christoph Cullmann via llvm-dev wrote: > >> Hi, >> >> Hi Alexandre, >>> >>> LLVM currently doesn't have trunc nsw/nuw, no. >>> Which frontend would emit such instructions? Any application in mind? >>> Just asking because if no frontend could emit those, then the motivation >>> to >>> add nsw/nuw support to trunc would be very low I guess. >>> >> I think th...
2012 Aug 06
4
[LLVMdev] Casting from float to unsigned char - incorrect output?
I am compiling the following code for the MIPS architecture: unsigned char trunc(float f) { return (unsigned char) f; } and it produces the following assembly (directives removed for convenience: trunc: trunc.w.s $f0, $f12 mfc1 $2, $f0 jr $ra nop However, this does not seem to produce the correct output for negative numbers. When I run the fol...
2017 Jul 05
3
trunc nsw/nuw?
...lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote: > > > On 07/04/2017 01:41 AM, Dr.-Ing. Christoph Cullmann via > llvm-dev wrote: > > Hi, > > Hi Alexandre, > > LLVM currently doesn't have trunc nsw/nuw, no. > Which frontend would emit such instructions? Any > application in mind? > Just asking because if no frontend could emit those, > then the motivation to > add nsw/nuw support to trunc would...
2017 Jan 21
2
IR canonicalization: shufflevector or vector trunc?
...17 at 9:17 AM, Rackover, Zvi <zvi.rackover at intel.com> wrote: > Hi Sanjay, > > > > I agree we should also discuss **if** this canonicalization is beneficial. > > For starters, do we have a concrete case where we would benefit from > canonicalizing shuffles <-> truncates in LLVM IR? > > IMO, we should not count benefits for codegen because that alone does not > justify transforming the IR ; we could always do this on the SelectionDAG. > > Agreed. If we're just talking about IR benefits, then it's easy to demonstrate a win for trunc/zext b...
2017 Jul 07
3
trunc nsw/nuw?
Hi, Even if there are no ways in which a *frontend* can produce nsw truncs, it may still be useful to have if optimization passes can usefully attach nsw to truncates (after proving the truncates don't "overflow"). For instance in %a = ashr i64 %v, i32 33 %t = trunc %a to i32 the trunc can be marked nsw. However, the burden of proof here is to show...
2024 Feb 08
2
round.Date and trunc.Date not working / implemented
>>>>> Ji?? Moravec >>>>> on Wed, 7 Feb 2024 10:23:15 +1300 writes: > This is my first time working with dates, so if the answer is "Duh, work > with POSIXt", please ignore it. > Why is not `round.Date` and `trunc.Date` "implemented" for `Date`? > Is this because `Date` is (mostly) a virtual class setup for a better > inheritance or is that something that is just missing? (like > `sort.data.frame`). Would R core welcome a patch? > I decided to convert some dates to d...
2017 Jul 06
2
trunc nsw/nuw?
...implementation defined whether the program will terminate. That provides pretty big scope to optimize around :-) Note also that while unsigned variables require the implementation to act AS IF running on a binary machine, signed variables have no such requirement. Most implementations do in fact truncate by taking the remainder modulus the number of values that can be represented in the destination type, but that might not be a power of two. I would guess there is very little code in the wild that conforms to a strict interpretation of all this. On Thu, Jul 6, 2017 at 5:24 PM, Alexandre Isoard...
2017 Jan 17
2
IR canonicalization: shufflevector or vector trunc?
...-bit vector are legal, so I don't think we can currently use that to say v2i128 should be treated differently than v16i16. Is this a valid argument to not canonicalize the IR? On Mon, Jan 16, 2017 at 10:16 AM, Rackover, Zvi <zvi.rackover at intel.com> wrote: > Suppose we prefer the ‘trunc’ form, then what about cases such as: > > define <2 x i16> @shuffle(<16 x i16> %x) { > > %shuf = shufflevector <16 x i16> %x, <16 x i16> undef, <2 x i32> <i32 0, > i32 8> > > ret <2 x i16> %shuf > > } > > > > Will...
2005 Oct 27
2
Critical Bug in type conversions: as.integer, trunc, ... (PR#8255)
...om: (NULL) (192.108.25.32) I have a strange behaviour in R, looks like type conversions are messed up. To reproduce: expected: > typeof(3) [1] "double" > as.integer(3) [1] 3 !!!! strange: > typeof((0.3/0.1)) [1] "double" > as.integer((0.3/0.1)) [1] 2 also for trunc: >trunc(c(5,7)) >c(0.5,0.7)/c(0.1,0.1) and now watch the amazing!!!!: >trunc((c(0.5,0.7)/c(0.1,0.1))) My R-Version: platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 2 minor 1.1...
2024 Feb 08
2
round.Date and trunc.Date not working / implemented
...> >>>>>> Ji?? Moravec >>>>>> on Wed, 7 Feb 2024 10:23:15 +1300 writes: > >> This is my first time working with dates, so if the answer is "Duh, work >> with POSIXt", please ignore it. > >> Why is not `round.Date` and `trunc.Date` "implemented" for `Date`? > >> Is this because `Date` is (mostly) a virtual class setup for a better >> inheritance or is that something that is just missing? (like >> `sort.data.frame`). Would R core welcome a patch? > >> I decided to convert some...
2011 Mar 09
2
trunc function
Hello. I would like to know if there exists in R a function like trunc but where i can choose how many decimal places can I stay with in the number I have (sort of the same as the trunc function in excel). I would like, for example if I have the number 0.974678 and I choose to stay with 3 decimal places to have as ouput 0.974. Thank you Felipe Parra [[alternative...
2011 Feb 15
3
[LLVMdev] How to use ConstantFoldConstantExpression?
...to \n--" << *val << "\n"; } } And this is the output i get, all constants should result in "i32 0" (at least this is what I need): **i32 bitcast (<4 x i8> zeroinitializer to i32) to --i32 bitcast (<4 x i8> zeroinitializer to i32) **i32 sext (i8 trunc (i32 bitcast (<4 x i8> zeroinitializer to i32) to i8) to i32) to --i32 sext (i8 trunc (i32 bitcast (<4 x i8> zeroinitializer to i32) to i8) to i32) **i32 bitcast (<4 x i8> <i8 trunc (i32 shl (i32 sext (i8 trunc (i32 bitcast (<4 x i8> zeroinitializer to i32) to i8) to i32...
2024 Feb 08
1
round.Date and trunc.Date not working / implemented
...t;>> Ji?? Moravec >>>>>>> on Wed, 7 Feb 2024 10:23:15 +1300 writes: >> >>> This is my first time working with dates, so if the answer is "Duh, work >>> with POSIXt", please ignore it. >> >>> Why is not `round.Date` and `trunc.Date` "implemented" for `Date`? >> >>> Is this because `Date` is (mostly) a virtual class setup for a better >>> inheritance or is that something that is just missing? (like >>> `sort.data.frame`). Would R core welcome a patch? >> >>> I deci...