Displaying 20 results from an estimated 700 matches similar to: "[LLVMdev] Custom Lowering and fneg"
2008 Sep 10
0
[LLVMdev] Custom Lowering and fneg
On Wed, Sep 10, 2008 at 2:35 PM, Villmow, Micah <Micah.Villmow at amd.com> wrote:
> Generating the following LLVM IR:
>
> define void @test_unary_op_anegate(float %x, float addrspace(11)* %result)
> nounwind {
> entry:
> %neg = sub float -0.000000e+000, %x ; <float> [#uses=1]
> store float %neg, float addrspace(11)* %result
>
2008 Sep 10
3
[LLVMdev] Custom Lowering and fneg
-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
On Behalf Of Eli Friedman
Sent: Wednesday, September 10, 2008 3:30 PM
To: LLVM Developers Mailing List
Subject: Re: [LLVMdev] Custom Lowering and fneg
On Wed, Sep 10, 2008 at 2:35 PM, Villmow, Micah <Micah.Villmow at amd.com>
wrote:
> Generating the following LLVM IR:
>
> define
2008 Sep 16
0
[LLVMdev] Custom Lowering and fneg
Eli,
I've been working on this for a few days and still haven't gotten this
towork. I've attached my dags that you asked for, and even there it is
turning the floating point instruction into an integer return value.
IR code just for reference:
-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
On Behalf Of Villmow, Micah
Sent:
2018 Sep 26
3
[FPEnv] FNEG instruction
On Wed, Sep 26, 2018 at 9:32 AM Sanjay Patel <spatel at rotateright.com> wrote:
>
>
> On Tue, Sep 25, 2018 at 7:47 PM Cameron McInally <cameron.mcinally at nyu.edu>
> wrote:
>
>>
>> This is the first time I'm looking at foldShuffledBinop(...), so maybe a
>> naive question, but why not do similar shuffle canonicalizations on unary
>> (or
2018 Sep 26
2
[FPEnv] FNEG instruction
I have no example side effects in hand. But LLVM targets a bunch of architectures, and who knows what the future holds. So it may be prudent to not promise too much so as to leave ourselves an escape hatch.
Doesn’t LLVM target some chips that have floating point instruction sets that are not IEEE compliant? Can we be certain that no new LLVM target will ever have to jump through hoops to avoid
2018 Sep 11
2
[FPEnv] FNEG instruction
+1 for an explicit FNEG instruction, since as previously discussed, it has
stricter requirements for what value may be returned by the operation. And
strengthening the requirement on FSUB is not feasible when the values are
variables rather than literals.
That is:
FSUB(-0.0, NaN) = either NaN *or* -NaN
FSUB(-0.0, -NaN) = either NaN *or* -NaN
FNEG(NaN) = -NaN
FNEG(-NaN) = NaN
On Tue, Sep 11,
2018 Sep 25
2
[FPEnv] FNEG instruction
On Tue, Sep 25, 2018 at 1:39 PM Sanjay Patel <spatel at rotateright.com> wrote:
> I have 1 concern about adding an explicit fneg op to IR:
>
> Currently, fneg qualifies as a binop in IR (since there's no other way to
> represent it), and we have IR transforms that are based on matching that
> pattern (m_BinOp). With a proper unary fneg instruction, those transforms
>
2018 Sep 26
2
[FPEnv] FNEG instruction
Do we really want to have fneg be the only instruction with guaranteed no side effects? That just sounds like a gotcha waiting to happen. Or it could result in horrible code depending on the architecture.
I’m still leaning towards having both an intrinsic and an instruction, and if they happen to have the same behavior then that’s fine. If fneg is to be a special instruction with extra promises
2018 Sep 11
2
[FPEnv] FNEG instruction
Which exactly was the plan?
Add a new, regular instruction?
Add a new constrained math intrinsic?
Both?
Andrew Kaylor made a good point here:
* As I said, all LLVM IR FP instructions are //assumed// to have no side effects. I'm not sure we want an instruction that goes beyond this to be //defined// as having no side effects. It adds a complication to the language and introduces
2018 Aug 29
3
[FPEnv] FNEG instruction
On Wed, 29 Aug 2018 at 07:51, Cameron McInally via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> The current thinking is that FNEG(X) and FSUB(-0.0, X) are not the same operation when X is a NaN or 0.
Do you mean denormals (when flushed) rather than 0 there? AFAIK it's
OK for 0 itself.
> So, the xforms in question should only be valid under Fast-Math conditions.
We could
2018 Aug 21
3
[FPEnv] FNEG instruction
Hey llvm-dev,
Continuing a discussion from D50913...
A group working on the FP rounding mode and trap-safety project have run
into a situation where it would make sense to add a new FNEG instruction
and decouple the existing FNEG<->FSUB transformations.
The IEEE-754 Standard (Section 5.5.1) makes it clear that neg(x) and
sub(-0.0,x) are two different operations. The former is a bitwise
2018 Sep 26
2
[FPEnv] FNEG instruction
Well, yes, they are different operations. And, yes, this needs to be corrected. This wasn’t my point. It’s a given.
I was getting at the _declared_ absence of side effects and what promises we make to anyone using the new fneg instruction. Is this a promise we want to make?
From: Cameron McInally <cameron.mcinally at nyu.edu>
Sent: Wednesday, September 26, 2018 2:30 PM
To: Kevin Neal
2018 Sep 27
2
[FPEnv] FNEG instruction
Regarding non-IEEE targets: yes, we definitely support those, so we do have
to be careful about not breaking them. I know because I have broken them. :)
See the discussion and related links here: https://reviews.llvm.org/D19391
But having an exactly specified fneg op makes that easier, not harder, as I
see it. Unfortunately, if a target doesn't support this op (always toggle
the sign bit and
2018 Oct 01
6
[FPEnv] FNEG instruction
I don't see any controversy for the preliminary requirement of
removing BinaryOperator::isFNeg()
and friends, so start with that?
That work may reveal other potential regressions that we can patch in
advance too.
Other than that, I think there's really only a question of do we want 1 or
both of fneg and fneg_constrained (and if we choose both, then I assume
we'd also add
2008 Sep 17
2
[LLVMdev] Custom Lowering and fneg
On Tue, Sep 16, 2008 at 3:43 PM, Villmow, Micah <Micah.Villmow at amd.com> wrote:
> Eli,
> I've been working on this for a few days and still haven't gotten this
> towork. I've attached my dags that you asked for, and even there it is
> turning the floating point instruction into an integer return value.
Hmm, that's kind of strange... in that case, there's
2018 Sep 26
2
[FPEnv] FNEG instruction
On Tue, Sep 25, 2018 at 7:37 PM Sanjay Patel <spatel at rotateright.com> wrote:
>
>
> On Tue, Sep 25, 2018 at 2:28 PM Cameron McInally <cameron.mcinally at nyu.edu>
> wrote:
>
>> On Tue, Sep 25, 2018 at 1:39 PM Sanjay Patel <spatel at rotateright.com>
>> wrote:
>>
>>> I have 1 concern about adding an explicit fneg op to IR:
>>>
2009 May 20
2
[LLVMdev] [PATCH] Add new phase to legalization to handle vector operations
Per subject, this patch adding an additional pass to handle vector
operations; the idea is that this allows removing the code from
LegalizeDAG that handles illegal types, which should be a significant
simplification. There are still some issues with this patch, but does
the approach look sane?
-Eli
-------------- next part --------------
Index: lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
2018 Aug 30
2
[FPEnv] FNEG instruction
On Thu, Aug 30, 2018 at 11:14 AM, Tim Northover <t.p.northover at gmail.com>
wrote:
> ...
> I don't think it matters for the question at hand, but I tested
> AArch64 too and it exhibits the behaviour you were describing. That
> is, we'd have problems if an fsub -0.0 was actually CodeGened like
> that (it's not, of course).
Great data point. So it's not just
2008 Sep 23
1
[LLVMdev] Tablegen strings
I have a tablegen string that I want to add a modifier to the registers
that are being matched.
For example a simple match on fneg:
def FNEG : OneInOneOut<IL_OP_MOV, (outs GPR:$dst), (ins
GPR:$src0),
"mov $dst, $src0", [(set GPR:$dst, (fneg GPR:$src0))]>;
I want to place a modifier directly after $src0 in the string so that no
space is between the string
and
2018 Oct 02
3
[FPEnv] FNEG instruction
On Tue, Oct 2, 2018 at 12:09 PM Kevin Neal <Kevin.Neal at sas.com> wrote:
> If we don’t have constrained intrinsics for some of the fp math
> instructions then aren’t we risking non-strict optimizations?
>
So far we've only added constrained FP intrinsics for operations that have
side effects (i.e. can trap).
The quiet-computational sign-bit operations are special. They never