Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: should use FNEG for float32/64 on ppc64 #9598

Closed
minux opened this issue Jan 15, 2015 · 4 comments
Closed

cmd/compile: should use FNEG for float32/64 on ppc64 #9598

minux opened this issue Jan 15, 2015 · 4 comments

Comments

@minux
Copy link
Member

minux commented Jan 15, 2015

It always generates FMUL -1 for OMINUS now.
However, Power does support double precision FNEG, it just
doesn't support single precision FNEGS.

But it's still fine to use FNEG for both float32 and float64, as
Power ISA documents that FNEG simply inverts bit 0.

@minux minux self-assigned this Jan 15, 2015
@minux minux added this to the Go1.5 milestone Jan 15, 2015
@minux minux changed the title cmd/9g: should use AFNEG for float64 cmd/9g: should use FNEG for float64 Jan 15, 2015
@minux minux changed the title cmd/9g: should use FNEG for float64 cmd/9g: should use FNEG for float32/64 Jan 15, 2015
@rsc
Copy link
Contributor

rsc commented Jun 8, 2015

I believe this is too unimportant for right now. Finishing the port (especially those nagging cgo details) takes priority over microoptimizations. Removing milestone.

@rsc rsc modified the milestones: Unplanned, Go1.5 Jun 8, 2015
@rsc rsc changed the title cmd/9g: should use FNEG for float32/64 cmd/compile: should use FNEG for float32/64 on ppc64 Jun 8, 2015
@josharian
Copy link
Contributor

@dr2chase does ppc64 SSA do this? Can we close this issue?

@dr2chase
Copy link
Contributor

It should be fixed in 1.8:

(Neg64F x) -> (FNEG x)
(Neg32F x) -> (FNEG x)
    {name: "FNEG", argLength: 1, reg: fp11, asm: "FNEG"},   // -arg0 (floating point)
    case ssa.OpPPC64NEG, ssa.OpPPC64FNEG, ssa.OpPPC64FSQRT, ssa.OpPPC64FSQRTS, ssa.OpPPC64FCTIDZ, ssa.OpPPC64FCTIWZ, ssa.OpPPC64FCFID, ssa.OpPPC64FRSP:
        r := gc.SSARegNum(v)
        p := gc.Prog(v.Op.Asm())

@josharian
Copy link
Contributor

Thanks. Closing.

@golang golang locked and limited conversation to collaborators Aug 19, 2017
@rsc rsc unassigned minux Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants