Displaying 20 results from an estimated 2000 matches similar to: "[LLVMdev] a constant folding case causing different results w/ot optimization"
2009 Dec 08
0
[LLVMdev] a constant folding case causing different results w/ot optimization
On Mon, Dec 7, 2009 at 3:51 PM, Zheng, Bixia <Bixia.Zheng at amd.com> wrote:
> While the result of “(unsigned int) -1.0f” is probably implementation
> defined, both gcc and Microsoft cl produce -1.
LLVM (and C/C++) consider the result to be undefined (i.e. it can
produce anything). And it can actually produce results other than -1
on some platforms supported by LLVM. So I don't
2008 Mar 19
1
Problem in using typedef with c++
Hi
My code is as follows :-
example.h
#include"iostream.h"
using namespace std;
typedef int MYINT;
void sum(MYINT a, MYINT b);
example.cpp
#include"example.h"
void sum(MYINT a, MYINT b)
{
MYINT c;
c=a +b;
cout<<c;
}
example.i
%module example
%{
#include"example.h"
extern void sum(MYINT a, MYINT b);
%}
#include "example.h"
2006 May 08
1
Calling C++ code fom R --How to export C++ "unsigned" integer to R?
Hello all,
Is there a way to export C++ "unsigned" integer to R? (I am trying to parse
files in "BPMAP" format, and some variables are of type unsigned int (first
declared in C++) ).
I know that to export signed integer to R,
I can do the following in C++:
int Some_INTEGER = 5;
int *p_myInt;
SEXP myInt;
PROTECT(myInt=NEW_INTEGER(1));
myInt[0] = Some_INTEGER;
2005 Apr 14
1
question about "R get vector from C"
Dear ALL-R helpers,
I want to let R get vector from c ,for example :numeric array ,vector .I saw
some exmple like this :
/* useCall3.c */
/* Getting an integer vector from C using .Call */
#include <R.h>
#include <Rdefines.h>
SEXP setInt() {
SEXP myint;
int *p_myint;
int len = 5;
PROTECT(myint = NEW_INTEGER(len)); // Allocating
2016 Dec 01
2
Placement new and TBAA
On Sat, Nov 26, 2016 at 12:07 AM, Sanjoy Das <sanjoy at playingwithpointers.com
> wrote:
> So if you:
>
> 1. override operator delete to do nothing for that type (so that the
> placement new actually has unfreed backing storage to re-use).
> 2. have an empty destructor.
>
So,
void *operator new(decltype(sizeof 0), void *) noexcept;
struct MyInt {
static void
2009 Feb 11
1
[LLVMdev] Suggested change to docs re: double/float constant syntax.
It appears to me based on my experiments with llvm-as that literal
floating-point constants may be specified in the 64-bit IEEE
hexadecimal format, but not in the 32-bit format. For instance, this
file:
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-
i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-
f80:128:128"
target triple =
2012 Apr 18
0
Numerical integration again
Hi all,
Here is an integration function
require(pracma) # for 'quadinf'
myint=function(j) {
quadinf(function(x)
(1/(1+exp(-x)))^j*(1-1/(1+exp(-x)))^(k-j)*dnorm(x,mu,casigma),-Inf,Inf)
}
in any optimization routine. It works fine most of the time but failed with
some particular sets of values, say one of the following:
k=20
mu=-1.978295
casigma=0.008326927
>
2012 Mar 22
2
Quicker way to apply values to a function
Hi all,
myint=function(mu,sigma){
integrate(function(x) dnorm(x,mu,sigma)/(1+exp(-x)),-Inf,Inf)$value
}
mymu=seq(-3,3,length(1000))
mysigma=seq(0,1,length(500))[-1]
k=1
v=c()
for (j in 1:length(mymu)) {
for (i in 1:length(mysigma)) {
v[k]=myint(mymu[j],mysigma[i])
k=k+1
}
}
Basically, I want to investigate for what values of mu and sigma, the
integral is divergent.
Is there another way
2012 Mar 23
1
Vectorize (scalar) function
Hi all,
myint=function(mu,sigma){
integrate(function(x) dnorm(x,mu,sigma)/(1+exp(-x)),-Inf,Inf)$value
}
x=seq(0,50,length=3000)
x=x[-1]
plot(x,myint(4,x)) # not working yet
I think I have to 'Vectorize' it somehow?
What's a scalar function? and a primitive function?
Thanks.
casper
-----
###################################################
PhD candidate in Statistics
School
2018 Mar 06
0
Broken relocation for generating offsets?
Hello LLVM-Mailing-List,
I discovered a strange behavior when dealing with object files generated
by the compiler of Visual Studio 2015.
When jitting bc files I also add object files to look up functions. These
object files are coming from visual studio. When using a switch case
instruction that compiler often generates code based of __ImageBase. I
show you a short snippet of the assembly
2013 Mar 20
0
[LLVMdev] Debug info for namespaces and "using"
I've noticed the work going on to support namespace and "using" directives.
Awesome that this is happening, I've had a couple users wonder about it.
(The main issue actually seems to be with anonymous namespaces; gdb will
auto-import those declarations, but our debugger doesn't.)
I thought I should also bring up another aspect of how Clang/LLVM handles
namespaces, in case
2018 Mar 22
0
Broken relocation for generating offsets?
I wouldn't be surprised if JITing COFF files on Windows doesn't work so
well, since the object file format assumes most symbols are dllimport or
within the local 2GB module address range.
I'm not familiar with the current JIT state of the art, though.
On Thu, Mar 22, 2018 at 1:45 AM via llvm-dev <llvm-dev at lists.llvm.org>
wrote:
> Hello,
>
> I append another clue I
2018 Mar 22
2
Broken relocation for generating offsets?
Hello,
I append another clue I found out: The problem is definitely not caused by
"__ImageBase" the problem comes with the "OFFSET". I generated another
object file which crashed. The commonality:
mov edx, DWORD PTR ?normalPlanschbecken@@3HA ; normalPlanschbecken
lea rcx, OFFSET FLAT
:??_C at _0CC@LCMJAIPO at Reading?5?$CCnormalPlanschbecken?$CC?5?$CFi@
2017 Apr 19
3
[cfe-dev] FE_INEXACT being set for an exact conversion from float to unsigned long long
Changing the list from cfe-dev to llvm-dev
> On 20 Apr 2017, at 4:52 AM, Michael Clark <michaeljclark at mac.com> wrote:
>
> I’m getting close. I think it may be an issue with an individual intrinsic. I’m looking for the X86 lowering of Instruction::FPToUI.
>
> I found a comment around the rationale for using a conditional move versus a branch. I believe the predicate logic
2004 Jun 11
1
ROC for threshold value, biometrics
Hello,
I am just a beginner of R 1.9.0.
I try to construct a predictive score for the development of liver
cancer in cirrhotic patients. So dependant variable is binanry (cancer
yes or no). Independant variables are biological data. The aim is to
find out a cut-off value which differentiate (theoratically) from
normal to pathological state for each biological data.
How can I step in procedue to
2010 Dec 27
0
[LLVMdev] how to convert from float to int with round to even
Hi!
is there an instruction or intrinsic that converts from float to integer
with round to even?
It should function like open cl-style convert_int_rte(myFloat)
-Jochen
2016 Apr 04
2
RFC: Constant folding math functions for long double
Hi Joerg,
> IMO if constant folding of transcendental functions makes a significant
difference for your program, you likely are doing something strange
already.
Alas it's not as simple as that. Currently, if you declare:
std::uniform_real_distribution<float> x;
LLVM emits two calls to logl() with constant arguments, a fdiv and a fptoui.
Libc++'s implementation is consumed and
2018 May 23
0
RFC: should CVP always narrow the width of lshr?
Hi.
In https://reviews.llvm.org/D46760,
Bixia Zheng notes that given the pattern like [1]
%za = zext i32 %a to i64
%udiv = udiv i64 %za, <C>
%urem = urem i64 %za, <C>
%uadd = add i64 %udiv, %urem
ret i64 %uadd
the CVP will reduce the width of udiv/urem,
without considerations for the new instructions,
or whether the new width is legal for the target.
That was implemented in
2009 Sep 12
0
[LLVMdev] [proposal] Extensible IR metadata
On Sep 11, 2009, at 3:23 PM, David Greene wrote:
> I have a few questions and comments about Chris' initial proposal as
> well.
>
> - I don't like the separation between "built-in" metadata and
> "extended"
> metadata. Why not make all metadata use the RegisterMDKind
> interface and
> just have the LLVM libraries do it automatically for
2008 Jun 17
2
[LLVMdev] VFCmp failing when unordered or UnsafeFPMath on x86
Hi Nate!
I don't see how that would work. Select doesn't work per element.
Say we're trying to vectorize the following C++ code:
if(v[0] < 0) v[0] += 1.0f;
if(v[1] < 0) v[1] += 1.0f;
if(v[2] < 0) v[2] += 1.0f;
if(v[3] < 0) v[3] += 1.0f;
With SSE assembly this would be as simple as:
movaps xmm1, xmm0 // v in xmm0
cmpltps xmm1, zero // zero =