Add regspill and regfill instructions.
These are parallels to the existing regmove instruction, but the divert the value to and from a stack slot. Like regmove diversions, this is a temporary diversion that must be local to the EBB.
This commit is contained in:
@@ -700,9 +700,12 @@ allocation pass and beyond.
|
||||
.. autoinst:: fill
|
||||
|
||||
Register values can be temporarily diverted to other registers by the
|
||||
:inst:`regmove` instruction.
|
||||
:inst:`regmove` instruction, and to and from stack slots by :inst:`regspill`
|
||||
and :inst:`regfill`.
|
||||
|
||||
.. autoinst:: regmove
|
||||
.. autoinst:: regspill
|
||||
.. autoinst:: regfill
|
||||
|
||||
Vector operations
|
||||
-----------------
|
||||
|
||||
@@ -166,14 +166,21 @@ ebb0(v1: i32):
|
||||
; Register diversions.
|
||||
; This test file has no ISA, so we can unly use register unit numbers.
|
||||
function %diversion(i32) {
|
||||
ss0 = spill_slot 4
|
||||
|
||||
ebb0(v1: i32):
|
||||
regmove v1, %10 -> %20
|
||||
regmove v1, %20 -> %10
|
||||
regspill v1, %10 -> ss0
|
||||
regfill v1, ss0 -> %10
|
||||
return
|
||||
}
|
||||
; sameln: function %diversion(i32) native {
|
||||
; nextln: ebb0($v1: i32):
|
||||
; nextln: $ss0 = spill_slot 4
|
||||
; check: ebb0($v1: i32):
|
||||
; nextln: regmove $v1, %10 -> %20
|
||||
; nextln: regmove $v1, %20 -> %10
|
||||
; nextln: regspill $v1, %10 -> $ss0
|
||||
; nextln: regfill $v1, $ss0 -> %10
|
||||
; nextln: return
|
||||
; nextln: }
|
||||
|
||||
Reference in New Issue
Block a user