Skip to content

Commit

Permalink
Revert "Use [su]extend_maybe in the iconst_[su] extractors (bytec…
Browse files Browse the repository at this point in the history
…odealliance#8686)"

This reverts commit 66f499f.
  • Loading branch information
alexcrichton committed May 29, 2024
1 parent e852bce commit f69e0ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
4 changes: 2 additions & 2 deletions cranelift/codegen/src/prelude_opt.isle
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
;; When constructing, the rule will fail if the value cannot be represented in
;; the target type. If it fits, it'll be masked accordingly in the constant.
(decl iconst_s (Type i64) Value)
(extractor (iconst_s ty c) (sextend_maybe ty (inst_data_tupled (iconst_sextend_etor _inner_ty c))))
(extractor (iconst_s ty c) (inst_data_tupled (iconst_sextend_etor ty c)))
(rule 0 (iconst_s ty c)
(if-let c_masked (u64_and (i64_as_u64 c) (ty_umax ty)))
(if-let c_reextended (i64_sextend_u64 ty c_masked))
Expand All @@ -89,7 +89,7 @@
;; When constructing, the rule will fail if the value cannot be represented in
;; the target type.
(decl iconst_u (Type u64) Value)
(extractor (iconst_u ty c) (uextend_maybe ty (iconst _inner_ty (u64_from_imm64 c))))
(extractor (iconst_u ty c) (iconst ty (u64_from_imm64 c)))
(rule 0 (iconst_u ty c)
(if-let $true (u64_le c (ty_umax ty)))
(iconst ty (imm64 c)))
Expand Down
20 changes: 0 additions & 20 deletions cranelift/filetests/filetests/egraph/i128-opts.clif
Original file line number Diff line number Diff line change
Expand Up @@ -135,23 +135,3 @@ block0:
; check: v4 = iadd v1, v3
; check: return v4
}

function %mul_2u_i128(i128) -> i128 {
block0(v0: i128):
v1 = iconst.i16 2
v2 = uextend.i128 v1
v3 = imul v0, v2
return v3
; check: v4 = iadd v0, v0
; check: return v4
}

function %mul_neg1_i128(i128) -> i128 {
block0(v0: i128):
v1 = iconst.i16 -1
v2 = sextend.i128 v1
v3 = imul v0, v2
return v3
; check: v4 = ineg v0
; check: return v4
}

0 comments on commit f69e0ab

Please sign in to comment.