Commit Graph

2476 Commits

Author SHA1 Message Date
Bogdan Romanyuk ad168db727 Sema: disallow @intFromPtr for comptime-only types 2023-10-17 20:05:55 +00:00
Ali Chraghi 6d8a979265 spirv: memcpy 2023-10-17 13:02:30 +03:30
Ali Chraghi e44152e252 spirv: fieldParentPtr 2023-10-16 20:27:28 -04:00
Robin Voetter 8c153221b9 wasm: disable division test
Seems that bit integers are not properly supported
2023-10-15 20:08:19 +02:00
Robin Voetter faad97edff spirv: update failing / passing tests
Some tests are now failing due to debug info changes, some tests
now pass due to improved compiler functionality.
2023-10-15 20:08:18 +02:00
Ali Chraghi 45a1945dc4 spirv: simple binary and comparison vector operations 2023-10-15 14:00:33 +02:00
Robin Voetter 9c20449cc5 wasm: lower min/max for floats to compiler_rt
The min and max builtins in Zig have some intricate behavior
related to floats, that is not replicated with the min and max
wasm instructions or using simple select operations. By lowering
these instructions to compiler_rt, handling around NaNs is done
correctly.

See also https://github.com/WebAssembly/design/issues/214
2023-10-15 14:00:32 +02:00
Ali Chraghi 2fe16e072a spirv: emit vectors as arrays 2023-10-15 14:00:32 +02:00
Robin Voetter 3ca1f88898 std.testing: disable expectEqualSlices printing for spirv 2023-10-15 14:00:26 +02:00
Robin Voetter b1499df1b8 spirv: sign-extension for strange integers 2023-10-15 14:00:09 +02:00
Robin Voetter 4f279078c8 spirv: air min/max 2023-10-15 14:00:07 +02:00
Robin Voetter f858bf1616 spirv: air bitcast for non-numeric non-pointer types 2023-10-15 14:00:07 +02:00
Robin Voetter 0af16a58a0 spirv: fix air is_null optional slice field type 2023-10-15 14:00:06 +02:00
Robin Voetter d0e7a3596b spirv: allow generation of *i0 2023-10-15 14:00:06 +02:00
Robin Voetter 2d52fc762d spirv: handle zero-sized arrays 2023-10-15 14:00:05 +02:00
Ali Chraghi d8b591766a spirv: fpext and fptrunc instructions 2023-10-15 14:00:04 +02:00
Robin Voetter d2692af8e2 spirv: override function return type to void if it has no runtime bits 2023-10-15 14:00:04 +02:00
Robin Voetter ae3efab226 spirv: generate *void as pointer to opaque 2023-10-15 14:00:03 +02:00
Robin Voetter fe51ff9fc1 spirv: make air is_null not emit OpPtr(Not)Equal 2023-10-15 14:00:03 +02:00
Robin Voetter 15cf1315bb spirv: fix incorrect repr of some optional operations 2023-10-15 14:00:01 +02:00
Robin Voetter 0a3e566f57 spirv: make bitcasts between the same spirv type a no-op 2023-10-15 14:00:01 +02:00
Robin Voetter 4a6a024a4b spirv: properly skip comptime function parameters 2023-10-15 14:00:00 +02:00
Robin Voetter 89b1dafa78 spirv: aggregate_init for structs 2023-10-15 13:59:55 +02:00
Robin Voetter 08ea9a9ff6 spirv: cast result of .elem pointers to right type if needed 2023-10-15 13:59:23 +02:00
Robin Voetter a7c3d5e4ec spirv: constant elem ptr fix 2023-10-15 13:59:22 +02:00
Xavier Bouchoux 78fe3feedb tests: enable already passing behaviour tests for self-hosted wasm
1611 passed; 262 skipped; 0 failed.
(was: 1543 passed; 330 skipped; 0 failed.)
2023-10-14 12:50:39 +02:00
Xavier Bouchoux d5991ee7ca codegen/wasm: fix non-byte-sized signed integer comparison 2023-10-14 10:23:36 +02:00
Xavier Bouchoux 27a19908ed codegen/wasm: fix tuple member offset computation
It didn't account for field alignement.
2023-10-14 10:23:36 +02:00
Andrew Kelley ab4d6bf468 LLVM: work around @floatFromInt bug
see #17381
2023-10-14 00:33:46 -07:00
Andrew Kelley b6762c2473 Sema: fix crash when ref coercion dest is var args
When analyzing the `validate_ref_ty` ZIR instruction, an assertion would
trip if the result type was a var args function argument. The fix is the
same as e6b73be870 - inline the logic of
`resolveType` and handle the case of var args.

Closes #17494
2023-10-13 00:31:22 -07:00
Andrew Kelley e6b73be870 Sema: fix crash when coercion dest is var args
When analyzing the `as` ZIR instruction, an assertion would trip if the
result type was a var args function argument. The fix is simple: inline
a little bit of the `resolveType` logic into `analyzeAs` to make it
detect this situation - which it was already attempting to do.

Closes #16197
2023-10-12 22:03:39 -07:00
Andrew Kelley aaf46187ab Merge pull request #17391 from xxxbxxx/load-i4
codegen/llvm: truncate padding bits when loading a non-byte-sized value
2023-10-09 22:06:49 -07:00
Jacob Young 922b5b5453 x86_64: implement 128-bit integer multiply and divide 2023-10-09 05:23:23 -04:00
Luuk de Gram 54e7f58fcb Merge pull request #17438 from Luukdegram/issue-17436
wasm - fix `@tagName` for signed enums
2023-10-08 21:58:35 +02:00
Luuk de Gram 9402f8b74a add behavior test @tagName with signed values 2023-10-08 15:23:50 +02:00
Xavier Bouchoux 703fe0f121 test: add a pair of cases from bug reports 2023-10-08 11:37:49 +02:00
Xavier Bouchoux 370662c565 codegen/llvm: truncate padding bits when loading a non-byte-sized value 2023-10-08 11:37:49 +02:00
Xavier Bouchoux 85315bb535 codegen/wasm: fix intcast accross 32-bits boundary 2023-10-08 11:37:49 +02:00
Xavier Bouchoux c86ba0f9d0 test: add behaviour test for casting accross 32-bits boundary 2023-10-08 11:36:53 +02:00
Jacob Young b5dedd7c00 x86_64: implement @mulAdd of floats for baseline 2023-10-08 04:41:55 -04:00
Jacob Young 35c9b717f7 x86_64: implement @rem for floats 2023-10-08 04:41:55 -04:00
Jacob Young 3bf9a8feb5 x86_64: fix @divTrunc and @divFloor of f16 2023-10-08 04:41:55 -04:00
Jacob Young 9fc9235ac8 x86_64: fix undersized vector binary operations 2023-10-08 04:41:55 -04:00
Jacob Young b8f00ae337 x86_64: implement @abs for some integer vector types 2023-10-08 04:41:55 -04:00
Jacob Young 24d76500d2 x86_64: fix bitcast from f80 2023-10-08 04:41:55 -04:00
Jacob Young 24c67992e0 x86_64: hack around silent f80 miscompilations
The x87 kind sucks.
2023-10-07 19:47:46 -04:00
Jacob Young b19fd485b1 x86_64: improve inline assembly support
* instruction prefixes
 * mnemonic fixes
 * labels
 * memory operands
 * read-write constraint modifier
 * register and memory alternative constraint
2023-10-07 16:02:01 -04:00
Jacob Young 7436f3efc9 x86_64: implement C var args 2023-10-07 02:10:34 -04:00
Jacob Young 20b4401cde x86_64: implement negation and @abs for f80
Also implement live-outs since the x87 requires so much care around
liveness tracking.
2023-10-07 00:29:17 -04:00
Jacob Young 5aeb13c350 x86_64: implement f80 movement 2023-10-07 00:29:17 -04:00