]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: negate comparision with FNES/FNED on riscv64
authorJoel Sing <joel@sing.id.au>
Sat, 27 Aug 2022 16:32:06 +0000 (02:32 +1000)
committerJoel Sing <joel@sing.id.au>
Fri, 2 Sep 2022 20:14:16 +0000 (20:14 +0000)
commit646c3eee06fa4b1b869e8183977aa46d4d4eb646
tree14e90bb8314fa3ae0c325eed7447d282ca8a2fe3
parent9154d4a2a4952e35cb091fc254c9f5f1d3f0d409
cmd/compile: negate comparision with FNES/FNED on riscv64

The FNES and FNED instructions are pseudo-instructions, which the
assembler expands to FEQS/NEG or FEQD/NEG - if we're comparing the
result via a branch instruction, we can avoid an instruction by
negating both the branch comparision and the floating point
comparision.

This only removes a handful of instructions from the Go binary,
however, it will provide benefit to floating point intensive code.

Change-Id: I4e3124440b7659acc4d9bc9948b755a4900a422f
Reviewed-on: https://go-review.googlesource.com/c/go/+/426261
Reviewed-by: Meng Zhuo <mzh@golangcn.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Joel Sing <joel@sing.id.au>
Run-TryBot: Meng Zhuo <mzh@golangcn.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
src/cmd/compile/internal/ssa/gen/RISCV64.rules
src/cmd/compile/internal/ssa/rewriteRISCV64.go