search for: myadd

Displaying 15 results from an estimated 15 matches for "myadd".

Did you mean: madd
2019 Jun 10
2
[RFC] Expose user provided vector function for auto-vectorization.
> What is a `"logically"-widened alwaysinline wrapper for the vector function`? Can you provide an example? Also, what is the `tricky processing` you are referring to that the vectorizer should care about? For the case mentioned earlier: float MyAdd(float* a, int b) { return *a + b; } __declspec(vector_variant(implements(MyAdd(float *a, int b)), linear(a), vectorlength(8), nomask, processor(core_2nd_gen_avx))) __m256 __regcall MyAddVec(float* v_a, __m128i v_b1, __m128i v_b2) If FE emitted...
2019 Jun 10
2
[RFC] Expose user provided vector function for auto-vectorization.
...roversies discussed in the thread, and for which I decided to move away from `declare variant`. > > Where will the mapping between parameters positions be stored? Using the example from https://software.intel.com/en-us/cpp-compiler-developer-guide-and-reference-vector-variant: > > float MyAdd(float* a, int b) { return *a + b; } > __declspec(vector_variant(implements(MyAdd(float *a, int b)), > linear(a), vectorlength(8), > nomask, processor(core_2nd_gen_avx))) > __m256 __regcall MyAddVec(float* v_a, __m128i v_b1, __m128i v_b2...
2009 Jul 07
1
[LLVMdev] LLVM code target dependent generator question
...dition ret Currently my ADD instruction is defined in the InstrInfo.td file as following: def I32RC : RegisterClass<"MyMachine", [i32], 32, [DefReg]>; def P32RC : RegisterClass<"MyMachine", [iPTR], 32, [DefReg]>; -> I get error from tablegen if I use iPTR def MyAdd : MyInst < myadd, nosubop, (outs I32RC:$dst), (ins I32RC:$src1, I32RC:$src2), “add $dst, $src1, $src2", [(set rc:$dst, (add I32RC:$src1, I32RC:$src2))] def MyPointerAdd : MyInst < mypointeradd, nosubop, (outs P32RC:$dst), (ins P32RC:$src1, P32RC:$src2), “pointer_add $dst, $src1...
2006 Nov 04
1
SWIG tricks
...u to create new functions with parameters how you want them. Using %{ %} allows you to create new functions that you can get swig to wrap." and then has a couple examples, including: %{ //add new ''add'' function that returns ans instead of returning via out parameter int myadd(int a, int b) { int c; add(a, b, &c); return c; } %} //get swig to wrap myadd as "add" %name(add) int myadd(int a, int b); If we''re having problems figuring out the right typemaps to get stuff like this done, this trick might help. I haven''t look...
2019 Jun 07
2
[RFC] Expose user provided vector function for auto-vectorization.
...d most of the controversies discussed in the thread, and for which I decided to move away from `declare variant`. Where will the mapping between parameters positions be stored? Using the example from https://software.intel.com/en-us/cpp-compiler-developer-guide-and-reference-vector-variant: float MyAdd(float* a, int b) { return *a + b; } __declspec(vector_variant(implements(MyAdd(float *a, int b)), linear(a), vectorlength(8), nomask, processor(core_2nd_gen_avx))) __m256 __regcall MyAddVec(float* v_a, __m128i v_b1, __m128i v_b2) We need so...
2009 Jul 07
0
[LLVMdev] LLVM code target dependent generator question
...dition ret Currently my ADD instruction is defined in the InstrInfo.td file as following: def I32RC : RegisterClass<"MyMachine", [i32], 32, [DefReg]>; def P32RC : RegisterClass<"MyMachine", [iPTR], 32, [DefReg]>; -> I get error from tablegen if I use iPTR def MyAdd : MyInst < myadd, nosubop, (outs I32RC:$dst), (ins I32RC:$src1, I32RC:$src2), “add $dst, $src1, $src2", [(set rc:$dst, (add I32RC:$src1, I32RC:$src2))] def MyPointerAdd : MyInst < mypointeradd, nosubop, (outs P32RC:$dst), (ins P32RC:$src1, P32RC:$src2), “pointer_add $dst, $src1, $s...
2005 Apr 28
0
simple addition in R, now fast & easy!
...into R: >dyn.load("add.so") # you might need an explicit path here And now you too have the power of fast, easy, simple addition!! >.Fortran("add",as.numeric(7),as.numeric(3),as.numeric(0)) If you want to get real fancy you can put your .Fortran call into a function: myadd = function(a,b){ out = .Fortran("add",as.numeric(a),as.numeric(b),c=as.numeric(0)) return(out$c) } > x = myadd(3,7) [1] 10 And you've done it! Be vanquished naysayers, simple addition will trouble us no more! (I thought a very simple tutorial on integrating Fortran code into R m...
2008 Nov 06
2
Fwd: SWIG with R and C++ STL
Hi, all I didn't get any response from swig for my question. see if I can get some help here Thanks ---------- Forwarded message ---------- From: charlie <charlie.xia.fdu@gmail.com> Date: Tue, Nov 4, 2008 at 1:55 PM Subject: SWIG with R and C++ STL To: swig-user@lists.sourceforge.net Hi all, I am new to SWIG. I encountered some problem when I try to SWIG to R some C++ modules. Here
2017 Dec 13
4
Add vectors of unequal length without recycling?
I'm a newbie for R lang. And I recently came across the "Recycling Rule" when adding two vectors of unequal length. I learned from this tutor [ http://www.r-tutor.com/r-introduction/vector/vector-arithmetics ] that: """""" If two vectors are of unequal length, the shorter one will be recycled in order to match the longer vector. For example, the
2019 Jun 24
2
RFC: Interface user provided vector functions with the vectorizer.
>Thank you everybody for their input, and for your patience. This is proving harder than expected! :) Thank you for doing the hard part of the work. Hideki -----Original Message----- From: Francesco Petrogalli [mailto:Francesco.Petrogalli at arm.com] Sent: Monday, June 24, 2019 11:26 AM To: Saito, Hideki <hideki.saito at intel.com> Cc: Doerfert, Johannes <jdoerfert at anl.gov>;
2019 Jun 11
2
RFC: Interface user provided vector functions with the vectorizer.
...#0 = {vector-abi-variant="_ZGVsM2v_foo_04(vector_foo_04)"} ``` ## Example 06 This is an x86 example, equivalent to the one provided by Andrei Elovikow in http://lists.llvm.org/pipermail/llvm-dev/2019-June/132885.html. Godbolt rendering with ICC at https://godbolt.org/z/Of1NxZ ``` float MyAdd(float* a, int b) __attribute__(clang_declare_simd_variant(“MyAddVec", simdlen(8), notinbranch, arch("core_2nd_gen_avx")) { return *a + b; } __m256 MyAddVec(float* v_a, __m128i v_b1, __m128i v_b2); ``` The resulting IR attribute is: ``` attribute #0 = {vector-abi-variant="...
2019 Jun 17
3
RFC: Interface user provided vector functions with the vectorizer.
...r_foo_04)"} > ``` > > ## Example 06 > > This is an x86 example, equivalent to the one provided by Andrei > Elovikow in > http://lists.llvm.org/pipermail/llvm-dev/2019-June/132885.html. Godbolt > rendering with ICC at https://godbolt.org/z/Of1NxZ > > ``` > float MyAdd(float* a, int b) __attribute__(clang_declare_simd_variant(“MyAddVec", simdlen(8), notinbranch, arch("core_2nd_gen_avx")) > { > return *a + b; > } > > > __m256 MyAddVec(float* v_a, __m128i v_b1, __m128i v_b2); > ``` > > The resulting IR attribute is: >...
2019 Jun 24
2
RFC: Interface user provided vector functions with the vectorizer.
...;> > This is an x86 example, equivalent to the one provided by Andrei >> > Elovikow in >> > http://lists.llvm.org/pipermail/llvm-dev/2019-June/132885.html. Godbolt >> > rendering with ICC at https://godbolt.org/z/Of1NxZ> > >> > ``` >> > float MyAdd(float* a, int b) > __attribute__(clang_declare_simd_variant(“MyAddVec", simdlen(8), > notinbranch, arch("core_2nd_gen_avx")) >> > { >> > return *a + b; >> > } >> > >> > >> > __m256 MyAddVec(float* v_a, __m128i v_b1, __m12...
2019 Jun 21
2
RFC: Interface user provided vector functions with the vectorizer.
...ple 06 > > > > This is an x86 example, equivalent to the one provided by Andrei > > Elovikow in > > http://lists.llvm.org/pipermail/llvm-dev/2019-June/132885.html. > > Godbolt rendering with ICC at https://godbolt.org/z/Of1NxZ > > > > ``` > > float MyAdd(float* a, int b) > > __attribute__(clang_declare_simd_variant(“MyAddVec", simdlen(8), notinbranch, arch("core_2nd_gen_avx")) { > > return *a + b; > > } > > > > > > __m256 MyAddVec(float* v_a, __m128i v_b1, __m128i v_b2); ``` > > > >...
2019 Jun 24
4
RFC: Interface user provided vector functions with the vectorizer.
...xample 06 > > > > This is an x86 example, equivalent to the one provided by Andrei > > Elovikow in > > http://lists.llvm.org/pipermail/llvm-dev/2019-June/132885.html. > > Godbolt rendering with ICC at https://godbolt.org/z/Of1NxZ > > > > ``` > > float MyAdd(float* a, int b) > > __attribute__(clang_declare_simd_variant(“MyAddVec", simdlen(8), notinbranch, arch("core_2nd_gen_avx")) { > > return *a + b; > > } > > > > > > __m256 MyAddVec(float* v_a, __m128i v_b1, __m128i v_b2); ``` > > > >...