This repository has been archived by the owner on Jun 26, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[codegen] legalize imul.I64 for 32-bit ISAs
Add a legalization that legalizes imul.I64 for 32-bit ISAs. Refs: bnjbvr/cranelift-x86#4
- Loading branch information
Showing
3 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
; Test the legalization of i128 instructions on x86_64. | ||
test legalizer | ||
target x86_64 haswell | ||
|
||
; regex: V=v\d+ | ||
|
||
function %imul(i128, i128) -> i128 { | ||
ebb0(v1: i128, v2: i128): | ||
v10 = imul v1, v2 | ||
; check: v1 = iconcat $(v1_lsb=$V), $(v1_msb=$V) | ||
; nextln: v2 = iconcat $(v2_lsb=$V), $(v2_msb=$V) | ||
; nextln: $(v10_lsb=$V) = imul $v1_lsb, $v2_lsb | ||
; nextln: $(v11=$V) = imul $v1_msb, $v2_lsb | ||
; nextln: $(v12=$V) = imul $v1_lsb, $v2_msb | ||
; nextln: $(v99=$V), $(v13=$V) = x86_umulx $v1_lsb, $v2_lsb | ||
; nextln: $(v14=$V) = iadd $v11, $v12 | ||
; nextln: $(v10_msb=$V) = iadd $v14, $v13 | ||
; nextln: v10 = iconcat $v10_lsb, $v10_msb | ||
return v10 | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters