Merge branch 'main' of github.com:roc-lang/roc into clippy-1.74

This commit is contained in:
Anton-4 2023-12-25 17:05:37 +01:00
commit cd632fe549
No known key found for this signature in database
GPG key ID: 0971D718C0A9B937
271 changed files with 7741 additions and 7417 deletions

View file

@ -103,7 +103,7 @@ main =
If this file exists somewhere in the repo as `dbg.roc`, we'll be able to compile an object file by issuing the following command:
```console
# `cargo run --` can be replaces with calling the compiled `roc` cli binary.
# `cargo run --` can be replaced with calling the compiled `roc` cli binary.
$ cargo run -- build --dev main.roc --no-link
```
@ -152,7 +152,7 @@ The output lines contain the hexadecimal representation of the x86 opcodes and f
As a note, when dealing with relocations, please make sure to compile with PIC.
- [Online Assembler](https://defuse.ca/online-x86-assembler.htm#disassembly) -
Useful for seeing the actual bytes generated by assembly instructions.
A lot of time it gives on out of multiple options because x86_64 has many ways to do things.
A lot of time it gives one out of multiple options because x86_64 has many ways to do things.
Also, sometimes it doesn't seem to generate things quite as you expect.
- [Alternative Online Assembler](http://shell-storm.org/online/Online-Assembler-and-Disassembler/) -
Like previous but with more architecture options.

View file

@ -1765,6 +1765,21 @@ trait Backend<'a> {
let intrinsic = bitcode::NUM_IS_MULTIPLE_OF[int_width].to_string();
self.build_fn_call(sym, intrinsic, args, arg_layouts, ret_layout);
}
LowLevel::NumCountLeadingZeroBits => {
let int_width = arg_layouts[0].try_int_width().unwrap();
let intrinsic = bitcode::NUM_COUNT_LEADING_ZERO_BITS[int_width].to_string();
self.build_fn_call(sym, intrinsic, args, arg_layouts, ret_layout);
}
LowLevel::NumCountTrailingZeroBits => {
let int_width = arg_layouts[0].try_int_width().unwrap();
let intrinsic = bitcode::NUM_COUNT_TRAILING_ZERO_BITS[int_width].to_string();
self.build_fn_call(sym, intrinsic, args, arg_layouts, ret_layout);
}
LowLevel::NumCountOneBits => {
let int_width = arg_layouts[0].try_int_width().unwrap();
let intrinsic = bitcode::NUM_COUNT_ONE_BITS[int_width].to_string();
self.build_fn_call(sym, intrinsic, args, arg_layouts, ret_layout);
}
LowLevel::ListSublist => {
// list: RocList,
// alignment: u32,