aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/ifuzz/riscv64/util.go
blob: efa395ffa578c004658195069c6c31ca8c46f4fc (plain)
1
2
3
4
5
6
7
8
9
// Copyright 2026 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

package riscv64

func extractBits(from uint32, start, size uint) uint32 {
	mask := uint32((1 << size) - 1)
	return (from >> (start - size + 1)) & mask
}