Skip to content

Commit

Permalink
dialect: (csl) Add signedness cast and concat struct ops (#2714)
Browse files Browse the repository at this point in the history
This adds a signedness cast op (to cast from signless to signed types),
and the `concat_struct` builtin.

I also re-formatted the filechecks for the ops to be pretty and test
both generic and custom syntax.

Relevant for #2703
  • Loading branch information
AntonLydike authored Jun 13, 2024
1 parent c872084 commit 29b011b
Show file tree
Hide file tree
Showing 4 changed files with 547 additions and 250 deletions.
3 changes: 3 additions & 0 deletions tests/filecheck/backend/csl/print_csl.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
%const27 = arith.constant 27 : i16
%ssa_struct = "csl.const_struct"(%const27) <{ssa_fields = ["val"]}> : (i16) -> !csl.comptime_struct

%concat = "csl.concat_structs"(%empty_struct, %attribute_struct) : (!csl.comptime_struct, !csl.comptime_struct) -> !csl.comptime_struct

%no_param_import = "csl.import_module"() <{module = "<mod>"}> : () -> !csl.imported_module
%param_import = "csl.import_module"(%ssa_struct) <{module = "<mod>"}> : (!csl.comptime_struct) -> !csl.imported_module

Expand Down Expand Up @@ -364,6 +366,7 @@ csl.func @builtins() {
// CHECK-NEXT: const ssa_struct : comptime_struct = .{
// CHECK-NEXT: .val = const27,
// CHECK-NEXT: };
// CHECK-NEXT: const concat : comptime_struct = @concat_structs(empty_struct, attribute_struct);
// CHECK-NEXT: const no_param_import : imported_module = @import_module("<mod>");
// CHECK-NEXT: const param_import : imported_module = @import_module("<mod>", ssa_struct);
// CHECK-NEXT: param_import.foo();
Expand Down
Loading

0 comments on commit 29b011b

Please sign in to comment.