isle: Migrate f32const/f64const to ISLE (#3537)
This moves the `f32const` and `f64const` instructions from `lower.rs` to
ISLE. I was originally going to add something else but due to the
`isle.rs`'s manual use of `constructor_imm(..)` it necessitated filling
out the `imm` cases for f32/f64 constants, so I figured I'd go ahead and
move these instructions as well.
The special case for 0 constants which use `xorp{s,d}` is preserved from
`lower.rs` today, but a special case isn't added for the all-ones
constant. The comment says to use `cmpeqp{s,d}` but as discovered on
other recent PRs that's not quite sufficient because comparing a
register against itself which happens to be NaN wouldn't work, so
something else will be required (perhaps `pcmpeq` or similar? I figured
I'd defer to later)
This commit is contained in:
@@ -119,6 +119,9 @@
|
||||
(extern const $I64 Type)
|
||||
(extern const $I128 Type)
|
||||
|
||||
(extern const $F32 Type)
|
||||
(extern const $F64 Type)
|
||||
|
||||
(extern const $B8X16 Type)
|
||||
(extern const $B16X8 Type)
|
||||
(extern const $B32X4 Type)
|
||||
@@ -164,6 +167,14 @@
|
||||
(decl u64_from_imm64 (u64) Imm64)
|
||||
(extern extractor infallible u64_from_imm64 u64_from_imm64)
|
||||
|
||||
;; Extract a `u64` from an `Ieee32`.
|
||||
(decl u64_from_ieee32 (u64) Ieee32)
|
||||
(extern extractor infallible u64_from_ieee32 u64_from_ieee32)
|
||||
|
||||
;; Extract a `u64` from an `Ieee64`.
|
||||
(decl u64_from_ieee64 (u64) Ieee64)
|
||||
(extern extractor infallible u64_from_ieee64 u64_from_ieee64)
|
||||
|
||||
;; Extract the result values for the given instruction.
|
||||
(decl inst_results (ValueSlice) Inst)
|
||||
(extern extractor infallible inst_results inst_results)
|
||||
|
||||
Reference in New Issue
Block a user