Skip to content

Building binary select on a bitset represented by a single uint64 (64 consecutive bits 0 or 1) on ARM64.

Notifications You must be signed in to change notification settings

Tushar-kalsi/GolangBinarySelect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GoSelect

GoSelect is a Go application that demonstrates the use of assembly language to perform bit manipulation operations in Go. It includes examples of selecting a specific bit from a binary sequence and counting trailing zeros in a 64-bit integer.

Table of Contents

Usage

  1. Ensure you have the Go programming language installed on your system.

  2. Build and run the GoSelect application:

    go run main.go
    
    

This will execute the select_u64 function, which selects a specific bit from a binary sequence and prints the result.

  1. The TrailingZeros64 function counts and prints the number of trailing zeros in a 64-bit integer. You can call this function from your own code as needed.

How It Works

select_u64 The select_u64 function demonstrates the use of the "pdep" operation using assembly language to select a specific bit from a binary sequence. It takes a 64-bit integer and an index as input and returns the selected bit.

func select_u64(x uint64, i uint64) int

TrailingZeros64`

The TrailingZeros64 function calculates the number of trailing zeros in a 64-bit integer using an assembly implementation.

func TrailingZeros64(x uint64) int

Benchmark results

The following are the benchmark results for the Selectu64() function:

Benchmark Nanoseconds/op
BenchmarkSelectu64AverageTime/Selectu64 234.4

This means that it takes an average of 234.4 nanoseconds to run the Selectu64() function.

Device details for ARM processors

The following is a table of device details for ARM processors:

Device Processor Architecture Fabrication process Core count Clock speed
Apple A16 Bionic A16 Bionic 64-bit 4nm 6 Up to 3.46 GHz
Qualcomm Snapdragon 8 Gen 2 Kryo 780 64-bit 4nm 8 Up to 3.2 GHz
MediaTek Dimensity 9200 Cortex-X3 64-bit 4nm 8 Up to 3.05 GHz
Samsung Exynos 2300 Cortex-X1 64-bit 4nm 8 Up to 3.0 GHz
Google Tensor G2 Cortex-X1 64-bit 5nm 8 Up to 2.8 GHz

This table is just a sample, and there are many other ARM processors available on the market. The specific device details will vary depending on the specific processor and device.

Please note that the clock speed is not the only factor that determines the performance of a processor. Other factors, such as the number of cores, the architecture, and the fabrication process, also play a role.

License

This project is open-source and available under the MIT License.

Author

Created by Tushar Feel free to modify this README file to provide more context or additional information about your project. Additionally, consider adding a license file (e.g., LICENSE) to specify the terms under which your code can be used.

If you have any questions or need further assistance, please don't hesitate to reach o

About

Building binary select on a bitset represented by a single uint64 (64 consecutive bits 0 or 1) on ARM64.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages