Commit Graph

31 Commits

Author SHA1 Message Date
LemonBoy
2f3b461703 compiler-rt: Add __modsi3, __umodsi3 2019-05-03 17:12:33 -04:00
LemonBoy
1be4e87f0b compiler-rt: Add __moddi3, __divdi3 2019-05-03 17:12:33 -04:00
LemonBoy
b1a61a6d51 compiler-rt: Add __mulodi4 2019-04-29 18:55:20 -04:00
LemonBoy
4e241263ff compiler-rt: Add __divmodsi4, __aeabi_idivmod 2019-04-29 19:17:48 +02:00
LemonBoy
738562e990 compiler-rt: Add __divsi3, __aeabi_idiv 2019-04-29 19:17:48 +02:00
vegecode
01168e1577 compiler-rt: add aeabi_dcmp, comparedf2 2019-04-24 21:15:39 -04:00
vegecode
bb25f212b3 compiler-rt: add aeabi_fcmp, comparesf2 2019-04-21 00:12:21 -04:00
Andrew Kelley
a4c7e4c4eb __muloti4 does not need the ABI workaround on Windows
Fixes 128-bit integer multiplication on Windows.

closes #2250
2019-04-10 22:33:33 -04:00
Andrew Kelley
a71bfc249d compiler-rt: better way to do the ABI required on Windows
This removes the compiler_rt.setXmm0 hack. Instead, for
the functions that use i128 or u128 in their parameter and
return types, we use `@Vector(2, u64)` which generates
the LLVM IR `<2 x i64>` type that matches what Clang
generates for `typedef int ti_int __attribute__ ((mode (TI)))`
when targeting Windows x86_64.
2019-04-10 18:47:14 -04:00
vegecode
aff2e47821 compiler-rt: correct use_thumb_1 flag
The flag is for generating correct arm-thumb interwork veneers in the
assembly code __aeabi_{memcpy,memset,etc} functions.

Armv6m only does thumb code generation regardless of whether arm or
thumb is selected and armv6t2 uses the newer thumb 2 set. All other
versions that zig supports pre-armv7 need the veneers and hence the
flag. Armv5 is actually armv5t.

Relevant code from clang/lib/Basic/Targets/Arm.cpp

```c
bool ARMTargetInfo::isThumb() const {
  return ArchISA == llvm::ARM::ISAKind::THUMB;
  }

bool ARMTargetInfo::supportsThumb() const {
  return CPUAttr.count('T') || ArchVersion >= 6;
}

bool ARMTargetInfo::supportsThumb2() const {
  return CPUAttr.equals("6T2") ||
    (ArchVersion >= 7 && !CPUAttr.equals("8M_BASE"));
}
```

Also see

http://www.llvm.org/svn/llvm-project/llvm/trunk/lib/Target/ARM/ARM.td
2019-04-10 12:35:16 -04:00
vegecode
d72239d339 Add divdf3 to compiler_rt
Also adds __aeabi_ddiv for arm32 targets
2019-04-05 18:10:19 -04:00
Andrew Kelley
be0f656c21
fix @divFloor returning incorrect value and add __modti3
Closes #2152
See #1290
2019-04-04 15:45:37 -04:00
vegecode
12c4ab3927 Add divsf3 to compiler rt 2019-04-04 15:38:09 -04:00
vegecode
937ff0cb6a Add all __aeabi functions (C versions) who alias currently existing functions to compiler-rt 2019-03-31 15:54:02 -05:00
vegecode
779137be41 Add __aeabi_{f,d}neg and __neg{s,d,X}f2 to compiler-rt 2019-03-31 15:54:02 -05:00
vegecode
38c2093500 Add __aeabi_{f,d}{add,sub} and __{add,sub}{s,d}f3 to compiler-rt 2019-03-31 15:54:02 -05:00
vegecode
310f91fb4f Add __aeabi_mem{cmp,clr,set,cpy,move} to compiler-rt 2019-03-31 15:54:02 -05:00
Andrew Kelley
d83836825f
add mulXf3 to compiler-rt
this adds the following functions to compiler-rt:

 * `__mulsf3`
 * `__muldf3`
 * `__multf3`

See #1290
2019-03-22 17:46:49 -04:00
Andrew Kelley
b554f6294f
add popcountdi2 to compiler_rt 2019-03-05 23:09:00 -05:00
sjdh02
74c123cd0a fix check for 64-bit arm platforms with new targets 2019-03-03 10:04:08 -05:00
Andrew Kelley
e402455704
rename std lib files to new convention 2019-03-02 16:46:04 -05:00
Andrew Kelley
cf46cd5f2b organize file path of compiler_rt 2017-08-15 07:16:22 -04:00
Andrew Kelley
698829b772 change while syntax
Old:

```
while (condition; expression) {}
```

New:

```
while (condition) : (expression) {}
```

This is in preparation to allow nullable and
error union types as the condition. See #357
2017-05-03 18:12:07 -04:00
Andrew Kelley
644ea2dde9 remove test and try expressions in favor of if expressions
See #357
2017-05-03 17:23:11 -04:00
Andrew Kelley
17b935325e @import("builtin") instead of @compileVar
See #226
Closes #220
2017-05-01 13:12:38 -04:00
Andrew Kelley
0cce115476 update syntax for try and nullable unwrapping
closes #285
2017-04-21 16:46:33 -04:00
Andrew Kelley
e3c524c1d4 rename @ptrcast to @ptrCast to follow convention 2017-04-21 10:39:13 -04:00
Andrew Kelley
f8e63c4584 change @bitcast to @ptrcast
See #290
2017-03-31 06:18:20 -04:00
Andrew Kelley
3ca027ca82 first pass at zig build system
* `zig build --export [obj|lib|exe]` changed to `zig build_obj`,
   `zig build_lib` and `zig build_exe` respectively.
 * `--name` parameter is optional when it can be inferred from the
   root source filename. closes #207
 * `zig build` now looks for `build.zig` which interacts with
   `std.build.Builder` to describe the targets, and then the zig
   build system prints TODO: build these targets. See #204
 * add `@bitcast` which is mainly used for pointer reinterpret
   casting and make explicit casting not do pointer reinterpretation.
   Closes #290
 * fix debug info for byval parameters
 * sort command line help options
 * `std.debug.panic` supports format string printing
 * add `std.mem.IncrementingAllocator`
 * fix const ptr to a variable with data changing at runtime.
   closes #289
2017-03-31 05:55:41 -04:00
Andrew Kelley
a32b5929cc add stack protector safety when linking libc
* introduce zigrt file. it contains only weak symbols so that
   multiple instances can be merged. it contains __zig_panic
   so that multiple .o files can call the same panic function.
 * remove `@setFnVisible` builtin and add @setGlobalLinkage builtin
   which is more powerful
 * add `@panic` builtin function.
 * fix collision of symbols with extern prototypes and internal
   function names
 * add stack protector safety when linking against libc. To add
   the safety mechanism without libc requires implementing
   Thread Local Storage. See #276
2017-03-26 21:07:07 -04:00
Andrew Kelley
5bc9feb5cb organize std and make import relative to current file
closes #216
2017-03-26 06:39:28 -04:00