Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use past simple when discuss Haswell oddities #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
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
8 changes: 3 additions & 5 deletions x86/x86.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,13 @@ no other word is changed.
`bsf/r` are undefined when its source is 0. In practice, the target register is not modified.

## lzcnt
`lzcnt` (Leading Zero CouNT) is an opcode created in 2007, only supported by AMD in their Barcelona architecture and later (it's planned in Intel Haswell for 2013, along with its counterpart `tzcnt`).
`lzcnt` (Leading Zero CouNT) is an opcode created in 2007, only supported by AMD in their Barcelona architecture. In 2013 added to Intel Haswell, along with its counterpart `tzcnt` (Trailing Zero CouNT).

Recent opcodes would usually trigger an exception when executed on a CPU not supporting them.

However, this one is mapped on `0fbd: bsr` (Bit Scan Reverse) with an `f3` prefix, so it will not trigger any exception on a CPU that doesn't support it:
1. it will just execute `bsr` and ignore the prefix.
1. `bsr` and `lzcnt` work on the same register, and have the same instruction length, so the same target register will be modified, and the next instruction will be the same. Thus, only the target register and flags might be different.
1. `bsr` and `lzcnt` work on the same register, and have the same instruction length, so the same target register will be modified, and the next instruction will be the same. Thus, only the target register and flags might be different. Besides, with a null source, `lzcnt` will return a null value, while `bsr` will leave the target unmodified.

if you execute:

Expand Down Expand Up @@ -376,8 +376,6 @@ f3 <== ignored prefix
```


It makes `lzcnt` an odd exception-less AMD detector (for now): besides, with a null source, `lzcnt` will return a null value, while `bsr` will leave the target unmodified.

## sal
![](pics/x86_sal.gif)

Expand Down Expand Up @@ -605,7 +603,7 @@ prefetch [eax]
![](pics/x86_oldpath.gif)

## future opcodes
Intel Haswell will introduce very useful opcodes (on general registers) such as:
Intel Haswell introduced very useful opcodes (on general registers) such as:
* `andn`:


Expand Down