compiler-builtins-zynq/src
Ian Kronquist 462b73c1fe Implement bcmp (#315)
As of LLVM 9.0, certain calls to memcmp may be converted to bcmp, which I guess
could save a single subtraction on some architectures. [1]

bcmp is just like memcmp except instead of returning the difference between the
two differing bytes, it returns non-zero instead. As such, memcmp is a valid
implementation of bcmp.

If we care about size, bcmp should just call memcmp.
If we care about speed, we can change bcmp to look like this instead:
```rust
pub unsafe extern "C" fn bcmp(s1: *const u8, s2: *const u8, n: usize) -> i32 {
    let mut i = 0;
    while i < n {
        let a = *s1.offset(i as isize);
        let b = *s2.offset(i as isize);
        if a != b {
            return 1;
        }
        i += 1;
    }
    0
}
```

In this PR I do not address any changes which may or may not be needed for arm
aebi as I lack proper test hardware.

[1]: https://releases.llvm.org/9.0.0/docs/ReleaseNotes.html#noteworthy-optimizations
2019-09-30 11:02:47 -05:00
..
float Remove the need for #[cfg] in #[use_c_shim_if] 2019-05-15 12:59:31 -07:00
int Replace {u,i}128_* lang items with __rust_{u,i}128_* unmangled functions 2019-07-13 11:38:35 +02:00
arm.rs remove unused imports 2019-07-13 11:00:15 +02:00
arm_linux.rs Run rustfmt over everything 2019-05-14 14:40:38 -07:00
lib.rs Run rustfmt over everything 2019-05-14 14:40:38 -07:00
macros.rs Replace {u,i}128_* lang items with __rust_{u,i}128_* unmangled functions 2019-07-13 11:38:35 +02:00
math.rs Update libm for fmin/fmax/fminf/fmaxf 2019-06-05 23:41:18 +01:00
mem.rs Implement bcmp (#315) 2019-09-30 11:02:47 -05:00
probestack.rs probestack: add frame pointers for easier traceback 2019-07-24 10:18:30 +03:00
riscv32.rs Fix compile on riscv again 2018-08-31 16:00:12 -07:00
x86.rs Add "volatile" and "memory" clobber to asm! that doesn't fall through. 2017-11-15 12:49:10 -08:00
x86_64.rs Add "volatile" and "memory" clobber to asm! that doesn't fall through. 2017-11-15 12:49:10 -08:00