Displaying 3 results from an estimated 3 matches for "vec_cast".
Did you mean:
ecocast
2011 Dec 28
1
[LLVMdev] Codegen for vector float->double cast fails on x86 above SSE3
...float to double (cvtss2sd), pack vectors, and store.
But with llc -mcpu=penryn or greater, it yields nonsense:
movq (%rdi), %xmm0
pshufd $16, %xmm0, %xmm0 ## xmm0 = xmm0[0,0,1,0]
movdqu %xmm0, (%rsi)
ret
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vec_cast.ll
Type: application/octet-stream
Size: 406 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111228/3a33b948/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vec_cast.sse3.s
Type: application/octet-stream...
2018 Aug 06
2
vctrs: a type system for the tidyverse
...in the near future.)
To find the common type of multiple vectors, we can use `Reduce()`:
vecs <- list(TRUE, 1:10, 1.5)
type <- Reduce(vec_type2, vecs)
str(type)
#> num(0)
There?s one other piece of the puzzle: casting one vector to another
type. That?s implemented by `vec_cast()` (which also uses double
dispatch):
str(lapply(vecs, vec_cast, to = type))
#> List of 3
#> $ : num 1
#> $ : num [1:10] 1 2 3 4 5 6 7 8 9 10
#> $ : num 1.5
All up, this means that we can implement the essence of `vec_c()` in
only a few lines:
vec_c2 <-...
2018 Aug 06
0
vctrs: a type system for the tidyverse
...type of multiple vectors, we can use `Reduce()`:
>
> vecs <- list(TRUE, 1:10, 1.5)
>
> type <- Reduce(vec_type2, vecs)
> str(type)
> #> num(0)
>
> There?s one other piece of the puzzle: casting one vector to another
> type. That?s implemented by `vec_cast()` (which also uses double
> dispatch):
>
> str(lapply(vecs, vec_cast, to = type))
> #> List of 3
> #> $ : num 1
> #> $ : num [1:10] 1 2 3 4 5 6 7 8 9 10
> #> $ : num 1.5
>
> All up, this means that we can implement the essence of `vec_c...