x64: Lower stack_addr, udiv, sdiv, urem, srem, umulhi, smulhi in ISLE (#4741)
Lower stack_addr, udiv, sdiv, urem, srem, umulhi, and smulhi in ISLE. For udiv, sdiv, urem, and srem I opted to move the original lowering into an extern constructor, as the interactions with rax and rdx for the div instruction didn't seem meaningful to implement in ISLE. However, I'm happy to revisit this choice and move more of the embedding into ISLE.
This commit is contained in:
51
cranelift/filetests/filetests/isa/x64/umulhi.clif
Normal file
51
cranelift/filetests/filetests/isa/x64/umulhi.clif
Normal file
@@ -0,0 +1,51 @@
|
||||
test compile precise-output
|
||||
target x86_64
|
||||
|
||||
function %f1(i16, i16) -> i16 {
|
||||
block0(v0: i16, v1: i16):
|
||||
v2 = umulhi v0, v1
|
||||
return v2
|
||||
}
|
||||
|
||||
; pushq %rbp
|
||||
; movq %rsp, %rbp
|
||||
; block0:
|
||||
; movq %rdi, %rax
|
||||
; mul %ax, %si, %ax, %dx
|
||||
; movq %rdx, %rax
|
||||
; movq %rbp, %rsp
|
||||
; popq %rbp
|
||||
; ret
|
||||
|
||||
function %f2(i32, i32) -> i32 {
|
||||
block0(v0: i32, v1: i32):
|
||||
v2 = umulhi v0, v1
|
||||
return v2
|
||||
}
|
||||
|
||||
; pushq %rbp
|
||||
; movq %rsp, %rbp
|
||||
; block0:
|
||||
; movq %rdi, %rax
|
||||
; mul %eax, %esi, %eax, %edx
|
||||
; movq %rdx, %rax
|
||||
; movq %rbp, %rsp
|
||||
; popq %rbp
|
||||
; ret
|
||||
|
||||
function %f3(i64, i64) -> i64 {
|
||||
block0(v0: i64, v1: i64):
|
||||
v2 = umulhi v0, v1
|
||||
return v2
|
||||
}
|
||||
|
||||
; pushq %rbp
|
||||
; movq %rsp, %rbp
|
||||
; block0:
|
||||
; movq %rdi, %rax
|
||||
; mul %rax, %rsi, %rax, %rdx
|
||||
; movq %rdx, %rax
|
||||
; movq %rbp, %rsp
|
||||
; popq %rbp
|
||||
; ret
|
||||
|
||||
Reference in New Issue
Block a user