Giter Site home page Giter Site logo

lsx86features's Introduction

lsx86features: list x86 extension sets used by a compiled binary

This program is useful for checking whether your compiled binaries make use of certain vector instructions that are not commonly available but your CPU supports.

For example, suppose that your CPU supports the AVX-512 vector extension set:

$ lscpu | grep ^Flags | tr ' ' '\n' | grep avx512
avx512f
avx512dq
avx512ifma
avx512cd
avx512bw
avx512vl
avx512vbmi
avx512_vbmi2
avx512_vnni
avx512_bitalg
avx512_vpopcntdq

If you want to know whether functions in your hot path use this extension set, you can check with the following command and confirm that it does not:

$ lsx86features -s your_binary
Functions that use the mmx extension set:
- err@@Base
- err@@Base-0x5ade0
- error@@Base
- getopt_long_only@@Base
- re_compile_fastmap@@Base
- re_match_2@@Base
- re_set_registers@@Base
- regcomp@@Base
- regerror@@Base
- regfree@@Base
- xrealloc@@Base

Functions that use the sse extension set:
- err@@Base
- err@@Base-0x5ade0
- error@@Base
- getopt_long_only@@Base
- regerror@@Base
- regfree@@Base
- xrealloc@@Base

Functions that use the sse2 extension set:
- err@@Base
- err@@Base-0x5ade0
- error@@Base
- getopt_long_only@@Base
- re_match_2@@Base
- regfree@@Base
- xrealloc@@Base

Installation

lsx86features requires the following packages on Debian/Ubuntu:

  • binutils
  • perl

To install these, run

$ sudo apt install perl binutils

To install lsx86features in your user-specific bin directory, run

$ git clone https://codeberg.org/gnyeki/lsx86features
$ cd lsx86features
$ make install

More examples

List all known instruction set extensions that are used by a compiled binary:

$ lsx86features your_binary | cut -f1 | sort | uniq
UNKNOWN
avx
avx2
mmx
sse
sse2

List instructions in a compiled binary:

$ lsx86features your_binary | sort -r | head -25
sse	924	movaps
sse	39	xorps
sse	2	movlps
sse	15	pmovmskb
sse	1242	movups
sse	1	movmskps
avx2	98	vpermpd
avx2	9	vpbroadcastd
avx2	8	vbroadcasti128
avx2	40	vpermq
avx2	4	vpsllvq
avx2	4	vinserti128
avx2	34	vpbroadcastb
avx2	26	vextracti128
avx2	16	vpermps
avx2	140	vperm2i128
avx2	14	vpbroadcastq
avx2	10	vpblendd
avx	7	vbroadcastss
avx	4	vextractf128
avx	34	vperm2f128
avx	1551	vzeroupper
avx	13	vpermilps
UNKNOWN	9972	jne
UNKNOWN	993	movl

lsx86features's People

Contributors

gn0 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.