From 792743dff3b4af6df030a53e447b28a8a3e8b072 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 3 Nov 2024 15:27:44 -0500 Subject: Add Int64:unsigned_left_shift() and :unsigned_right_shift() --- stdlib/integers.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'stdlib/integers.h') diff --git a/stdlib/integers.h b/stdlib/integers.h index 2293e065..ea286202 100644 --- a/stdlib/integers.h +++ b/stdlib/integers.h @@ -66,6 +66,12 @@ } \ MACROLIKE PUREFUNC c_type type_name ## $wrapping_minus(c_type x, c_type y) { \ return (c_type)((u##c_type)x + (u##c_type)y); \ + } \ + MACROLIKE PUREFUNC c_type type_name ## $unsigned_left_shift(c_type x, c_type y) { \ + return (c_type)((u##c_type)x << y); \ + } \ + MACROLIKE PUREFUNC c_type type_name ## $unsigned_right_shift(c_type x, c_type y) { \ + return (c_type)((u##c_type)x >> y); \ } DEFINE_INT_TYPE(int64_t, Int64, __attribute__(())) -- cgit v1.2.3