Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
1815c7a
reusable amd64 interpreter
korniltsev Apr 23, 2025
3903ab0
update asm/variable changes
korniltsev Jun 4, 2025
bef475a
inline size* consts, rename sz to bits
korniltsev Jun 4, 2025
d154ed7
Apply suggestions from code review
korniltsev Jun 4, 2025
316680d
fix build
korniltsev Jun 4, 2025
3697495
rename U64 to Expression. Rename Eval to Match.
korniltsev Jun 4, 2025
29361e7
rename Match argument to `pattern`
korniltsev Jun 4, 2025
db73b51
lint
korniltsev Jun 4, 2025
6b2503b
update RIP for "skippable instructions"
korniltsev Jun 4, 2025
530971f
rewrite interpreter with switch/case isntead of if/else
korniltsev Jun 4, 2025
3f4a39c
lint
korniltsev Jun 4, 2025
32cce7d
add mem test
korniltsev Jun 4, 2025
f7a0cfc
Update asm/amd/regs_state.go
korniltsev Jun 10, 2025
b829b15
add a comment
korniltsev Jun 4, 2025
a42eb0b
renames
korniltsev Jun 10, 2025
3362ed1
remove RegsState.DebugString()
korniltsev Jun 10, 2025
2816cbf
remove IsJump
korniltsev Jun 10, 2025
cdc7473
Apply suggestions from code review
korniltsev Jun 17, 2025
4932145
fix build
korniltsev Jun 17, 2025
e57374e
review fixes
korniltsev Jun 17, 2025
93d5870
Merge remote-tracking branch 'upstream/main' into reusable-amd-interp…
korniltsev Jun 17, 2025
a0f52cc
lint
korniltsev Jun 17, 2025
dc208b8
review fixes
korniltsev Jun 20, 2025
456ee85
Merge remote-tracking branch 'upstream/main' into reusable-amd-interp…
korniltsev Jun 20, 2025
e4e2771
introduce module specific registers
korniltsev Jun 20, 2025
f1d3bad
split variable into variable and capure
korniltsev Jun 9, 2025
f9c7087
move interpreter code to a separate file
korniltsev Jun 20, 2025
433c9c8
rename decode.go to wrapper_decode.go
korniltsev Jun 20, 2025
8ca045d
cleanup ops Match
korniltsev Jun 20, 2025
d728d8e
update comment
korniltsev Jun 20, 2025
96de7ff
remove operands push/pop operations
korniltsev Jun 20, 2025
3b939cd
add more disassembly to tests
korniltsev Jun 20, 2025
aecbafe
fix operands order
korniltsev Jun 20, 2025
1528ec1
remove equalsRecursive
korniltsev Jun 20, 2025
229f391
Update asm/expression/named.go
korniltsev Jun 26, 2025
54108ed
review fixes
korniltsev Jun 26, 2025
9589217
review fixes
korniltsev Jun 26, 2025
83ac91e
Apply suggestions from code review
korniltsev Jul 11, 2025
3339941
Merge remote-tracking branch 'upstream/main' into reusable-amd-interp…
korniltsev Jul 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions asm/amd/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
testdata/fuzz
36 changes: 35 additions & 1 deletion asm/amd/insn.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
// SPDX-License-Identifier: Apache-2.0

package amd // import "go.opentelemetry.io/ebpf-profiler/asm/amd"
import "bytes"
import (
"bytes"

"golang.org/x/arch/x86/x86asm"
)

// https://www.felixcloutier.com/x86/endbr64
var opcodeEndBr64 = []byte{0xf3, 0x0f, 0x1e, 0xfa}
Expand All @@ -18,3 +22,33 @@ func DecodeSkippable(code []byte) (ok bool, size int) {
return false, 0
}
}

func IsJump(op x86asm.Op) bool {
Comment thread
fabled marked this conversation as resolved.
Outdated
switch op {
case
x86asm.RET,
x86asm.JMP,
x86asm.JA,
x86asm.JAE,
x86asm.JB,
x86asm.JBE,
x86asm.JCXZ,
x86asm.JE,
x86asm.JECXZ,
x86asm.JG,
x86asm.JGE,
x86asm.JL,
x86asm.JLE,
x86asm.JNE,
x86asm.JNO,
x86asm.JNP,
x86asm.JNS,
x86asm.JO,
x86asm.JP,
x86asm.JRCXZ,
x86asm.JS:
return true
default:
return false
}
}
Loading