Implemented b{and,or,xor}_not bitops for ty_int_ref_scalar_64 type. (#5604)

* Implemented `b{and,or,xor}_not` bitops for ty_int_ref_scalar_64 type.

* Added tests.
This commit is contained in:
Jun Ryung Ju
2023-02-02 14:57:18 +09:00
committed by GitHub
parent ac4d28f4dd
commit 9cd4146939
2 changed files with 56 additions and 1 deletions

View File

@@ -1099,9 +1099,33 @@
;; while x86 does
;;
;; pandn(x, y) = and(not(x), y)
(rule (lower (has_type ty (band_not x y)))
(rule 0 (lower (has_type ty (band_not x y)))
(sse_and_not ty y x))
(rule 1 (lower (has_type ty (band_not x y)))
(if (ty_int_ref_scalar_64 ty))
(x64_and ty
x
(x64_not ty y)))
;;;; Rules for `bxor_not` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(rule 0 (lower (has_type ty (bxor_not x y)))
(if (ty_int_ref_scalar_64 ty))
(x64_xor ty
x
(x64_not ty y)))
;;;; Rules for `bor_not` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(rule 0 (lower (has_type ty (bor_not x y)))
(if (ty_int_ref_scalar_64 ty))
(x64_or ty
x
(x64_not ty y)))
;;;; Rules for `iabs` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(rule (lower (has_type $I8X16 (iabs x)))