diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-03-14 00:10:35 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-03-14 00:11:46 -0700 |
| commit | b2a1b4c085b93d508c51307f40444252b8cd4d52 (patch) | |
| tree | 307c504b85c9aee16602e667db1a5db5c25e1fff /src/value.zig | |
| parent | eee989d2a00f99d95900515b48f981f2ea6bbe78 (diff) | |
| download | zig-b2a1b4c085b93d508c51307f40444252b8cd4d52.tar.gz zig-b2a1b4c085b93d508c51307f40444252b8cd4d52.zip | |
Sema: improve lowering of stores to bitcasted vector pointers
Detect if we are storing an array operand to a bitcasted vector pointer.
If so, we instead reach through the bitcasted pointer to the vector pointer,
bitcast the array operand to a vector, and then lower this as a store of
a vector value to a vector pointer. This generally results in better code,
as well as working around an LLVM bug.
See #11154
Diffstat (limited to 'src/value.zig')
| -rw-r--r-- | src/value.zig | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/value.zig b/src/value.zig index 9117ef78df..6ab3adba36 100644 --- a/src/value.zig +++ b/src/value.zig @@ -3931,15 +3931,12 @@ pub const Value = extern union { }, 80 => { if (true) { - @panic("TODO implement compiler_rt fabs for f80"); + @panic("TODO implement compiler_rt fabs for f80 (__fabsx)"); } const f = val.toFloat(f80); return Value.Tag.float_80.create(arena, @fabs(f)); }, 128 => { - if (true) { - @panic("TODO implement compiler_rt fabs for f128"); - } const f = val.toFloat(f128); return Value.Tag.float_128.create(arena, @fabs(f)); }, @@ -3963,15 +3960,12 @@ pub const Value = extern union { }, 80 => { if (true) { - @panic("TODO implement compiler_rt floor for f80"); + @panic("TODO implement compiler_rt floor for f80 (__floorx)"); } const f = val.toFloat(f80); return Value.Tag.float_80.create(arena, @floor(f)); }, 128 => { - if (true) { - @panic("TODO implement compiler_rt floor for f128"); - } const f = val.toFloat(f128); return Value.Tag.float_128.create(arena, @floor(f)); }, @@ -4001,9 +3995,6 @@ pub const Value = extern union { return Value.Tag.float_80.create(arena, @ceil(f)); }, 128 => { - if (true) { - @panic("TODO implement compiler_rt ceil for f128"); - } const f = val.toFloat(f128); return Value.Tag.float_128.create(arena, @ceil(f)); }, @@ -4033,9 +4024,6 @@ pub const Value = extern union { return Value.Tag.float_80.create(arena, @round(f)); }, 128 => { - if (true) { - @panic("TODO implement compiler_rt round for f128"); - } const f = val.toFloat(f128); return Value.Tag.float_128.create(arena, @round(f)); }, @@ -4065,9 +4053,6 @@ pub const Value = extern union { return Value.Tag.float_80.create(arena, @trunc(f)); }, 128 => { - if (true) { - @panic("TODO implement compiler_rt trunc for f128"); - } const f = val.toFloat(f128); return Value.Tag.float_128.create(arena, @trunc(f)); }, |
