BSR (R64, M64)
Summary:
"Bit Scan Reverse"
Reference:
https://www.felixcloutier.com/x86/BSR.html
Extension:
BASE
Category:
BITBYTE
ISA-Set:
I386
CPL:
3
iform:
BSR_GPRv_MEMv
iclass:
BSR
ASM:
BSR
Operands
Operand 1 (w): Register (RAX, RCX, RDX, RBX, RSP, RBP, RSI, RDI, R8, R9, R10, R11, R12, R13, R14, R15)
Operand 2 (r): Memory
Operand 3 (w, suppressed): Flags (AF: undef, CF: undef, OF: undef, PF: undef, SF: undef, ZF: w)
Available performance data
Alder Lake-P
Alder Lake-E
Rocket Lake
Tiger Lake
Ice Lake
Cascade Lake
Cannon Lake
Skylake-X
Coffee Lake
Kaby Lake
Skylake
Broadwell
Haswell
Ivy Bridge
Sandy Bridge
Westmere
Nehalem
Wolfdale
Conroe
Tremont
Goldmont Plus
Goldmont
Airmont
Bonnell
AMD Zen 4
AMD Zen 3
AMD Zen 2
AMD Zen+
Alder Lake-P
Measurements
Latencies
Latency operand 1 → 1:
3
Latency operand 1 → 3:
3
Latency operand 2 → 1 (address, base register):
8
Latency operand 2 → 1 (address, index register):
8
Latency operand 2 → 1 (memory):
≤3
Latency operand 2 → 3 (address, base register):
8
Latency operand 2 → 3 (address, index register):
8
Latency operand 2 → 3 (memory):
≤3
Throughput
Computed from the port usage: 1.00
Measured (loop):
1.00
Measured (unrolled):
1.00
Number of μops
Executed: 2
Retire slots: 1
Decoded (MITE): 1
Microcode Sequencer (MS): 0
Port usage:
1*p1+1*p23A
Alder Lake-E
Measurements
Latencies
Latency operand 1 → 1:
3
Latency operand 1 → 3:
3
Latency operand 2 → 1 (address, base register):
7
Latency operand 2 → 1 (address, index register):
7
Latency operand 2 → 1 (memory):
≤3
Latency operand 2 → 3 (address, base register):
7
Latency operand 2 → 3 (address, index register):
7
Latency operand 2 → 3 (memory):
≤3
Throughput
Measured (loop):
1.00
Measured (unrolled):
1.00
Number of μops
Executed: 1
Microcode Sequencer (MS): 0
Rocket Lake
Measurements
Latencies
Latency operand 1 → 1:
3
Latency operand 1 → 3:
3
Latency operand 2 → 1 (address, base register):
8
Latency operand 2 → 1 (address, index register):
8
Latency operand 2 → 1 (memory):
≤3
Latency operand 2 → 3 (address, base register):
8
Latency operand 2 → 3 (address, index register):
8
Latency operand 2 → 3 (memory):
≤3
Throughput
Computed from the port usage: 1.00
Measured (loop):
1.00
Measured (unrolled):
1.00
Number of μops
Executed: 2
Retire slots: 1
Decoded (MITE): 1
Microcode Sequencer (MS): 0
Port usage:
1*p1+1*p23
Tiger Lake
Measurements
Latencies
Latency operand 1 → 1:
3
Latency operand 1 → 3:
3
Latency operand 2 → 1 (address, base register):
8
Latency operand 2 → 1 (address, index register):
8
Latency operand 2 → 1 (memory):
≤3
Latency operand 2 → 3 (address, base register):
8
Latency operand 2 → 3 (address, index register):
8
Latency operand 2 → 3 (memory):
≤3
Throughput
Computed from the port usage: 1.00
Measured (loop):
1.00
Measured (unrolled):
1.00
Number of μops
Executed: 2
Retire slots: 1
Decoded (MITE): 1
Microcode Sequencer (MS): 0
Port usage:
1*p1+1*p23
Ice Lake
Measurements
Latencies
Latency operand 1 → 1:
3
Latency operand 1 → 3:
3
Latency operand 2 → 1 (address, base register):
8
Latency operand 2 → 1 (address, index register):
8
Latency operand 2 → 1 (memory):
≤3
Latency operand 2 → 3 (address, base register):
8
Latency operand 2 → 3 (address, index register):
8
Latency operand 2 → 3 (memory):
≤3
Throughput
Computed from the port usage: 1.00
Measured (loop):
1.00
Measured (unrolled):
1.00
Number of μops
Executed: 2
Retire slots: 1
Decoded (MITE): 1
Microcode Sequencer (MS): 0
Port usage:
1*p1+1*p23
Cascade Lake
Measurements
Latencies
Latency operand 1 → 1:
3
Latency operand 1 → 3:
3
Latency operand 2 → 1 (address, base register):
8
Latency operand 2 → 1 (address, index register):
8
Latency operand 2 → 1 (memory):
≤5
Latency operand 2 → 3 (address, base register):
8
Latency operand 2 → 3 (address, index register):
8
Latency operand 2 → 3 (memory):
≤5
Throughput
Computed from the port usage: 1.00
Measured (loop):
1.00
Measured (unrolled):
1.00
Number of μops
Executed: 2
Retire slots: 1
Decoded (MITE): 1
Microcode Sequencer (MS): 0
Port usage:
1*p1+1*p23
Cannon Lake
Measurements
Latencies
Latency operand 1 → 1:
3
Latency operand 1 → 3:
3
Latency operand 2 → 1 (address, base register):
8
Latency operand 2 → 1 (address, index register):
8
Latency operand 2 → 1 (memory):
≤5
Latency operand 2 → 3 (address, base register):
8
Latency operand 2 → 3 (address, index register):
8
Latency operand 2 → 3 (memory):
≤5
Throughput
Computed from the port usage: 1.00
Measured (loop):
1.00
Measured (unrolled):
1.00
Number of μops
Executed: 2
Retire slots: 1
Decoded (MITE): 1
Microcode Sequencer (MS): 0
Port usage:
1*p1+1*p23
Skylake-X
Measurements
Latencies
Latency operand 1 → 1:
3
Latency operand 1 → 3:
3
Latency operand 2 → 1 (address, base register):
8
Latency operand 2 → 1 (address, index register):
8
Latency operand 2 → 1 (memory):
≤5
Latency operand 2 → 3 (address, base register):
8
Latency operand 2 → 3 (address, index register):
8
Latency operand 2 → 3 (memory):
≤5
Throughput
Computed from the port usage: 1.00
Measured (loop):
1.00
Measured (unrolled):
1.00
Number of μops
Executed: 2
Retire slots: 1
Decoded (MITE): 1
Microcode Sequencer (MS): 0
Port usage:
1*p1+1*p23
IACA 2.3
Throughput
Computed from the port usage: 1.00
IACA:
1.00
Number of μops:
2
Port usage:
1*p1+1*p23
IACA 3.0
Throughput
Computed from the port usage: 1.00
IACA:
1.00
Number of μops:
2
Port usage:
1*p1+1*p23
Coffee Lake
Measurements
Latencies
Latency operand 1 → 1:
3
Latency operand 1 → 3:
3
Latency operand 2 → 1 (address, base register):
8
Latency operand 2 → 1 (address, index register):
8
Latency operand 2 → 1 (memory):
≤5
Latency operand 2 → 3 (address, base register):
8
Latency operand 2 → 3 (address, index register):
8
Latency operand 2 → 3 (memory):
≤5
Throughput
Computed from the port usage: 1.00
Measured (loop):
1.00
Measured (unrolled):
1.00
Number of μops
Executed: 2
Retire slots: 1
Decoded (MITE): 1
Microcode Sequencer (MS): 0
Port usage:
1*p1+1*p23
Kaby Lake
Measurements
Latencies
Latency operand 1 → 1:
3
Latency operand 1 → 3:
3
Latency operand 2 → 1 (address, base register):
8
Latency operand 2 → 1 (address, index register):
8
Latency operand 2 → 1 (memory):
≤5
Latency operand 2 → 3 (address, base register):
8
Latency operand 2 → 3 (address, index register):
8
Latency operand 2 → 3 (memory):
≤5
Throughput
Computed from the port usage: 1.00
Measured (loop):
1.00
Measured (unrolled):
1.00
Number of μops
Executed: 2
Retire slots: 1
Decoded (MITE): 1
Microcode Sequencer (MS): 0
Port usage:
1*p1+1*p23
Skylake
Measurements
Latencies
Latency operand 1 → 1:
3
Latency operand 1 → 3:
3
Latency operand 2 → 1 (address, base register):
8
Latency operand 2 → 1 (address, index register):
8
Latency operand 2 → 1 (memory):
≤5
Latency operand 2 → 3 (address, base register):
8
Latency operand 2 → 3 (address, index register):
8
Latency operand 2 → 3 (memory):
≤5
Throughput
Computed from the port usage: 1.00
Measured (loop):
1.00
Measured (unrolled):
1.00
Number of μops
Executed: 2
Retire slots: 1
Decoded (MITE): 1
Microcode Sequencer (MS): 0
Port usage:
1*p1+1*p23
IACA 2.3
Throughput
Computed from the port usage: 1.00
IACA:
1.00
Number of μops:
2
Port usage:
1*p1+1*p23
IACA 3.0
Throughput
Computed from the port usage: 1.00
IACA:
1.00
Number of μops:
2
Port usage:
1*p1+1*p23
Broadwell
Measurements
Latencies
Latency operand 1 → 1:
3
Latency operand 1 → 3:
3
Latency operand 2 → 1 (address, base register):
8
Latency operand 2 → 1 (address, index register):
8
Latency operand 2 → 1 (memory):
≤7
Latency operand 2 → 3 (address, base register):
8
Latency operand 2 → 3 (address, index register):
8
Latency operand 2 → 3 (memory):
≤7
Throughput
Computed from the port usage: 1.00
Measured (loop):
1.00
Measured (unrolled):
1.00
Number of μops
Executed: 2
Retire slots: 1
Decoded (MITE): 1
Microcode Sequencer (MS): 0
Port usage:
1*p1+1*p23
IACA 2.2
Throughput
Computed from the port usage: 1.00
IACA:
1.00 (with the -no_interiteration flag: 1.00)
Number of μops:
2
Port usage:
1*p1+1*p23
IACA 2.3
Throughput
Computed from the port usage: 1.00
IACA:
1.00
Number of μops:
2
Port usage:
1*p1+1*p23
IACA 3.0
Throughput
Computed from the port usage: 1.00
IACA:
1.00
Number of μops:
2
Port usage:
1*p1+1*p23
Haswell
Measurements
Latencies
Latency operand 1 → 1:
3
Latency operand 1 → 3:
3
Latency operand 2 → 1 (address, base register):
8
Latency operand 2 → 1 (address, index register):
8
Latency operand 2 → 1 (memory):
≤7
Latency operand 2 → 3 (address, base register):
8
Latency operand 2 → 3 (address, index register):
8
Latency operand 2 → 3 (memory):
≤7
Throughput
Computed from the port usage: 1.00
Measured (loop):
1.00
Measured (unrolled):
1.00
Number of μops
Executed: 2
Retire slots: 1
Decoded (MITE): 1
Microcode Sequencer (MS): 0
Port usage:
1*p1+1*p23
IACA 2.1
Latency:
8
Throughput
Computed from the port usage: 1.00
IACA:
1.00 (with the -no_interiteration flag: 1.00)
Number of μops:
2
Port usage:
1*p1+1*p23
IACA 2.2
Throughput
Computed from the port usage: 1.00
IACA:
1.00 (with the -no_interiteration flag: 1.00)
Number of μops:
2
Port usage:
1*p1+1*p23
IACA 2.3
Throughput
Computed from the port usage: 1.00
IACA:
1.00
Number of μops:
2
Port usage:
1*p1+1*p23
IACA 3.0
Throughput
Computed from the port usage: 1.00
IACA:
1.00
Number of μops:
2
Port usage:
1*p1+1*p23
Ivy Bridge
Measurements
Latencies
Latency operand 1 → 1:
3
Latency operand 1 → 3:
3
Latency operand 2 → 1 (address, base register):
8
Latency operand 2 → 1 (address, index register):
8
Latency operand 2 → 1 (memory):
≤7
Latency operand 2 → 3 (address, base register):
8
Latency operand 2 → 3 (address, index register):
8
Latency operand 2 → 3 (memory):
≤7
Throughput
Computed from the port usage: 1.00
Measured (loop):
1.00
Measured (unrolled):
1.00
Number of μops
Executed: 2
Retire slots: 1 (if an indexed addressing mode is used: 2)
Decoded (MITE): 1
Microcode Sequencer (MS): 0
Port usage:
1*p1+1*p23
IACA 2.1
Latency:
8
Throughput
Computed from the port usage: 1.00
IACA:
1.00 (with the -no_interiteration flag: 1.00)
Number of μops:
2
Port usage:
1*p1+1*p23
IACA 2.2
Throughput
Computed from the port usage: 1.00
IACA:
1.00 (with the -no_interiteration flag: 1.00)
Number of μops:
2
Port usage:
1*p1+1*p23
IACA 2.3
Throughput
Computed from the port usage: 1.00
IACA:
1.00
Number of μops:
2
Port usage:
1*p1+1*p23
Sandy Bridge
Measurements
Latencies
Latency operand 1 → 1:
3
Latency operand 1 → 3:
3
Latency operand 2 → 1 (address, base register):
8
Latency operand 2 → 1 (address, index register):
8
Latency operand 2 → 1 (memory):
≤7
Latency operand 2 → 3 (address, base register):
8
Latency operand 2 → 3 (address, index register):
8
Latency operand 2 → 3 (memory):
≤7
Throughput
Computed from the port usage: 1.00
Measured (loop):
1.00
Measured (unrolled):
1.00
Number of μops
Executed: 2
Retire slots: 1 (if an indexed addressing mode is used: 2)
Decoded (MITE): 1
Microcode Sequencer (MS): 0
Port usage:
1*p1+1*p23
IACA 2.1
Latency:
8
Throughput
Computed from the port usage: 1.00
IACA:
1.00 (with the -no_interiteration flag: 1.00)
Number of μops:
2
Port usage:
1*p1+1*p23
IACA 2.2
Throughput
Computed from the port usage: 1.00
IACA:
1.00 (with the -no_interiteration flag: 1.00)
Number of μops:
2
Port usage:
1*p1+1*p23
IACA 2.3
Throughput
Computed from the port usage: 1.00
IACA:
1.00
Number of μops:
2
Port usage:
1*p1+1*p23
Westmere
Measurements
Latencies
Latency operand 1 → 1:
3
Latency operand 1 → 3:
4
Latency operand 2 → 1 (address, base register):
7
Latency operand 2 → 1 (address, index register):
7
Latency operand 2 → 1 (memory):
≤7
Latency operand 2 → 3 (address, base register):
7
Latency operand 2 → 3 (address, index register):
7
Latency operand 2 → 3 (memory):
≤7
Throughput
Computed from the port usage: 1.00
Measured (loop):
1.00
Measured (unrolled):
1.00
Number of μops
Executed: 2
Retire slots: 1 (if an indexed addressing mode is used: 2)
Microcode Sequencer (MS): 0
Port usage:
1*p1+1*p2
IACA 2.1
Latency:
7
Throughput
Computed from the port usage: 1.00
IACA:
1.00 (with the -no_interiteration flag: 1.00)
Number of μops:
2
Port usage:
1*p1+1*p2
IACA 2.2
Throughput
Computed from the port usage: 1.00
IACA:
1.00 (with the -no_interiteration flag: 1.00)
Number of μops:
2
Port usage:
1*p1+1*p2
Nehalem
Measurements
Latencies
Latency operand 1 → 1:
3
Latency operand 1 → 3:
4
Latency operand 2 → 1 (address, base register):
7
Latency operand 2 → 1 (address, index register):
7
Latency operand 2 → 1 (memory):
≤7
Latency operand 2 → 3 (address, base register):
7
Latency operand 2 → 3 (address, index register):
7
Latency operand 2 → 3 (memory):
≤7
Throughput
Computed from the port usage: 1.00
Measured (loop):
1.00
Measured (unrolled):
1.00
Number of μops
Executed: 2
Retire slots: 1 (if an indexed addressing mode is used: 2)
Microcode Sequencer (MS): 0
Port usage:
1*p1+1*p2
IACA 2.1
Latency:
7
Throughput
Computed from the port usage: 1.00
IACA:
1.00 (with the -no_interiteration flag: 1.00)
Number of μops:
2
Port usage:
1*p1+1*p2
IACA 2.2
Throughput
Computed from the port usage: 1.00
IACA:
1.00 (with the -no_interiteration flag: 1.00)
Number of μops:
2
Port usage:
1*p1+1*p2
Wolfdale
Measurements
Latencies
Latency operand 1 → 1:
1
Latency operand 1 → 3:
0
Latency operand 2 → 1 (address, base register):
5
Latency operand 2 → 1 (address, index register):
5
Latency operand 2 → 1 (memory):
≤6
Latency operand 2 → 3 (address, base register):
4
Latency operand 2 → 3 (address, index register):
4
Latency operand 2 → 3 (memory):
≤6
Throughput
Computed from the port usage: 1.00
Measured (loop):
1.00
Measured (unrolled):
1.00
Number of μops
Executed: 3
Port usage:
1*p015+1*p1+1*p2
Conroe
Measurements
Latencies
Latency operand 1 → 1:
1
Latency operand 1 → 3:
0
Latency operand 2 → 1 (address, base register):
5
Latency operand 2 → 1 (address, index register):
5
Latency operand 2 → 1 (memory):
≤6
Latency operand 2 → 3 (address, base register):
4
Latency operand 2 → 3 (address, index register):
4
Latency operand 2 → 3 (memory):
≤6
Throughput
Computed from the port usage: 1.00
Measured (loop):
1.00
Measured (unrolled):
1.00
Number of μops
Executed: 3
Port usage:
1*p015+1*p1+1*p2
Tremont
Measurements
Latencies
Latency operand 1 → 1:
3
Latency operand 1 → 3:
3
Latency operand 2 → 1 (address, base register):
6
Latency operand 2 → 1 (address, index register):
6
Latency operand 2 → 1 (memory):
≤7
Latency operand 2 → 3 (address, base register):
6
Latency operand 2 → 3 (address, index register):
6
Latency operand 2 → 3 (memory):
≤7
Throughput
Measured (loop):
1.00
Measured (unrolled):
1.00
Number of μops
Executed: 1
Microcode Sequencer (MS): 0
Goldmont Plus
Measurements
Latencies
Latency operand 1 → 1:
8
Latency operand 1 → 3:
7
Latency operand 2 → 1 (address, base register):
12
Latency operand 2 → 1 (address, index register):
12
Latency operand 2 → 1 (memory):
≤12
Latency operand 2 → 3 (address, base register):
11
Latency operand 2 → 3 (address, index register):
11
Latency operand 2 → 3 (memory):
≤11
Throughput
Measured (loop):
10.00
Measured (unrolled):
10.00
Number of μops
Executed: 11
Microcode Sequencer (MS): 11
Requires the complex decoder
Goldmont
Measurements
Latencies
Latency operand 1 → 1:
8
Latency operand 1 → 3:
7
Latency operand 2 → 1 (address, base register):
12
Latency operand 2 → 1 (address, index register):
12
Latency operand 2 → 1 (memory):
≤15
Latency operand 2 → 3 (address, base register):
11
Latency operand 2 → 3 (address, index register):
11
Latency operand 2 → 3 (memory):
≤13
Throughput
Measured (loop):
10.00
Measured (unrolled):
10.00
Number of μops
Executed: 11
Microcode Sequencer (MS): 11
Requires the complex decoder
Airmont
Measurements
Latencies
Latency operand 1 → 1:
8
Latency operand 1 → 3:
7
Latency operand 2 → 1 (address, base register):
12
Latency operand 2 → 1 (address, index register):
12
Latency operand 2 → 1 (memory):
≤12
Latency operand 2 → 3 (address, base register):
11
Latency operand 2 → 3 (address, index register):
11
Latency operand 2 → 3 (memory):
≤11
Throughput
Measured (loop):
10.00
Measured (unrolled):
10.00
Number of μops
Executed: 10
Microcode Sequencer (MS): 10
Requires the complex decoder
Bonnell
Measurements
Latencies
Latency operand 1 → 1:
16
Latency operand 1 → 3:
17
Latency operand 2 → 1 (address, base register):
20
Latency operand 2 → 1 (address, index register):
20
Latency operand 2 → 1 (memory):
≤17
Latency operand 2 → 3 (address, base register):
20
Latency operand 2 → 3 (address, index register):
20
Latency operand 2 → 3 (memory):
≤17
Throughput
Measured (loop):
16.02
Measured (unrolled):
16.00
Number of μops
Executed: 10
Microcode Sequencer (MS): 10
Requires the complex decoder
AMD Zen 4
Measurements
Latencies
Latency operand 1 → 1:
1
Latency operand 1 → 3:
1
Latency operand 2 → 1 (address, base register):
5
Latency operand 2 → 1 (address, index register):
5
Latency operand 2 → 1 (memory):
≤7
Latency operand 2 → 3 (address, base register):
5
Latency operand 2 → 3 (address, index register):
5
Latency operand 2 → 3 (memory):
≤7
Throughput
Measured (loop):
0.33
Measured (unrolled):
0.33 (if an indexed addressing mode is used: 0.36)
Number of μops
Executed: 1 (if an indexed addressing mode is used: 2)
AMD Zen 3
Measurements
Latencies
Latency operand 1 → 1:
3
Latency operand 1 → 3:
0
Latency operand 2 → 1 (address, base register):
8
Latency operand 2 → 1 (address, index register):
8
Latency operand 2 → 1 (memory):
≤13
Latency operand 2 → 3 (address, base register):
7
Latency operand 2 → 3 (address, index register):
7
Latency operand 2 → 3 (memory):
≤8
Throughput
Measured (loop):
5.00
Measured (unrolled):
5.00
Number of μops
Executed: 8
AMD Zen 2
Measurements
Latencies
Latency operand 1 → 1:
3
Latency operand 1 → 3:
0
Latency operand 2 → 1 (address, base register):
7
Latency operand 2 → 1 (address, index register):
7
Latency operand 2 → 1 (memory):
≤10
Latency operand 2 → 3 (address, base register):
7
Latency operand 2 → 3 (address, index register):
7
Latency operand 2 → 3 (memory):
≤10
Throughput
Measured (loop):
5.00
Measured (unrolled):
5.00
Number of μops
Executed: 8
AMD Zen+
Measurements
Latencies
Latency operand 1 → 1:
3
Latency operand 1 → 3:
0
Latency operand 2 → 1 (address, base register):
7
Latency operand 2 → 1 (address, index register):
7
Latency operand 2 → 1 (memory):
≤9
Latency operand 2 → 3 (address, base register):
7
Latency operand 2 → 3 (address, index register):
7
Latency operand 2 → 3 (memory):
≤9
Throughput
Measured (loop):
5.00
Measured (unrolled):
5.00
Number of μops
Executed: 8