Commit Graph

8840 Commits (a17eb15e115dd104f4b0bf2b1db04c06432da324)

Author SHA1 Message Date
George Roman a17eb15e11 Add missing state to C object cache 2020-04-27 12:21:48 -04:00
Andrew Kelley c22b54c9d8 stage2 zir: remove dead code
this was part of the live coding stream and I forgot to delete it before
committing
2020-04-26 17:37:04 -04:00
Henry Nelson 83b0f9c6f7 Fix unfortunate typo 2020-04-26 17:33:04 -04:00
Andrew Kelley 6aeceec1f2 add CLI option -Bsymbolic for binding global references locally 2020-04-26 15:30:52 -04:00
Nick Appleton 28c31a8429
Fix f64 variants of math.cosh and math.sinh to accept negative inputs. (#5172)
* add tests for negative inputs to cosh32 and cosh64. fix bug in cosh64 for negative inputs.

* fix problem with negative input with f64 sinh and add tests
2020-04-26 14:03:19 -04:00
Andrew Kelley d44c9bdbd9 ir: elemptr and add instructions 2020-04-26 01:20:58 -04:00
Andrius Mitkus 6481b02fdc std: fix posix Thread.spawn to accept all startFn types 2020-04-25 16:15:25 -04:00
George Roman 0c037a8561 Pass each target feature flag separately 2020-04-25 15:54:02 -04:00
LemonBoy a7a8c433d0 stage1: Prevent the creation of illegal ptr types
Closes #5140
2020-04-24 15:55:32 -04:00
Andrew Kelley 7634e67ba5
Merge pull request #5158 from ziglang/zir-to-elf
beginnings of (non-LLVM) self-hosted machine code generation and linking
2020-04-24 15:37:21 -04:00
Andrew Kelley 9ebf25d145 link: change default executable mode to 0o777
Jonathan S writes:

On common systems with a 022 umask, this will still result in a
file created with 755 permissions, but it works appropriately if the
system is configured more leniently. (As another data point, C's fopen
seems to open files with the 666 mode.)
2020-04-24 15:36:08 -04:00
Timon Kruiper c829f2f7b7 Add mips support to standard library 2020-04-24 15:28:55 -04:00
Andrew Kelley 058937e44d bug fixes to make it work 2020-04-24 02:09:30 -04:00
Andrew Kelley 229e99ca37 codegen: write the updated code size to PT_LOAD section header 2020-04-23 23:53:52 -04:00
Andrew Kelley 2d35f71fa9 codegen rdx set immediate 2020-04-23 20:30:20 -04:00
Andrew Kelley 757d13d784 codegen supports embedded-in-code constants
also coerce no longer requires a bitcast
2020-04-23 20:23:16 -04:00
Andrew Kelley 0ac502f372 codegen for setting rax and rdi registers 2020-04-23 19:40:17 -04:00
Andrew Kelley 63b54bcf51 codegen for inline assembly 2020-04-23 18:58:47 -04:00
Andrew Kelley 99ec614b71 codegen for const ints and string literals 2020-04-23 17:46:01 -04:00
Andrew Kelley 24a01eed90 basics of writing ELF and machine code generation 2020-04-23 16:41:20 -04:00
xackus a9eb4a6740 stage1: fix crash on accessing an array of size zero with runtime index 2020-04-23 12:45:32 -04:00
LemonBoy e6428f9401
stage1: Fix bitcast of immediate to ptr type (#5131)
Consider a (legal according to the `@bitCast` rules) conversion from u16
to [2]u8: since the former is a scalar and the latter is a pointer
(arrays are represented at pointers in the codegen phase) we have to
allocate a temporary slot on the stack and then bitcast the resulting
pointer to the desired destination type.

Beware that this means the lifetime of the resulting value is the same
of the function it's contained in and for all intents and purposes
should be regarded as a local (eg. it should not escape).

Closes #4395
Closes #5121
2020-04-23 12:44:16 -04:00
Andrew Kelley a3dfe36ca1 zir-to-elf skeleton 2020-04-22 23:42:58 -04:00
Michael Dusan 58d5c37409
Merge pull request #5139 from mikdusan/qemu-5.0.0-rc4
Qemu 5.0.0 rc4
2020-04-22 20:41:16 -04:00
Michael Dusan 79809a0e54
ci: bump static-qemu 5.0.0-rc3 → 5.0.0-rc4 2020-04-22 18:02:50 -04:00
Michael Dusan 9a06f966cd
Merge pull request #5125 from mikdusan/kern.osproductversion
macos: add fallback version detection
2020-04-22 15:57:29 -04:00
Andrew Kelley e8545db9d4
Merge pull request #5130 from ziglang/stage2-ir
beginnings of non-LLVM self-hosted backend
2020-04-22 14:42:46 -04:00
LemonBoy b5e72c0148 stage1: Prevent the creation of illegal pointer types
Changing the pointer length from Unknown to Single/C now resets the
sentinel value too.

Closes #5134
2020-04-22 14:40:57 -04:00
Andrew Kelley 173a143dd0
Merge pull request #5133 from LemonBoy/win-progress
Progressbar for Windows
2020-04-22 12:52:48 -04:00
LemonBoy 0a2519fafb stage2: Allow \t in string literals
Lift the ban on literal tab chars in string literals as they have
nothing to do with code formatting.
2020-04-22 12:48:45 -04:00
LemonBoy 155e631aa6 std: Implement progress for Windows
Use the Win32 API instead of using the VT escape sequences.
2020-04-22 12:58:02 +02:00
LemonBoy 395b530387 stage1: Another hack for the C ABI compatibility
Applying the wrong ABI is slightly better than using the Zig ABI, the
whole thing is so wrong it should be burned to the ground.
2020-04-22 12:52:24 +02:00
Andrew Kelley 1eda2ada9a std.math.big.Int: don't rely on the allocator when printing 2020-04-22 03:49:50 -04:00
Andrew Kelley d58233b361 ir: improve ZIR emission enough to emit hello world 2020-04-22 03:08:50 -04:00
Andrew Kelley b1a86040dd ir: emit zir for fntype 2020-04-22 00:26:37 -04:00
Andrew Kelley 993e654554 emit zir skeleton 2020-04-22 00:04:52 -04:00
Andrew Kelley 2e6ccec100 ir: analyze asm instruction 2020-04-21 22:19:32 -04:00
Andrew Kelley 8d3e4147d5 ir: analyze deref instruction 2020-04-21 21:33:55 -04:00
Andrew Kelley 2c11acf807 ir: analyze fieldptr instruction 2020-04-21 21:14:56 -04:00
Andrew Kelley c12bc8652e ir: analyze ptrtoint 2020-04-21 20:34:40 -04:00
Andrew Kelley 2cdbb5f472 ir: analyze int casting 2020-04-21 19:48:59 -04:00
Michael Dusan 3df0a3a528
macos: add fallback version detection
Fallback to sysctl `kern.osversion` when `kern.osproductversion` is not
available (prior to 10.13.4) .

The mapping from `sw_vers -buildVersion` to `-productVersion` is
formulaic from 10.8 to 10.15 and older is handled with switch.

closes #5119
2020-04-21 18:37:03 -04:00
elucent 48dc3b6fe9 Added peer type resolution for [*]T and *[N]T. 2020-04-21 18:09:03 -04:00
Michael Dusan 412aac8a70 cleanup: IrBasicBlockGen
remove unused param from `ir_ref_inst_gen`
2020-04-21 18:07:48 -04:00
Michael Dusan 73677e178d cleanup: IrBasicBlockGen
remove unused members { parent, index, ref_count }
2020-04-21 18:07:48 -04:00
Haze Booth 78e2a203e3 Remove std.lazyInit 2020-04-21 18:04:37 -04:00
Andrew Kelley 0746028a2a ir: analyze int instruction 2020-04-21 17:54:00 -04:00
Andrew Kelley 69878207e7 ir: analyze `as` instruction 2020-04-21 17:33:41 -04:00
Andrew Kelley 25679b63eb ir: analyze primitive instruction 2020-04-21 17:11:42 -04:00
Andrew Kelley 8671e8d6d4 ir: analyze fntype instruction 2020-04-21 17:06:09 -04:00