aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
AgeCommit message (Collapse)Author
2017-08-30successfully cross-building behavior tests for windowsAndrew Kelley
2017-08-30codegen: all stores specify align valueAndrew Kelley
See #37
2017-08-30set alignment on all loads and globalsAndrew Kelley
See #37
2017-08-29more alignment improvementsAndrew Kelley
* add alignment capability for fn protos * add @alignCast * fix some ast rendering code * fix some ir rendering code * add error for pointer cast increasing alignment * update allocators in std to correctly align See #37
2017-08-29pass all tests without triggering assertionsAndrew Kelley
fixes tests when targeting darwin
2017-08-29introduce align keywordAndrew Kelley
* remove `@setGlobalAlign` * add align keyword for setting alignment on functions and variables. * loads and stores use alignment from pointer * memcpy, memset use alignment from pointer * add syntax for pointer alignment * slices can have volatile * add u2, i2 primitives * ignore preferred align and use abi align everywhere * back to only having alignOf builtin. preferredAlignOf is too tricky to be useful. See #432. Partial revert of e726925e802eddab53cbfd9aacbc5eefe95c356f. See #37
2017-08-28Merge branch 'embed-lld'Andrew Kelley
Zig now depends on LLVM 5.0.0. For the latest version that supports LLVM 4.0.1, use 2a49c876be76dc98996a3251310728ad32b22363. Unfortunately we had to embed LLD into Zig due to some MACH-O related LLD bugs. One of them is already upstream and another is awaiting feedback on the llvm-dev mailing list. You can use cmake option -DZIG_FORCE_EXTERNAL_LLD=ON to still use external LLD if you want to live with the MACH-O bugs or if your system LLD is patched. Closes #273
2017-08-28remove remnants of depending on darwin system linkerAndrew Kelley
2017-08-27macos updatesAndrew Kelley
* try some macos travis stuff * put c in the link libs for macos since we always link with libSystem * for non-native targets on macos, allow runtime symbol resolution - it's causing an infinite loop in LLD. * for macos, always build compiler_rt and turn on LinkOnce because compiler_rt on darwin is missing some stuff.
2017-08-26audit alignment for functionsAndrew Kelley
see #37
2017-08-26codegen for enums chooses best order of tag and union fieldsAndrew Kelley
closes #396
2017-08-26use most_aligned_member+padding to represent enum unionsscurest
2017-08-26remove @alignOf and add @cAbiAlignOf and @preferredAlignOfAndrew Kelley
See #396
2017-08-26fix invalid llvm IR for const enumAndrew Kelley
closes #394
2017-08-25float division by zero check only when FloatMode.OptimzedAndrew Kelley
closes #395
2017-08-25refactor - codegen llvm functions lazilyAndrew Kelley
2017-08-25unreachable still codegens to unreachable in ReleaseFast test modeAndrew Kelley
closes #430
2017-08-22fix compiler test errorsAndrew Kelley
closes #428 Thanks Marc Tiehuis for diagnosing this bug
2017-08-20compile-time f32, f64 operations are now correctly lossyAndrew Kelley
previously we used the bigfloat abstraction to do all compile-time float math. but runtime code and comptime code are supposed to get the same result. so now if you add a f32 to a f32 at compile time it does it with f32 math instead of the bigfloat. float literals still get the bigfloat math. closes #424
2017-08-19add setEvalBranchQuota builtin functionAndrew Kelley
2017-08-19bit shifting safetyAndrew Kelley
* add u3, u4, u5, u6, u7 and i3, i4, i5, i6, i7 * shift operations shift amount parameter type is integer with log2 bit width of other param - This enforces not violating undefined behavior on shift amount >= bit width with the type system * clean up math.log, math.ln, math.log2, math.log10 closes #403
2017-08-17fix big integer shifting by large numberAndrew Kelley
2017-08-17fix wrong value for clz, ctz at compile timeAndrew Kelley
closes #418 also make clz, ctz return smaller integer bit widths and use smaller integer bit widths for enum tag types
2017-08-16compiler_rt implementations for __fixuns* functionsAndrew Kelley
* add u128 and i128 integer types * add f128 floating point type * implement big integer multiplication (See #405)
2017-08-09more intuitive left shift and right shift operatorsAndrew Kelley
Before: * << is left shift, not allowed to shift 1 bits out * <<% is left shift, allowed to shift 1 bits out * >> is right shift, allowed to shift 1 bits out After: * << is left shift, allowed to shift 1 bits out * >> is right shift, allowed to shift 1 bits out * @shlExact is left shift, not allowed to shift 1 bits out * @shrExact is right shift, not allowed to shift 1 bits out Closes #413
2017-08-08add ptrToInt builtin, remove usize(ptr) castAndrew Kelley
closes #415
2017-08-06limit generated C preprocessor tokens to alphabetAndrew Kelley
closes #407 The mangling strategy replaces bytes outside the alphabet with "_xx_" where xx is the hex code of the byte.
2017-08-06fix constant debug info when number literal is 0Andrew Kelley
2017-07-08better bigint/bigfloat implementationAndrew Kelley
2017-06-19workaround for llvm bugAndrew Kelley
See #393 for details
2017-06-14fix compiler segfault on `null ?? x`Andrew Kelley
closes #390
2017-06-14partial implementation of printing floating point numbers with errol3Andrew Kelley
also add bitCast builtin function. closes #387
2017-06-14progress toward windows hello world workingAndrew Kelley
2017-05-27const global values can reference each otherAndrew Kelley
Before, if you did something like: ``` const hi1 = "hi"; const hi2 = hi1; ``` This would create the "hi" data twice in the built object. But since the value is const we don't have to duplicate the data, now we take advantage of this fact. closes #336
2017-05-23building with mingw for windowsAndrew Kelley
2017-05-20flip the enum order of FloatModeAndrew Kelley
2017-05-20add setFloatMode builtin and std.math.floorAndrew Kelley
* skip installing std/rand_test.zig as it's not needed beyond running the std lib tests * add std.math.floor function * add setFloatMode builtin function to choose between builtin.FloatMode.Optimized (default) and builtin.FloatMode.Strict (Optimized is equivalent to -ffast-math in gcc)
2017-05-17typeId builtin instead of isInteger, isFloat, etcAndrew Kelley
closes #373
2017-05-09inline function call with builtin function instead...Andrew Kelley
...of special syntax. partially reverts 41144a8566a6fbd779403f6b69424bb640c94a7f closes #306
2017-05-07delete @generatedCode builtin functionAndrew Kelley
good riddance
2017-05-07rename c_long_double to c_longdoubleAndrew Kelley
to be consistent with other c primitive type names
2017-05-06builtin functions for division and remainder divisionAndrew Kelley
* add `@divTrunc` and `@divFloor` functions * add `@rem` and `@mod` functions * add compile error for `/` and `%` with signed integers * add `.bit_count` for float primitive types closes #217
2017-05-04add compile error when unable to inline a functionAndrew Kelley
See #38
2017-05-02add safe release build modeAndrew Kelley
closes #288
2017-05-01make debug safety stuff lazyAndrew Kelley
2017-05-01`@import("builtin")` instead of `@compileVar`Andrew Kelley
See #226 Closes #220
2017-04-30zig build: organize build artifactsAndrew Kelley
closes #328
2017-04-30back to AT&T syntax for assemblyAndrew Kelley
this reverts 5c04730534ea7933855429c5fc5dc7b22eba7bc2. sadly the quality of the intel dialect in llvm's assembly parser has many frustrating bugs, and generally has unfortunate syntax. the plan is to use AT&T for now since it at least works, and eventually zig will have its own assembly parser for x86 and it will be as close to NASM as possible.
2017-04-28zig puts temporary object files in zig-cache folderAndrew Kelley
See #298
2017-04-27add no-elim-base-pointer to __zig_fail functionAndrew Kelley
fixes missing frame for unwrapping an error closes #345