549 Commits

Author SHA1 Message Date
Antoni Boucher
9149becf6a Fix vector compilation error 2023-11-03 09:05:31 -04:00
Antoni Boucher
c12ac7ea76 Fix warning 2023-10-25 20:42:47 -04:00
Antoni Boucher
42e37059a3 Fix rebase 2023-10-25 20:41:39 -04:00
Antoni Boucher
4d66cd8aa8 Merge branch 'master' into sync_from_rust_2023_10_25 2023-10-25 20:39:08 -04:00
antoyo
8329a356fc
Merge pull request #369 from GuillaumeGomez/regen-intrinsics
Regenerate intrinsics mapping
2023-10-25 18:21:34 -04:00
Antoni Boucher
783789f831 Build the sysroot and run more tests 2023-10-25 11:19:03 -04:00
Guillaume Gomez
c15ad9e7a5 Regenerate intrinsics mapping 2023-10-25 15:53:31 +02:00
Antoni Boucher
a93d1b73c6 Fix volatile_load 2023-10-24 19:53:59 -04:00
Antoni Boucher
7425c560d3 Add comment 2023-10-21 18:48:03 -04:00
Oli Scherer
67b28ac34b s/Generator/Coroutine/ 2023-10-20 21:10:38 +00:00
Andy Sadler
81c1f39a86
optimize u128/i128 popcounts further
Don't fall back on breaking apart the popcount operation if 128-bit
integers are natively supported.

Signed-off-by: Andy Sadler <andrewsadler122@gmail.com>
2023-10-18 22:10:41 -05:00
Antoni Boucher
9d5e0ba1f5 Fixes including fixing compilation for --no-default-features 2023-10-17 20:55:54 -04:00
Antoni Boucher
e5fa9f8692 Use the correct alignment for integer types 2023-10-17 20:55:54 -04:00
antoyo
fabdc1a273
Merge pull request #348 from sadlerap/optimize-popcount
optimize popcount implementation
2023-10-17 20:47:05 -04:00
Andy Sadler
64abf5862f
optimize popcount implementation
In the current implementation, the gcc backend of rustc currently emits the
following for a function that implements popcount for a u32 (x86_64 targeting
AVX2, using standard unix calling convention):

    popcount:
        mov     eax, edi
        and     edi, 1431655765
        shr     eax
        and     eax, 1431655765
        add     edi, eax
        mov     edx, edi
        and     edi, 858993459
        shr     edx, 2
        and     edx, 858993459
        add     edx, edi
        mov     eax, edx
        and     edx, 252645135
        shr     eax, 4
        and     eax, 252645135
        add     eax, edx
        mov     edx, eax
        and     eax, 16711935
        shr     edx, 8
        and     edx, 16711935
        add     edx, eax
        movzx   eax, dx
        shr     edx, 16
        add     eax, edx
        ret

Rather than using this implementation, gcc could be told to use Wenger's
algorithm.  This would give the same function the following implementation:

    popcount:
        xor eax, eax
        xor edx, edx
        popcnt eax, edi
        test edi, edi
        cmove eax, edx
        ret

This patch implements the popcount operation in terms of Wenger's algorithm in
all cases.

Signed-off-by: Andy Sadler <andrewsadler122@gmail.com>
2023-10-17 16:20:55 -05:00
Guillaume Gomez
0348a5f17a Improve code readability 2023-10-17 23:00:23 +02:00
Guillaume Gomez
096f14d374 Add support for NonNull function attribute 2023-10-17 15:03:25 +02:00
Michael Howell
e1cb8187e1 docs: add Rust logo to more compiler crates
c6e6ecb1afea9695a42d0f148ce153536b279eb5 added it to some of the
compiler's crates, but avoided adding it to all of them to reduce
bit-rot. This commit adds to more.
2023-10-16 15:38:08 -07:00
Antoni Boucher
e3998b2d46 Handle unsigned comparison for signed integers 2023-10-13 07:50:42 -04:00
Antoni Boucher
100dfced20 Fix #[inline(always)] attribute 2023-10-11 20:55:32 -04:00
Antoni Boucher
ba103e34c0 Use IntoDynSyncSend 2023-10-09 17:13:35 -04:00
Antoni Boucher
22e6f6caaf Fix checks 2023-10-09 16:03:05 -04:00
Antoni Boucher
242a482c88 Merge commit '11a0cceab966e5ff1058ddbcab5977e8a1d6d290' into subtree-update_cg_gcc_2023-10-09 2023-10-09 15:53:34 -04:00
Antoni Boucher
a7532daa76 Fix unchecked_ssub, unchecked_smul, and unchecked_umul 2023-10-09 13:16:47 -04:00
Antoni Boucher
a00ea0bf98 Fix unchecked_sadd 2023-10-09 13:03:23 -04:00
Antoni Boucher
bd7e5b9d4e Fix bitcast with different sizes 2023-10-09 10:38:37 -04:00
Antoni Boucher
c567e59bad Merge branch 'master' into sync_from_rust_2023_10_08 2023-10-08 11:31:53 -04:00
Antoni Boucher
b3c10d4a7d Fix 128-bit non-native integers negation 2023-10-08 08:49:20 -04:00
Antoni Boucher
b3fecae7d7 Fix 128-bit non-native integers comparison 2023-10-07 15:14:54 -04:00
Erik Desjardins
7e8c85ba31 Reapply: Mark drop calls in landing pads cold instead of noinline
Co-authored-by: Max Fan <git@max.fan>
Co-authored-by: Nikita Popov <npopov@redhat.com>
2023-10-02 10:37:53 +02:00
Oli Scherer
8373b05514 Have a single struct for queries and hook 2023-09-22 16:26:20 +00:00
Oli Scherer
38b9e26a75 Add a way to decouple the implementation and the declaration of a TyCtxt method. 2023-09-22 09:23:15 +00:00
antoyo
e7d1dc33c6
Merge pull request #337 from rust-lang/fix/gep
Fix gep on pointers to non-number
2023-09-20 17:57:04 -04:00
Antoni Boucher
be3b1e3321 Fix gep on pointers to non-number 2023-09-20 09:10:24 -04:00
Antoni Boucher
5ab4e2b484 Implement llvm.x86.rdrand.64 2023-09-18 18:24:09 -04:00
Ralf Jung
cd519aabd7 fix gcc, cranelift build 2023-09-15 10:43:44 +02:00
Ralf Jung
22e13b4c55 clarify PassMode::Indirect as well 2023-09-15 10:43:44 +02:00
Antoni Boucher
f3b82df8f8 Add note to readme 2023-09-14 21:49:14 -04:00
Antoni Boucher
f096c19db5 Handle target-cpu=native 2023-09-14 20:47:14 -04:00
Antoni Boucher
a9a2c687ff Send -march to gcc 2023-09-14 20:42:14 -04:00
Antoni Boucher
87daba2cad Only add feature flags on functions 2023-09-14 20:35:11 -04:00
Antoni Boucher
20d4c39462 Correctly handle target features 2023-09-14 19:55:19 -04:00
Antoni Boucher
f692124c5d Handle disabled features 2023-09-14 19:55:19 -04:00
Antoni Boucher
5bb0d630ab Do not always enable avx2 2023-09-14 19:55:19 -04:00
Antoni Boucher
adc0b210f3 Enable one more feature 2023-09-14 19:55:19 -04:00
Antoni Boucher
f6337e4966 Don't always enabled CPU features 2023-09-14 19:55:19 -04:00
Antoni Boucher
32df82648d Handle static relocation model 2023-09-14 19:02:00 -04:00
Deadbeef
d7766ffa36 treat host effect params as erased generics in codegen
This fixes the changes brought to codegen tests when effect params are
added to libcore, by not attempting to monomorphize functions that get
the host param by being `const fn`.
2023-09-14 07:34:35 +00:00
Antoni Boucher
cd1644a658 Fix const handling in ATT syntax 2023-09-09 12:50:25 -04:00
Daniel Paoliello
8028885239 Deduplicate inlined function debug info, but create a new lexical scope to child subsequent scopes and variables from colliding 2023-09-01 14:27:21 -07:00