mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-25 15:00:13 +01:00
Use separate builtins for signed / unsigned arithmetic. (#3892)
Per offline discussion with chandlerc and jonmeow, use different builtins for signed versus unsigned integer ops instead of looking at the type. In this commit, the arithmetic builtins (add, sub, negate, mul, div, mod) are split. I'll apply the same change to comparisons and to right shift in separate PRs.
This commit is contained in:
+2
-2
@@ -7,7 +7,7 @@
|
||||
// --- int_greater_eq.carbon
|
||||
|
||||
fn GreaterEq(a: i32, b: i32) -> bool = "int.greater_eq";
|
||||
fn Negate(a: i32) -> i32 = "int.negate";
|
||||
fn Negate(a: i32) -> i32 = "int.snegate";
|
||||
|
||||
class True {}
|
||||
class False {}
|
||||
@@ -94,7 +94,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @GreaterEq(%a: i32, %b: i32) -> bool = "int.greater_eq";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Negate(%a: i32) -> i32 = "int.negate";
|
||||
// CHECK:STDOUT: fn @Negate(%a: i32) -> i32 = "int.snegate";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F(%true_: True, %false_: False) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
|
||||
Reference in New Issue
Block a user