[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [csmith-dev] Testing floating point optimizations with CSmith
On 2015-07-10 14:50, Burys, Jacek wrote:
There was another problem with comparison operators.
BinaryOpWorksForFloat(eBinaryOps op) would return true for comparison
operators, leading to CSmith telling me that, for example, type of (x
< y) is eFloat, while it actually is int. It was only after I changed
it to return false for comparison operators, that I could compile the
generated programs. Would there be a way to make CSmith keep eInt for
results of comparison operations?
Can you elaborate on it? My understanding is that the type you referred
to is the type passed to FunctionInvocation::make_random_binary? I am
trying to rephrase the question:
In FunctionInvocation::make_random_binary, can we force the "type" to be
eInt if the kind of the generated "op" is a comparison operation?
The only easy way that I can think of is to make BinaryOpWorksForFloat
return false upon comparison operations.
Also, could you give an example where a generated program cannot be
compiled because BinaryOpWorksForFloat returns true for comparison
operations? I am curious because it seems fine for BinaryOpWorksForFloat
to return true for comparison operations.
Thanks for working on this!