Skip to content

cmd/compile: better generated code for a&^b on ppc64x #17567

@laboger

Description

@laboger

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

tip

What operating system and processor architecture are you using (go env)?

Ubuntu 16.04 ppc64le

What did you do?

Looking at generated code for sha3, found some unnecessary code for a statement like a & ^b

  f046c:       ff ff e0 3f     lis     r31,-1
  f0470:       ff ff ff 63     ori     r31,r31,65535
  f0474:       78 62 ee 7f     xor     r14,r31,r12
  f0478:       38 70 6e 7d     and     r14,r11,r14

Better code would be:

   ef794:       78 30 06 7d     andc    r6,r8,r6

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions