Use andn for band_not when bmi1 is present (#5701)

We can use the andn instruction for the lowering of band_not on x64 when bmi1 is available.
This commit is contained in:
Trevor Elliott
2023-02-03 16:23:18 -08:00
committed by GitHub
parent 0ba1448fa4
commit 6d8f2be9e1
7 changed files with 141 additions and 3 deletions

View File

@@ -1103,12 +1103,17 @@
(sse_and_not ty y x))
(rule 1 (lower (has_type ty (band_not x y)))
(rule 1 (lower (has_type ty @ (use_bmi1 $false) (band_not x y)))
(if (ty_int_ref_scalar_64 ty))
(x64_and ty
x
(x64_not ty y)))
(rule 1 (lower (has_type ty @ (use_bmi1 $true) (band_not x y)))
(if (ty_int_ref_scalar_64 ty))
;; the first argument is the one that gets inverted with andn
(x64_andn ty y x))
;;;; Rules for `bxor_not` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;