39 Commits

Author SHA1 Message Date
Afonso Bordado
0035f09c5a Avoid masking shift amounts
Cranelift 0.87 now follows its own documentation regarding
shift amounts, and implicitly masks them if the arch requires it. [0]

[0]: 0508932174
2022-09-26 16:20:11 +00:00
bjorn3
0980596271 Extract codegen_saturating_int_binop function 2022-09-05 16:13:08 +00:00
bjorn3
b1e9d2e1a2 Revert "Avoid masking shift amounts (#1268)"
This reverts commit 156bda8bc708cca60e9de18743d833c8d97dd7ff.

This breaks the mir_overflow_off rustc test:
https://github.com/bjorn3/rustc_codegen_cranelift/runs/7971362755?check_suite_focus=true#step:7:2904
2022-08-23 11:10:44 +00:00
Afonso Bordado
156bda8bc7
Avoid masking shift amounts (#1268)
Cranelift 0.87 now follows its own documentation regarding
shift amounts, and implicitly masks them if the arch requires it. [0]

[0]: 0508932174
2022-08-23 12:42:24 +02:00
bjorn3
3c030e2425 Fix NaN handling of simd float min and max operations 2022-03-25 20:25:11 +01:00
bjorn3
2e62516496 Remove workarounds for things unimplemented in Cranelift
Many are now implemented, so it is much nicer to directly use the
respective Cranelift instructions
2021-07-28 17:30:39 +02:00
bjorn3
6dc386e192 Don't truncate the shift amount
It isn't actually necessary
2021-07-17 14:34:58 +02:00
bjorn3
7f0e35106e Fix overflow checking when multiplying two i64
Fixes #1162
2021-04-16 14:36:07 +02:00
bjorn3
3d85f05dfd Remove no longer necessary intcasts 2021-03-15 14:04:04 +01:00
bjorn3
826189ef51 Some clippy fixes 2021-03-09 12:37:39 +01:00
bjorn3
5e736293b3 Rustfmt 2021-03-05 11:21:44 +01:00
bjorn3
73d3a1c14a Use dynamic dispatch for the inner Module
This improves compilation time and shrinks the linked backend from
13MB to 9.7MB on Linux.
2021-02-23 18:49:37 +01:00
bjorn3
7fc34839ac Revert "Remove shift amount masking"
This reverts commit c5f98b586f9c835e8e3ebecf3db260d2f0ad402a.

It turns out to be necessary anyway
2021-02-21 16:51:40 +01:00
bjorn3
74f39b64c8 Avoid a temporary stackslot in codegen_checked_int_binop 2021-02-21 12:48:43 +01:00
bjorn3
c5f98b586f Remove shift amount masking
Unlike the old x75 backend, the new x64 backend masks the shift amount
itself, matching the specified semantics.
2021-02-21 12:03:02 +01:00
bjorn3
8c7ae41f62 Remove code comment 2021-01-31 14:15:08 +01:00
Muhammad Mominul Huque
d27f2f0932
Rename trans to codegen 2020-11-01 19:24:30 +06:00
bjorn3
0a5968dfd2 Use the new cranelift-module interface
This updates Cranelift to include bytecodealliance/wasmtime#2249
2020-10-08 19:00:21 +02:00
bjorn3
c8699076f9 Document almost all modules
Fixes #1082
2020-09-23 15:13:49 +02:00
bjorn3
217b3818b7 Rustup to rustc 1.48.0-nightly (c59199efc 2020-09-04) 2020-09-05 10:38:49 +02:00
CohenArthur
4e685a512e fmt: Run cargo fmt since it is available 2020-08-28 12:10:48 +02:00
bjorn3
cc0268fa1a Mask shift amount 2020-06-30 18:56:53 +02:00
bjorn3
5f54cc7658 Implement checked_mul
Fixes #6
2020-06-20 15:15:28 +02:00
bjorn3
ef4186a85b Use Cranelift legalization for icmp.i128
The previous translation was wrong for signed 128bit comparisions

This fixes several libcore tests
2020-06-20 13:23:31 +02:00
bjorn3
f288959c00 Limit publicness to crate where possible and remove unused imports 2020-03-27 12:14:45 +01:00
bjorn3
74c7a7b7c5 Replace unimplemented! with unreachable! when it will never be supported 2020-01-25 16:24:48 +01:00
bjorn3
217beab62a Reduce the amount of calls to layout_of 2020-01-15 13:18:54 +01:00
bjorn3
44792f1089 Rustup to rustc 1.40.0-nightly (084beb83e 2019-09-27) 2019-09-28 14:06:12 +02:00
bjorn3
77d33c1707 Fix trans_ptr_binop for fn() 2019-09-15 18:35:56 +02:00
bjorn3
c34ada7cca Fix foreign type handling 2019-09-14 17:53:36 +02:00
bjorn3
8f12b87542 Implement shl and shr overflow checks
cc #6
2019-09-14 12:13:23 +02:00
Atul Bhosale
f481a4b685
Format code using 'cargo fmt' 2019-08-31 22:58:09 +05:30
bjorn3
2a20cc0b94 Use anonymous lifetimes where possible 2019-08-18 16:52:07 +02:00
bjorn3
43e68319fa Rustup to rustc 1.39.0-nightly (2111aed0a 2019-08-17) 2019-08-18 11:30:13 +02:00
bjorn3
7c7a8e8367 Workaround for missing icmp{,_imm}.i128 legalizations
Fixes #667
2019-08-15 11:36:23 +02:00
bjorn3
9505d60a24 Cast rhs to lhs type for shl and shr 2019-08-14 15:18:05 +02:00
bjorn3
b4e55cdedd Refactor num.rs 2019-08-14 15:03:52 +02:00
bjorn3
db071db95a Calculate sign in trans{,_checked}_int_binop instead of caller 2019-08-14 13:01:55 +02:00
bjorn3
883894a07a Move trans_*_binop to num.rs 2019-08-14 11:52:39 +02:00