Skip to content

Conversation

@roomote
Copy link

@roomote roomote bot commented Dec 20, 2025

This PR adds 7 new opcodes to the Von Neumann VM:

New Opcodes

Bitwise Operations (all operate on int64)

  • AND - Bitwise AND
  • OR - Bitwise OR
  • XOR - Bitwise XOR
  • SHL - Shift Left
  • SHR - Shift Right (logical, zero-fill)

Comparison Operations

  • GTI - Greater Than Int
  • GTS - Greater Than String (lexicographic)

Changes

  • Added 7 opcode constants and handlers in von/cpu.go
  • Added 7 builder methods in assembler/asm.go
  • Added 11 test cases in assembler/asm_test.go
  • Fixed Go 1.15+ compatibility issue with int-to-string conversion
  • Initialized go.mod for module support

Test Results

All 16 tests pass (11 new + 5 existing).

…omparisons (GTI, GTS)

- Add 7 new opcodes to von/cpu.go with switch case handlers
- Add 7 assembler builder methods in assembler/asm.go
- Add 11 new test cases for all new operations
- Fix pre-existing Go 1.15+ compatibility issue in test (string conversion)
- Initialize go.mod for module support
@roomote
Copy link
Author

roomote bot commented Dec 20, 2025

Rooviewer Clock   See task on Roo Cloud

Review completed. The implementation of bitwise opcodes and comparison operations looks solid with comprehensive tests. Found 1 issue that needs attention:

  • Fix invalid Go version in go.mod (currently set to non-existent 1.25.5)

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@@ -0,0 +1,3 @@
module github.com/qiniu/arch

go 1.25.5
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invalid Go version specified. Go versions follow the format major.minor (e.g., 1.21, 1.22, 1.23), not major.minor.patch. The version 1.25.5 doesn't exist and will cause the module to fail validation. Use a valid Go version like 1.21 or 1.23.

Suggested change
go 1.25.5
go 1.21

Fix it with Roo Code or mention @roomote and request a fix.

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