-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add funcOp for ARM, similar to that already in RISCV. --------- Co-authored-by: Alex Rice <alexrice999@hotmail.co.uk>
- Loading branch information
Showing
4 changed files
with
153 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from xdsl.dialects import arm, arm_func | ||
from xdsl.ir import Region | ||
from xdsl.traits import CallableOpInterface | ||
|
||
|
||
def test_callable_interface(): | ||
a0, a1 = arm.register.X0, arm.register.X1 | ||
|
||
region = Region() | ||
func = arm_func.FuncOp("callable", region, ((a0, a1), (a0, a1))) | ||
|
||
trait = func.get_trait(CallableOpInterface) | ||
|
||
assert trait is not None | ||
|
||
assert trait.get_callable_region(func) is region | ||
assert trait.get_argument_types(func) == (a0, a1) | ||
assert func.assembly_line() is None |
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,16 @@ | ||
// RUN: XDSL_ROUNDTRIP | ||
// RUN: XDSL_GENERIC_ROUNDTRIP | ||
// RUN: xdsl-opt -t arm-asm %s | filecheck %s --check-prefix=CHECK-ASM | ||
|
||
// CHECK: arm_func.func @noarg_void() { | ||
// CHECK-NEXT: arm_func.return {"comment" = "this is a return instruction"} | ||
// CHECK-NEXT: } | ||
// CHECK-ASM: noarg_void: | ||
// CHECK-ASM: ret # this is a return instruction | ||
arm_func.func @noarg_void() { | ||
arm_func.return {"comment" = "this is a return instruction"} | ||
} | ||
|
||
// CHECK-GENERIC: "arm_func.func"() ({ | ||
// CHECK-GENERIC-NEXT: "arm_func.return"() {"comment" = "this is a return instruction"} : () -> () | ||
// CHECK-GENERIC-NEXT: }) {"sym_name" = "noarg_void", "function_type" = () -> ()} : () -> () |
This file was deleted.
Oops, something went wrong.
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