x64: Add native lowering for scalar fma (#4539)

Use `vfmadd213{ss,sd}` for these lowerings.
This commit is contained in:
Afonso Bordado
2022-08-11 23:48:16 +01:00
committed by GitHub
parent 755cd4311e
commit 3ea1813173
10 changed files with 124 additions and 6 deletions

View File

@@ -1095,7 +1095,9 @@
(extern extractor cc_nz_or_z cc_nz_or_z)
(type AvxOpcode extern
(enum Vfmadd213ps
(enum Vfmadd213ss
Vfmadd213sd
Vfmadd213ps
Vfmadd213pd))
(type Avx512Opcode extern
@@ -1389,6 +1391,9 @@
(decl use_popcnt () Type)
(extern extractor use_popcnt use_popcnt)
(decl use_fma () Type)
(extern extractor use_fma use_fma)
;;;; Helpers for Merging and Sinking Immediates/Loads ;;;;;;;;;;;;;;;;;;;;;;;;;
;; Extract a constant `Imm8Reg.Imm8` from a value operand.
@@ -2935,6 +2940,16 @@
dst))))
dst))
;; Helper for creating `vfmadd213ss` instructions.
(decl x64_vfmadd213ss (Xmm Xmm XmmMem) Xmm)
(rule (x64_vfmadd213ss x y z)
(xmm_rmr_vex (AvxOpcode.Vfmadd213ss) x y z))
;; Helper for creating `vfmadd213sd` instructions.
(decl x64_vfmadd213sd (Xmm Xmm XmmMem) Xmm)
(rule (x64_vfmadd213sd x y z)
(xmm_rmr_vex (AvxOpcode.Vfmadd213sd) x y z))
;; Helper for creating `vfmadd213ps` instructions.
(decl x64_vfmadd213ps (Xmm Xmm XmmMem) Xmm)
(rule (x64_vfmadd213ps x y z)