Skip to content

amd64: support vector broadcast and extract instructions#20

Merged
xushiwei merged 2 commits into
xgo-dev:mainfrom
zhouguangyuan0718:agent/amd64-asm-support
Jul 22, 2026
Merged

amd64: support vector broadcast and extract instructions#20
xushiwei merged 2 commits into
xgo-dev:mainfrom
zhouguangyuan0718:agent/amd64-asm-support

Conversation

@zhouguangyuan0718

Copy link
Copy Markdown
Contributor

What changed

Add generic amd64 lowering for vector broadcast, bitwise XOR, ternary XOR, vector GF(2) affine, and 64-bit lane extraction forms used by optimized compression dependencies:

  • PEXTRQ (register and memory destinations)
  • VBROADCASTI128
  • VBROADCASTF32X2
  • VBROADCASTSD
  • VXORPD
  • YMM forms of VPTERNLOGD (XOR form, immediate 0x96)
  • YMM forms of VGF2P8AFFINEQB

Add focused translation tests for the new operand forms.

Why

LLGo's real Plan 9 assembly translation reported unsupported amd64 instructions in:

  • github.com/minio/crc64nvme/crc64_amd64.s (PEXTRQ)
  • github.com/klauspost/reedsolomon/galois_amd64.s
  • github.com/klauspost/reedsolomon/galois_gen_amd64.s

The lowering stays in the generic amd64 vector implementation and does not depend on package paths or individual callers.

Validation

  • GOWORK=off go test ./...
  • go test ./internal/plan9asm in LLGo with the local plan9asm workspace
  • Real LLGo translation passed for work/compress/s2, crc64nvme, reedsolomon, and the nopshufb generated variant.

@zhouguangyuan0718
zhouguangyuan0718 marked this pull request as ready for review July 20, 2026 11:57
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.65217% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
amd64_lower_vec.go 95.65% 3 Missing and 3 partials ⚠️

📢 Thoughts on this report? Let us know!

@xushiwei
xushiwei merged commit 909126b into xgo-dev:main Jul 22, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants