@@ -557,7 +557,7 @@ TMAKE= MAKEOBJDIRPREFIX | ||
# cross-tools stage | ||
XMAKE= TOOLS_PREFIX=${W | ||
TARGET=${TARGET} | ||
- MK_GDB=no MK_TESTS=no | ||
+ MK_GDB=no MK_LLD_IS_LD=${M | ||
# kernel-tools stage | ||
KTMAKEENV= INSTALL="sh ${.CURDIR}/tools | ||
@@ -1786,7 +1786,8 @@ update: .PHONY | ||
# ELF Tool Chain libraries are needed for ELF tools and dtrace tools. | ||
# r296685 fix cross-endian objcopy | ||
-.if ${BOOTSTRAPPING} | ||
+# r310724 fixed PR 215350, a crash in libdwarf with objects built by GCC 6.2. | ||
+.if ${BOOTSTRAPPING} | ||
_elftoolchain_li | ||
.endif | ||
@@ -1984,8 +1985,12 @@ _gcc_tools= gnu/usr.bin/cc/c | ||
_rescue=rescue/r | ||
.endif | ||
+.if ${MK_TCSH} != "no" | ||
+_tcsh=bin/csh | ||
+.endif | ||
+ | ||
.for _tool in \ | ||
- bin/csh \ | ||
+ ${_tcsh} \ | ||
bin/sh \ | ||
${LOCAL_TOOL_DIR | ||
lib/ncurses/ncur | ||
@@ -2143,7 +2148,7 @@ native-xtools: .PHONY | ||
bin/cat \ | ||
bin/chmod \ | ||
bin/cp \ | ||
- bin/csh \ | ||
+ ${_tcsh} \ | ||
bin/echo \ | ||
bin/expr \ | ||
bin/hostname \ |
@@ -38,6 +38,13 @@ | ||
# xargs -n1 | sort | uniq -d; | ||
# done | ||
+# 20170913: remove unneeded catman utility | ||
+OLD_FILES+=etc/ | ||
+OLD_FILES+=usr/ | ||
+OLD_FILES+=usr/ | ||
+OLD_FILES+=usr/ | ||
+OLD_FILES+=usr/ | ||
+ | ||
# 20170802: ksyms(4) ioctl interface was removed | ||
OLD_FILES+=usr/i | ||
@@ -51,6 +51,29 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: | ||
**************** | ||
+20170912: | ||
+ The default serial number format for CTL LUNs has changed. This will | ||
+ affect users who use /dev/diskid/* device nodes, or whose FibreChannel | ||
+ or iSCSI clients care about their LUNs' serial numbers. Users who | ||
+ require serial number stability should hardcode serial numbers in | ||
+ /etc/ctl.conf . | ||
+ | ||
+20170912: | ||
+ For 32-bit arm compiled for hard-float support, soft-floating point | ||
+ binaries now always get their shared libraries from | ||
+ LD_SOFT_LIBRARY_ | ||
+ /usr/libsoft also existed). Only users with a hard-float ld.so, but | ||
+ soft-float everything else should be affected. | ||
+ | ||
+20170826: | ||
+ During boot the geli passphrase will be hidden. To restore previous | ||
+ behavior see geli(8) configuration options. | ||
+ | ||
+20170825: | ||
+ Move PMTUD blackhole counters to TCPSTATS and remove them from bare | ||
+ sysctl values. Minor nit, but requires a rebuild of both world/kernel | ||
+ to complete. | ||
+ | ||
20170814: | ||
"make check" behavior (made in ^/head@r295380) has been changed to | ||
execute from a limited sandbox, as opposed to executing from |
@@ -4,4 +4,7 @@ | ||
PACKAGE=runtime | ||
PROG= chflags | ||
+HAS_TESTS= | ||
+SUBDIR.${MK_TES | ||
+ | ||
.include <bsd.prog.mk> |
@@ -0,0 +1,5 @@ | ||
+# $FreeBSD$ | ||
+ | ||
+ATF_TESTS_SH+= chflags_test | ||
+ | ||
+.include <bsd.test.mk> |
@@ -0,0 +1,63 @@ | ||
+# | ||
+# Copyright 2017 Shivansh Rai | ||
+# All rights reserved. | ||
+# | ||
+# Redistribution and use in source and binary forms, with or without | ||
+# modification, are permitted provided that the following conditions | ||
+# are met: | ||
+# 1. Redistributions of source code must retain the above copyright | ||
+# notice, this list of conditions and the following disclaimer. | ||
+# 2. Redistributions in binary form must reproduce the above copyright | ||
+# notice, this list of conditions and the following disclaimer in the | ||
+# documentation and/or other materials provided with the distribution. | ||
+# | ||
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | ||
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
+# SUCH DAMAGE. | ||
+# | ||
+# $FreeBSD$ | ||
+# | ||
+ | ||
+usage_output='u | ||
+ | ||
+atf_test_case invalid_usage | ||
+invalid_usage_h | ||
+{ | ||
+ atf_set "descr" "Verify that an invalid usage with a supported option produces a valid error message" | ||
+} | ||
+ | ||
+invalid_usage_b | ||
+{ | ||
+ atf_check -s not-exit:0 -e match:"$usage_ou | ||
+ atf_check -s not-exit:0 -e match:"$usage_ou | ||
+ atf_check -s not-exit:0 -e match:"$usage_ou | ||
+ atf_check -s not-exit:0 -e match:"$usage_ou | ||
+ atf_check -s not-exit:0 -e match:"$usage_ou | ||
+ atf_check -s not-exit:0 -e match:"$usage_ou | ||
+ atf_check -s not-exit:0 -e match:"$usage_ou | ||
+} | ||
+ | ||
+atf_test_case no_arguments | ||
+no_arguments_he | ||
+{ | ||
+ atf_set "descr" "Verify that chflags(1) fails and generates a valid usage message when no arguments are supplied" | ||
+} | ||
+ | ||
+no_arguments_bo | ||
+{ | ||
+ atf_check -s not-exit:0 -e match:"$usage_ou | ||
+} | ||
+ | ||
+atf_init_test_c | ||
+{ | ||
+ atf_add_test_cas | ||
+ atf_add_test_cas | ||
+} |
@@ -41,6 +41,7 @@ __FBSDID("$FreeB | ||
#include <sys/types.h> | ||
+#include <ctype.h> | ||
#include <err.h> | ||
#include <errno.h> | ||
#include <inttypes.h> | ||
@@ -184,7 +185,7 @@ f_bs(char *arg) | ||
res = get_num(arg); | ||
if (res < 1 || res > SSIZE_MAX) | ||
- errx(1, "bs must be between 1 and %jd", (intmax_t)SSIZE_ | ||
+ errx(1, "bs must be between 1 and %zd", (ssize_t)SSIZE_M | ||
in.dbsz = out.dbsz = (size_t)res; | ||
} | ||
@@ -195,22 +196,22 @@ f_cbs(char *arg) | ||
res = get_num(arg); | ||
if (res < 1 || res > SSIZE_MAX) | ||
- errx(1, "cbs must be between 1 and %jd", (intmax_t)SSIZE_ | ||
+ errx(1, "cbs must be between 1 and %zd", (ssize_t)SSIZE_M | ||
cbsz = (size_t)res; | ||
} | ||
static void | ||
f_count(char *arg) | ||
{ | ||
- intmax_t res; | ||
+ uintmax_t res; | ||
- res = (intmax_t)get_nu | ||
- if (res < 0) | ||
- errx(1, "count cannot be negative"); | ||
+ res = get_num(arg); | ||
+ if (res == UINTMAX_MAX) | ||
+ errc(1, ERANGE, "%s", oper); | ||
if (res == 0) | ||
- cpy_cnt = (uintmax_t)-1; | ||
+ cpy_cnt = UINTMAX_MAX; | ||
else | ||
- cpy_cnt = (uintmax_t)res; | ||
+ cpy_cnt = res; | ||
} | ||
static void | ||
@@ -219,7 +220,7 @@ f_files(char *arg) | ||
files_cnt = get_num(arg); | ||
if (files_cnt < 1) | ||
- errx(1, "files must be between 1 and %jd", (uintmax_t)-1); | ||
+ errx(1, "files must be between 1 and %zu", SIZE_MAX); | ||
} | ||
static void | ||
@@ -240,8 +241,8 @@ f_ibs(char *arg) | ||
if (!(ddflags & C_BS)) { | ||
res = get_num(arg); | ||
if (res < 1 || res > SSIZE_MAX) | ||
- errx(1, "ibs must be between 1 and %jd", | ||
- (intmax_t)SSIZE_ | ||
+ errx(1, "ibs must be between 1 and %zd", | ||
+ (ssize_t)SSIZE_M | ||
in.dbsz = (size_t)res; | ||
} | ||
} | ||
@@ -261,8 +262,8 @@ f_obs(char *arg) | ||
if (!(ddflags & C_BS)) { | ||
res = get_num(arg); | ||
if (res < 1 || res > SSIZE_MAX) | ||
- errx(1, "obs must be between 1 and %jd", | ||
- (intmax_t)SSIZE_ | ||
+ errx(1, "obs must be between 1 and %zd", | ||
+ (ssize_t)SSIZE_M | ||
out.dbsz = (size_t)res; | ||
} | ||
} |
@@ -133,7 +133,7 @@ block(void) | ||
*/ | ||
ch = 0; | ||
for (inp = in.dbp - in.dbcnt, outp = out.dbp; in.dbcnt;) { | ||
- maxlen = MIN(cbsz, in.dbcnt); | ||
+ maxlen = MIN(cbsz, (size_t)in.dbcnt | ||
if ((t = ctab) != NULL) | ||
for (cnt = 0; cnt < maxlen && (ch = *inp++) != '\n'; | ||
++cnt) | ||
@@ -146,7 +146,7 @@ block(void) | ||
* Check for short record without a newline. Reassemble the | ||
* input block. | ||
*/ | ||
- if (ch != '\n' && in.dbcnt < cbsz) { | ||
+ if (ch != '\n' && (size_t)in.dbcnt | ||
(void)memmove(in | ||
break; | ||
} | ||
@@ -228,7 +228,7 @@ unblock(void) | ||
* translation has to already be done or we might not recognize the | ||
* spaces. | ||
*/ | ||
- for (inp = in.db; in.dbcnt >= cbsz; inp += cbsz, in.dbcnt -= cbsz) { | ||
+ for (inp = in.db; (size_t)in.dbcnt | ||
for (t = inp + cbsz - 1; t >= inp && *t == ' '; --t) | ||
; | ||
if (t >= inp) { |
@@ -204,10 +204,10 @@ setup(void) | ||
* record oriented I/O, only need a single buffer. | ||
*/ | ||
if (!(ddflags & (C_BLOCK | C_UNBLOCK))) { | ||
- if ((in.db = malloc(out.dbsz + in.dbsz - 1)) == NULL) | ||
+ if ((in.db = malloc((size_t)o | ||
err(1, "input buffer"); | ||
out.db = in.db; | ||
- } else if ((in.db = malloc(MAX(in.db | ||
+ } else if ((in.db = malloc(MAX((size | ||
(out.db = malloc(out.dbsz + cbsz)) == NULL) | ||
err(1, "output buffer"); | ||
@@ -405,7 +405,7 @@ dd_in(void) | ||
++st.in_full; | ||
/* Handle full input blocks. */ | ||
- } else if ((size_t)n == in.dbsz) { | ||
+ } else if ((size_t)n == (size_t)in.dbsz) | ||
in.dbcnt += in.dbrcnt = n; | ||
++st.in_full; | ||
@@ -562,7 +562,7 @@ dd_out(int force) | ||
outp += nw; | ||
st.bytes += nw; | ||
- if ((size_t)nw == n && n == out.dbsz) | ||
+ if ((size_t)nw == n && n == (size_t)out.dbsz | ||
++st.out_full; | ||
else | ||
++st.out_part; |
@@ -38,10 +38,9 @@ | ||
typedef struct { | ||
u_char *db; /* buffer address */ | ||
u_char *dbp; /* current buffer I/O address */ | ||
- /* XXX ssize_t? */ | ||
- size_t dbcnt; /* current buffer byte count */ | ||
- size_t dbrcnt; /* last read byte count */ | ||
- size_t dbsz; /* block size */ | ||
+ ssize_t dbcnt; /* current buffer byte count */ | ||
+ ssize_t dbrcnt; /* last read byte count */ | ||
+ ssize_t dbsz; /* block size */ | ||
#define ISCHR 0x01 /* character device (warn on short) */ | ||
#define ISPIPE 0x02 /* pipe-like (see position.c) */ |
@@ -207,7 +207,7 @@ pos_out(void) | ||
n = write(out.fd, out.db, out.dbsz); | ||
if (n == -1) | ||
err(1, "%s", out.name); | ||
- if ((size_t)n != out.dbsz) | ||
+ if (n != out.dbsz) | ||
errx(1, "%s: write failure", out.name); | ||
} | ||
break; |
@@ -4,4 +4,7 @@ | ||
PACKAGE=runtime | ||
PROG= mkdir | ||
+HAS_TESTS= | ||
+SUBDIR.${MK_TES | ||
+ | ||
.include <bsd.prog.mk> |
@@ -0,0 +1,5 @@ | ||
+# $FreeBSD$ | ||
+ | ||
+ATF_TESTS_SH+= mkdir_test | ||
+ | ||
+.include <bsd.test.mk> |
@@ -0,0 +1,61 @@ | ||
+# | ||
+# Copyright 2017 Shivansh Rai | ||
+# All rights reserved. | ||
+# | ||
+# Redistribution and use in source and binary forms, with or without | ||
+# modification, are permitted provided that the following conditions | ||
+# are met: | ||
+# 1. Redistributions of source code must retain the above copyright | ||
+# notice, this list of conditions and the following disclaimer. | ||
+# 2. Redistributions in binary form must reproduce the above copyright | ||
+# notice, this list of conditions and the following disclaimer in the | ||
+# documentation and/or other materials provided with the distribution. | ||
+# | ||
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | ||
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
+# SUCH DAMAGE. | ||
+# | ||
+# $FreeBSD$ | ||
+# | ||
+ | ||
+usage_output='u | ||
+ | ||
+atf_test_case invalid_usage | ||
+invalid_usage_h | ||
+{ | ||
+ atf_set "descr" "Verify that an invalid usage with a supported option produces a valid error message" | ||
+} | ||
+ | ||
+invalid_usage_b | ||
+{ | ||
+ atf_check -s not-exit:0 -e inline:"mkdir: option requires an argument -- m | ||
+usage: mkdir [-pv] [-m mode] directory_name ... | ||
+" mkdir -m | ||
+ atf_check -s not-exit:0 -e match:"$usage_ou | ||
+ atf_check -s not-exit:0 -e match:"$usage_ou | ||
+} | ||
+ | ||
+atf_test_case no_arguments | ||
+no_arguments_he | ||
+{ | ||
+ atf_set "descr" "Verify that mkdir(1) fails and generates a valid usage message when no arguments are supplied" | ||
+} | ||
+ | ||
+no_arguments_bo | ||
+{ | ||
+ atf_check -s not-exit:0 -e match:"$usage_ou | ||
+} | ||
+ | ||
+atf_init_test_c | ||
+{ | ||
+ atf_add_test_cas | ||
+ atf_add_test_cas | ||
+} |
@@ -568,7 +568,7 @@ main(int argc, char **argv) | ||
continue; | ||
rv |= (*action)(kp); | ||
} | ||
- if (rv && pgrep) | ||
+ if (rv && pgrep && !quiet) | ||
putchar('\n'); | ||
if (!did_action && !pgrep && longfmt) | ||
fprintf(stderr, |
@@ -262,9 +262,9 @@ state(KINFO *k, VARENT *ve __unused) | ||
cp++; | ||
if (!(flag & P_INMEM)) | ||
*cp++ = 'W'; | ||
- if (k->ki_p->ki_nic | ||
+ if (k->ki_p->ki_nic | ||
*cp++ = '<'; | ||
- else if (k->ki_p->ki_nic | ||
+ else if (k->ki_p->ki_nic | ||
*cp++ = 'N'; | ||
if (flag & P_TRACED) | ||
*cp++ = 'X'; | ||
@@ -274,6 +274,8 @@ state(KINFO *k, VARENT *ve __unused) | ||
*cp++ = 'V'; | ||
if ((flag & P_SYSTEM) || k->ki_p->ki_lock | ||
*cp++ = 'L'; | ||
+ if ((k->ki_p->ki_cr | ||
+ *cp++ = 'C'; | ||
if (k->ki_p->ki_kif | ||
*cp++ = 's'; | ||
if ((flag & P_CONTROLT) && k->ki_p->ki_pgid |
@@ -29,7 +29,7 @@ | ||
.\" @(#)ps.1 8.3 (Berkeley) 4/18/94 | ||
.\" $FreeBSD$ | ||
.\" | ||
-.Dd July 25, 2017 | ||
+.Dd September 7, 2017 | ||
.Dt PS 1 | ||
.Os | ||
.Sh NAME | ||
@@ -436,6 +436,10 @@ information: | ||
The process is in the foreground process group of its control terminal. | ||
.It Li < | ||
The process has raised CPU scheduling priority. | ||
+.It Li C | ||
+The process is in | ||
+.Xr capsicum 4 | ||
+capability mode. | ||
.It Li E | ||
The process is trying to exit. | ||
.It Li J | ||
@@ -541,7 +545,7 @@ short-term CPU usage factor (for scheduling) | ||
.It Cm dsiz | ||
data size (in Kbytes) | ||
.It Cm emul | ||
-system-call emulation environment | ||
+system-call emulation environment (ABI) | ||
.It Cm etime | ||
elapsed running time, format | ||
.Op days- Ns |
@@ -11,4 +11,7 @@ PACKAGE=rcmds | ||
BINOWN= root | ||
BINMODE=4555 | ||
+HAS_TESTS= | ||
+SUBDIR.${MK_TES | ||
+ | ||
.include <bsd.prog.mk> |
@@ -0,0 +1,5 @@ | ||
+# $FreeBSD$ | ||
+ | ||
+ATF_TESTS_SH+= rcp_test | ||
+ | ||
+.include <bsd.test.mk> |
@@ -0,0 +1,60 @@ | ||
+# | ||
+# Copyright 2017 Shivansh Rai | ||
+# All rights reserved. | ||
+# | ||
+# Redistribution and use in source and binary forms, with or without | ||
+# modification, are permitted provided that the following conditions | ||
+# are met: | ||
+# 1. Redistributions of source code must retain the above copyright | ||
+# notice, this list of conditions and the following disclaimer. | ||
+# 2. Redistributions in binary form must reproduce the above copyright | ||
+# notice, this list of conditions and the following disclaimer in the | ||
+# documentation and/or other materials provided with the distribution. | ||
+# | ||
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | ||
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
+# SUCH DAMAGE. | ||
+# | ||
+# $FreeBSD$ | ||
+# | ||
+ | ||
+usage_output='u | ||
+ | ||
+atf_test_case invalid_usage | ||
+invalid_usage_h | ||
+{ | ||
+ atf_set "descr" "Verify that an invalid usage with a supported option produces a valid error message" | ||
+} | ||
+ | ||
+invalid_usage_b | ||
+{ | ||
+ atf_check -s not-exit:0 -e match:"$usage_ou | ||
+ atf_check -s not-exit:0 -e match:"$usage_ou | ||
+ atf_check -s not-exit:0 -e match:"$usage_ou | ||
+ atf_check -s not-exit:0 -e match:"$usage_ou | ||
+} | ||
+ | ||
+atf_test_case no_arguments | ||
+no_arguments_he | ||
+{ | ||
+ atf_set "descr" "Verify that rcp(1) fails and generates a valid usage message when no arguments are supplied" | ||
+} | ||
+ | ||
+no_arguments_bo | ||
+{ | ||
+ atf_check -s not-exit:0 -e match:"$usage_ou | ||
+} | ||
+ | ||
+atf_init_test_c | ||
+{ | ||
+ atf_add_test_cas | ||
+ atf_add_test_cas | ||
+} |
@@ -4,4 +4,7 @@ | ||
PACKAGE=runtime | ||
PROG= rmdir | ||
+HAS_TESTS= | ||
+SUBDIR.${MK_TES | ||
+ | ||
.include <bsd.prog.mk> |
@@ -0,0 +1,5 @@ | ||
+# $FreeBSD$ | ||
+ | ||
+ATF_TESTS_SH+= rmdir_test | ||
+ | ||
+.include <bsd.test.mk> |
@@ -0,0 +1,58 @@ | ||
+# | ||
+# Copyright 2017 Shivansh Rai | ||
+# All rights reserved. | ||
+# | ||
+# Redistribution and use in source and binary forms, with or without | ||
+# modification, are permitted provided that the following conditions | ||
+# are met: | ||
+# 1. Redistributions of source code must retain the above copyright | ||
+# notice, this list of conditions and the following disclaimer. | ||
+# 2. Redistributions in binary form must reproduce the above copyright | ||
+# notice, this list of conditions and the following disclaimer in the | ||
+# documentation and/or other materials provided with the distribution. | ||
+# | ||
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | ||
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
+# SUCH DAMAGE. | ||
+# | ||
+# $FreeBSD$ | ||
+# | ||
+ | ||
+usage_output='u | ||
+ | ||
+atf_test_case invalid_usage | ||
+invalid_usage_h | ||
+{ | ||
+ atf_set "descr" "Verify that an invalid usage with a supported option produces a valid error message" | ||
+} | ||
+ | ||
+invalid_usage_b | ||
+{ | ||
+ atf_check -s not-exit:0 -e match:"$usage_ou | ||
+ atf_check -s not-exit:0 -e match:"$usage_ou | ||
+} | ||
+ | ||
+atf_test_case no_arguments | ||
+no_arguments_he | ||
+{ | ||
+ atf_set "descr" "Verify that rmdir(1) fails and generates a valid usage message when no arguments are supplied" | ||
+} | ||
+ | ||
+no_arguments_bo | ||
+{ | ||
+ atf_check -s not-exit:0 -e match:"$usage_ou | ||
+} | ||
+ | ||
+atf_init_test_c | ||
+{ | ||
+ atf_add_test_cas | ||
+ atf_add_test_cas | ||
+} |
@@ -74,7 +74,7 @@ zmount(const char *spec, const char *dir, int mflag, char *fstype, | ||
char *dataptr, int datalen, char *optptr, int optlen) | ||
{ | ||
struct iovec *iov; | ||
- char *optstr, *os, *p; | ||
+ char *optstr, *os, *p, *tofree; | ||
int iovlen, rv; | ||
assert(spec != NULL); | ||
@@ -87,7 +87,7 @@ zmount(const char *spec, const char *dir, int mflag, char *fstype, | ||
assert(optptr != NULL); | ||
assert(optlen > 0); | ||
- optstr = strdup(optptr); | ||
+ tofree = optstr = strdup(optptr); | ||
assert(optstr != NULL); | ||
iov = NULL; | ||
@@ -98,11 +98,9 @@ zmount(const char *spec, const char *dir, int mflag, char *fstype, | ||
build_iovec(&iov | ||
(size_t)-1); | ||
build_iovec(&iov | ||
- for (p = optstr; p != NULL; strsep(&p, ",/ ")) { | ||
- if (*p != '\0') | ||
- build_iovec(&iov | ||
- } | ||
+ while ((p = strsep(&optstr, ",/")) != NULL) | ||
+ build_iovec(&iov | ||
rv = nmount(iov, iovlen, 0); | ||
- free(optstr); | ||
+ free(tofree); | ||
return (rv); | ||
} |
@@ -28,9 +28,6 @@ | ||
#pragma D option quiet | ||
-inline int AF_INET = 2; | ||
-inline int AF_INET6 = 28; | ||
- | ||
in_addr_t *ip4a; | ||
in_addr_t *ip4b; | ||
in_addr_t *ip4c; |
@@ -0,0 +1,25 @@ | ||
+/* | ||
+ * This file and its contents are supplied under the terms of the | ||
+ * Common Development and Distribution License ("CDDL"), version 1.0. | ||
+ * You may only use this file in accordance with the terms version | ||
+ * 1.0 of the CDDL. | ||
+ * | ||
+ * A full copy of the text of the CDDL should have accompanied this | ||
+ * source. A copy of the CDDL is also available via the Internet at | ||
+ * http://www.illum | ||
+ */ | ||
+ | ||
+/* | ||
+ * Copyright 2017 Mark Johnston <markj@FreeBSD.o | ||
+ */ | ||
+ | ||
+/* | ||
+ * A regression test for FreeBSD r322773. 100^9 fits in 64 bits, but | ||
+ * llquantize() will create buckets up to 100^{10}, which does not fit. | ||
+ */ | ||
+ | ||
+BEGIN | ||
+{ | ||
+ @ = llquantize(0, 100, 0, 9, 100); | ||
+ exit(0); | ||
+} |
@@ -19,14 +19,15 @@ | ||
.\" information: Portions Copyright [yyyy] [name of copyright owner] | ||
.\" | ||
.\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved. | ||
-.\" Copyright 2011, Nexenta Systems, Inc. All Rights Reserved. | ||
.\" Copyright (c) 2011, Justin T. Gibbs <gibbs@FreeBSD.o | ||
-.\" Copyright (c) 2013 by Delphix. All Rights Reserved. | ||
.\" Copyright (c) 2012, Glen Barber <gjb@FreeBSD.org | ||
+.\" Copyright (c) 2013 by Delphix. All Rights Reserved. | ||
+.\" Copyright 2017 Nexenta Systems, Inc. | ||
+.\" Copyright (c) 2017 Datto Inc. | ||
.\" | ||
.\" $FreeBSD$ | ||
.\" | ||
-.Dd July 26, 2014 | ||
+.Dd September 08, 2017 | ||
.Dt ZPOOL 8 | ||
.Os | ||
.Sh NAME | ||
@@ -153,7 +154,7 @@ | ||
.Op Ar new_device | ||
.Nm | ||
.Cm scrub | ||
-.Op Fl s | ||
+.Op Fl s | Fl p | ||
.Ar pool ... | ||
.Nm | ||
.Cm set | ||
@@ -1543,43 +1544,54 @@ manner. | ||
.It Xo | ||
.Nm | ||
.Cm scrub | ||
-.Op Fl s | ||
+.Op Fl s | Fl p | ||
.Ar pool ... | ||
.Xc | ||
.Pp | ||
-Begins a scrub. The scrub examines all data in the specified pools to verify | ||
-that it checksums correctly. For replicated (mirror or | ||
-.No raidz ) | ||
-devices, | ||
-.Tn ZFS | ||
-automatically repairs any damage discovered during the scrub. The | ||
-.Qq Nm Cm status | ||
+Begins a scrub or resumes a paused scrub. | ||
+The scrub examines all data in the specified pools to verify that it checksums | ||
+correctly. | ||
+For replicated | ||
+.Pq mirror or raidz | ||
+devices, ZFS automatically repairs any damage discovered during the scrub. | ||
+The | ||
+.Nm zpool Cm status | ||
command reports the progress of the scrub and summarizes the results of the | ||
scrub upon completion. | ||
.Pp | ||
-Scrubbing and resilvering are very similar operations. The difference is that | ||
-resilvering only examines data that | ||
-.Tn ZFS | ||
-knows to be out of date (for example, when attaching a new device to a mirror | ||
-or replacing an existing device), whereas scrubbing examines all data to | ||
-discover silent errors due to hardware faults or disk failure. | ||
-.Pp | ||
-Because scrubbing and resilvering are | ||
-.Tn I/O Ns -intensive | ||
-operations, | ||
-.Tn ZFS | ||
-only allows one at a time. If a scrub is already in progress, the | ||
-.Qq Nm Cm scrub | ||
-command returns an error. To start a new scrub, you have to stop the old scrub | ||
-with the | ||
-.Qq Nm Cm scrub Fl s | ||
-command first. If a resilver is in progress, | ||
-.Tn ZFS | ||
-does not allow a scrub to be started until the resilver completes. | ||
-.Bl -tag -width indent | ||
+Scrubbing and resilvering are very similar operations. | ||
+The difference is that resilvering only examines data that ZFS knows to be out | ||
+of date | ||
+.Po | ||
+for example, when attaching a new device to a mirror or replacing an existing | ||
+device | ||
+.Pc , | ||
+whereas scrubbing examines all data to discover silent errors due to hardware | ||
+faults or disk failure. | ||
+.Pp | ||
+Because scrubbing and resilvering are I/O-intensive operations, ZFS only allows | ||
+one at a time. | ||
+If a scrub is paused, the | ||
+.Nm zpool Cm scrub | ||
+resumes it. | ||
+If a resilver is in progress, ZFS does not allow a scrub to be started until the | ||
+resilver completes. | ||
+.Bl -tag -width Ds | ||
.It Fl s | ||
Stop scrubbing. | ||
.El | ||
+.Bl -tag -width Ds | ||
+.It Fl p | ||
+Pause scrubbing. | ||
+Scrub pause state and progress are periodically synced to disk. | ||
+If the system is restarted or pool is exported during a paused scrub, | ||
+even after import, scrub will remain paused until it is resumed. | ||
+Once resumed the scrub will pick up from the place where it was last | ||
+checkpointed to disk. | ||
+To resume a paused scrub issue | ||
+.Nm zpool Cm scrub | ||
+again. | ||
+.El | ||
.It Xo | ||
.Nm | ||
.Cm set |
@@ -27,6 +27,7 @@ | ||
* Copyright (c) 2013 by Prasad Joshi (sTec). All rights reserved. | ||
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmai | ||
* Copyright 2016 Nexenta Systems, Inc. | ||
+ * Copyright (c) 2017 Datto Inc. | ||
*/ | ||
#include <solaris.h> | ||
@@ -252,7 +253,7 @@ get_usage(zpool_ | ||
case HELP_REOPEN: | ||
return (gettext("\treop | ||
case HELP_SCRUB: | ||
- return (gettext("\tscru | ||
+ return (gettext("\tscru | ||
case HELP_STATUS: | ||
return (gettext("\tstat | ||
"[count]]\n")); | ||
@@ -3825,6 +3826,7 @@ typedef struct scrub_cbdata { | ||
int cb_type; | ||
int cb_argc; | ||
char **cb_argv; | ||
+ pool_scrub_cmd_t | ||
} scrub_cbdata_t; | ||
int | ||
@@ -3842,15 +3844,16 @@ scrub_callback(z | ||
return (1); | ||
} | ||
- err = zpool_scan(zhp, cb->cb_type); | ||
+ err = zpool_scan(zhp, cb->cb_type, cb->cb_scrub_cmd | ||
return (err != 0); | ||
} | ||
/* | ||
- * zpool scrub [-s] <pool> ... | ||
+ * zpool scrub [-s | -p] <pool> ... | ||
* | ||
* -s Stop. Stops any in-progress scrub. | ||
+ * -p Pause. Pause in-progress scrub. | ||
*/ | ||
int | ||
zpool_do_scrub(i | ||
@@ -3859,13 +3862,17 @@ zpool_do_scrub(i | ||
scrub_cbdata_t cb; | ||
cb.cb_type = POOL_SCAN_SCRUB; | ||
+ cb.cb_scrub_cmd = POOL_SCRUB_NORMA | ||
/* check options */ | ||
- while ((c = getopt(argc, argv, "s")) != -1) { | ||
+ while ((c = getopt(argc, argv, "sp")) != -1) { | ||
switch (c) { | ||
case 's': | ||
cb.cb_type = POOL_SCAN_NONE; | ||
break; | ||
+ case 'p': | ||
+ cb.cb_scrub_cmd = POOL_SCRUB_PAUSE | ||
+ break; | ||
case '?': | ||
(void) fprintf(stderr, gettext("invalid | ||
optopt); | ||
@@ -3873,6 +3880,13 @@ zpool_do_scrub(i | ||
} | ||
} | ||
+ if (cb.cb_type == POOL_SCAN_NONE && | ||
+ cb.cb_scrub_cmd == POOL_SCRUB_PAUSE | ||
+ (void) fprintf(stderr, gettext("invalid | ||
+ "-s and -p are mutually exclusive\n")); | ||
+ usage(B_FALSE); | ||
+ } | ||
+ | ||
cb.cb_argc = argc; | ||
cb.cb_argv = argv; | ||
argc -= optind; | ||
@@ -3901,7 +3915,7 @@ typedef struct status_cbdata { | ||
void | ||
print_scan_statu | ||
{ | ||
- time_t start, end; | ||
+ time_t start, end, pause; | ||
uint64_t elapsed, mins_left, hours_left; | ||
uint64_t pass_exam, examined, total; | ||
uint_t rate; | ||
@@ -3919,6 +3933,7 @@ print_scan_statu | ||
start = ps->pss_start_ti | ||
end = ps->pss_end_time | ||
+ pause = ps->pss_pass_scr | ||
zfs_nicenum(ps-> | ||
assert(ps->pss_f | ||
@@ -3961,8 +3976,17 @@ print_scan_statu | ||
* Scan is in progress. | ||
*/ | ||
if (ps->pss_func == POOL_SCAN_SCRUB) | ||
- (void) printf(gettext(" | ||
- ctime(&start)); | ||
+ if (pause == 0) { | ||
+ (void) printf(gettext(" | ||
+ ctime(&start)); | ||
+ } else { | ||
+ char buf[32]; | ||
+ struct tm *p = localtime(&pause | ||
+ (void) strftime(buf, sizeof (buf), "%a %b %e %T %Y", p); | ||
+ (void) printf(gettext(" | ||
+ (void) printf(gettext(" | ||
+ ctime(&start)); | ||
+ } | ||
} else if (ps->pss_func == POOL_SCAN_RESILV | ||
(void) printf(gettext(" | ||
ctime(&start)); | ||
@@ -3974,6 +3998,7 @@ print_scan_statu | ||
/* elapsed time for this pass */ | ||
elapsed = time(NULL) - ps->pss_pass_sta | ||
+ elapsed -= ps->pss_pass_scr | ||
elapsed = elapsed ? elapsed : 1; | ||
pass_exam = ps->pss_pass_exa | ||
rate = pass_exam / elapsed; | ||
@@ -3983,19 +4008,25 @@ print_scan_statu | ||
zfs_nicenum(exam | ||
zfs_nicenum(tota | ||
- zfs_nicenum(rate | ||
/* | ||
* do not print estimated time if hours_left is more than 30 days | ||
+ * or we have a paused scrub | ||
*/ | ||
- (void) printf(gettext(" | ||
- examined_buf, total_buf, rate_buf); | ||
- if (hours_left < (30 * 24)) { | ||
- (void) printf(gettext(" | ||
- (u_longlong_t)ho | ||
+ if (pause == 0) { | ||
+ zfs_nicenum(rate | ||
+ (void) printf(gettext(" | ||
+ examined_buf, total_buf, rate_buf); | ||
+ if (hours_left < (30 * 24)) { | ||
+ (void) printf(gettext(" | ||
+ (u_longlong_t)ho | ||
+ } else { | ||
+ (void) printf(gettext( | ||
+ ", (scan is slow, no estimated time)\n")); | ||
+ } | ||
} else { | ||
- (void) printf(gettext( | ||
- ", (scan is slow, no estimated time)\n")); | ||
+ (void) printf(gettext(" | ||
+ examined_buf, total_buf); | ||
} | ||
if (ps->pss_func == POOL_SCAN_RESILV |
@@ -1503,7 +1503,7 @@ dt_compile_agg(d | ||
"divide a power of the factor\n"); | ||
} | ||
- for (i = 0, order = 1; i < args[2].value; i++) { | ||
+ for (i = 0, order = 1; i <= args[2].value + 1; i++) { | ||
if (order * args[0].value > order) { | ||
order *= args[0].value; | ||
continue; | ||
@@ -1511,7 +1511,7 @@ dt_compile_agg(d | ||
dnerror(dnp, D_LLQUANT_MAGTOO | ||
"factor (%d) raised to power of high magnitude " | ||
- "(%d) overflows 64-bits\n", args[0].value, | ||
+ "(%d) plus 1 overflows 64-bits\n", args[0].value, | ||
args[2].value); | ||
} | ||
@@ -963,7 +963,7 @@ dt_provmod_open( | ||
(void) snprintf(path, sizeof (path), "/dev/dtrace/%s" | ||
- if ((fd = open(path, O_RDONLY)) == -1) | ||
+ if ((fd = open(path, O_RDONLY | O_CLOEXEC)) == -1) | ||
continue; /* failed to open driver; just skip it */ | ||
if (((prov = malloc(sizeof (dt_provmod_t))) | ||
@@ -1100,7 +1100,7 @@ dt_vopen(int version, int flags, int *errp, | ||
*/ | ||
dt_provmod_open( | ||
- dtfd = open("/dev/dtrac | ||
+ dtfd = open("/dev/dtrac | ||
err = errno; /* save errno from opening dtfd */ | ||
#if defined(__FreeBS | ||
/* | ||
@@ -1109,14 +1109,14 @@ dt_vopen(int version, int flags, int *errp, | ||
*/ | ||
if (err == ENOENT && modfind("dtracea | ||
kldload("dtracea | ||
- dtfd = open("/dev/dtrac | ||
+ dtfd = open("/dev/dtrac | ||
err = errno; | ||
} | ||
#endif | ||
#ifdef illumos | ||
ftfd = open("/dev/dtrac | ||
#else | ||
- ftfd = open("/dev/dtrac | ||
+ ftfd = open("/dev/dtrac | ||
#endif | ||
fterr = ftfd == -1 ? errno : 0; /* save errno from open ftfd */ | ||
@@ -1146,9 +1146,6 @@ dt_vopen(int version, int flags, int *errp, | ||
return (set_open_errno( | ||
} | ||
- (void) fcntl(dtfd, F_SETFD, FD_CLOEXEC); | ||
- (void) fcntl(ftfd, F_SETFD, FD_CLOEXEC); | ||
- | ||
alloc: | ||
if ((dtp = malloc(sizeof (dtrace_hdl_t))) | ||
dt_provmod_destr |
@@ -28,6 +28,7 @@ | ||
* Copyright (c) 2013 Steven Hartland. All rights reserved. | ||
* Copyright (c) 2014 Integros [integros.com] | ||
* Copyright 2016 Nexenta Systems, Inc. | ||
+ * Copyright (c) 2017 Datto Inc. | ||
*/ | ||
#ifndef _LIBZFS_H | ||
@@ -129,6 +130,7 @@ typedef enum zfs_error { | ||
EZFS_DIFF, /* general failure of zfs diff */ | ||
EZFS_DIFFDATA, /* bad zfs diff data */ | ||
EZFS_POOLREADONL | ||
+ EZFS_SCRUB_PAUSE | ||
EZFS_UNKNOWN | ||
} zfs_error_t; | ||
@@ -241,7 +243,7 @@ typedef struct splitflags { | ||
/* | ||
* Functions to manipulate pool and vdev state | ||
*/ | ||
-extern int zpool_scan(zpool | ||
+extern int zpool_scan(zpool | ||
extern int zpool_clear(zpoo | ||
extern int zpool_reguid(zpo | ||
extern int zpool_reopen(zpo | ||
@@ -772,6 +774,7 @@ extern int zpool_in_use(lib | ||
* Label manipulation. | ||
*/ | ||
extern int zpool_read_label | ||
+extern int zpool_read_all_l | ||
extern int zpool_clear_labe | ||
/* is this zvol valid for use as a dump device? */ |
@@ -914,6 +914,65 @@ zpool_read_label | ||
return (0); | ||
} | ||
+/* | ||
+ * Given a file descriptor, read the label information and return an nvlist | ||
+ * describing the configuration, if there is one. | ||
+ * returns the number of valid labels found | ||
+ */ | ||
+int | ||
+zpool_read_all_ | ||
+{ | ||
+ struct stat64 statbuf; | ||
+ int l; | ||
+ vdev_label_t *label; | ||
+ uint64_t state, txg, size; | ||
+ int nlabels = 0; | ||
+ | ||
+ *config = NULL; | ||
+ | ||
+ if (fstat64(fd, &statbuf) == -1) | ||
+ return (0); | ||
+ size = P2ALIGN_TYPED(st | ||
+ | ||
+ if ((label = malloc(sizeof (vdev_label_t))) | ||
+ return (0); | ||
+ | ||
+ for (l = 0; l < VDEV_LABELS; l++) { | ||
+ nvlist_t *temp = NULL; | ||
+ | ||
+ /* TODO: use aio_read so we can read al 4 labels in parallel */ | ||
+ if (pread64(fd, label, sizeof (vdev_label_t), | ||
+ label_offset(siz | ||
+ continue; | ||
+ | ||
+ if (nvlist_unpack(l | ||
+ sizeof (label->vl_vdev_ | ||
+ continue; | ||
+ | ||
+ if (nvlist_lookup_u | ||
+ &state) != 0 || state > POOL_STATE_L2CAC | ||
+ nvlist_free(temp | ||
+ temp = NULL; | ||
+ continue; | ||
+ } | ||
+ | ||
+ if (state != POOL_STATE_SPARE | ||
+ (nvlist_lookup_u | ||
+ &txg) != 0 || txg == 0)) { | ||
+ nvlist_free(temp | ||
+ temp = NULL; | ||
+ continue; | ||
+ } | ||
+ if (temp) | ||
+ *config = temp; | ||
+ | ||
+ nlabels++; | ||
+ } | ||
+ | ||
+ free(label); | ||
+ return (nlabels); | ||
+} | ||
+ | ||
typedef struct rdsk_node { | ||
char *rn_name; | ||
int rn_dfd; |
@@ -20,9 +20,11 @@ | ||
*/ | ||
/* | ||
+ * Copyright 2015 Nexenta Systems, Inc. All rights reserved. | ||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. | ||
* Copyright (c) 2014 by Delphix. All rights reserved. | ||
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmai | ||
+ * Copyright 2017 RackTop Systems. | ||
*/ | ||
/* | ||
@@ -87,7 +89,7 @@ zfs_share_type_t | ||
zfs_share_proto_ | ||
/* | ||
- * The share protocols table must be in the same order as the zfs_share_prot_t | ||
+ * The share protocols table must be in the same order as the zfs_share_proto_ | ||
* enum in libzfs_impl.h | ||
*/ | ||
typedef struct { | ||
@@ -872,7 +874,7 @@ unshare_one(libz | ||
/* make sure libshare initialized */ | ||
if ((err = zfs_init_libshar | ||
free(mntpt); /* don't need the copy anymore */ | ||
- return (zfs_error_fmt(h | ||
+ return (zfs_error_fmt(h | ||
dgettext(TEXT_DO | ||
name, _sa_errorstr(err | ||
} | ||
@@ -883,12 +885,13 @@ unshare_one(libz | ||
if (share != NULL) { | ||
err = zfs_sa_disable_s | ||
if (err != SA_OK) { | ||
- return (zfs_error_fmt(h | ||
+ return (zfs_error_fmt(h | ||
+ proto_table[prot | ||
dgettext(TEXT_DO | ||
name, _sa_errorstr(err | ||
} | ||
} else { | ||
- return (zfs_error_fmt(h | ||
+ return (zfs_error_fmt(h | ||
dgettext(TEXT_DO | ||
name)); | ||
} |
@@ -25,6 +25,7 @@ | ||
* Copyright (c) 2013, Joyent, Inc. All rights reserved. | ||
* Copyright 2016 Nexenta Systems, Inc. | ||
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmai | ||
+ * Copyright (c) 2017 Datto Inc. | ||
*/ | ||
#include <sys/types.h> | ||
@@ -1841,22 +1842,39 @@ zpool_import_pro | ||
* Scan the pool. | ||
*/ | ||
int | ||
-zpool_scan(zpoo | ||
+zpool_scan(zpoo | ||
{ | ||
zfs_cmd_t zc = { 0 }; | ||
char msg[1024]; | ||
+ int err; | ||
libzfs_handle_t *hdl = zhp->zpool_hdl; | ||
(void) strlcpy(zc.zc_na | ||
zc.zc_cookie = func; | ||
+ zc.zc_flags = cmd; | ||
+ | ||
+ if (zfs_ioctl(hdl, ZFS_IOC_POOL_SCA | ||
+ return (0); | ||
+ | ||
+ err = errno; | ||
- if (zfs_ioctl(hdl, ZFS_IOC_POOL_SCA | ||
- (errno == ENOENT && func != POOL_SCAN_NONE)) | ||
+ /* ECANCELED on a scrub means we resumed a paused scrub */ | ||
+ if (err == ECANCELED && func == POOL_SCAN_SCRUB && | ||
+ cmd == POOL_SCRUB_NORMA | ||
+ return (0); | ||
+ | ||
+ if (err == ENOENT && func != POOL_SCAN_NONE && cmd == POOL_SCRUB_NORMA | ||
return (0); | ||
if (func == POOL_SCAN_SCRUB) | ||
- (void) snprintf(msg, sizeof (msg), | ||
- dgettext(TEXT_DO | ||
+ if (cmd == POOL_SCRUB_PAUSE | ||
+ (void) snprintf(msg, sizeof (msg), dgettext(TEXT_DO | ||
+ "cannot pause scrubbing %s"), zc.zc_name); | ||
+ } else { | ||
+ assert(cmd == POOL_SCRUB_NORMA | ||
+ (void) snprintf(msg, sizeof (msg), dgettext(TEXT_DO | ||
+ "cannot scrub %s"), zc.zc_name); | ||
+ } | ||
} else if (func == POOL_SCAN_NONE) { | ||
(void) snprintf(msg, sizeof (msg), | ||
dgettext(TEXT_DO | ||
@@ -1865,7 +1883,7 @@ zpool_scan(zpool | ||
assert(!"unexpec | ||
} | ||
- if (errno == EBUSY) { | ||
+ if (err == EBUSY) { | ||
nvlist_t *nvroot; | ||
pool_scan_stat_t | ||
uint_t psc; | ||
@@ -1874,14 +1892,18 @@ zpool_scan(zpool | ||
ZPOOL_CONFIG_VDE | ||
(void) nvlist_lookup_ui | ||
ZPOOL_CONFIG_SCA | ||
- if (ps && ps->pss_func == POOL_SCAN_SCRUB) | ||
- return (zfs_error(hdl, EZFS_SCRUBBING, msg)); | ||
- else | ||
+ if (ps && ps->pss_func == POOL_SCAN_SCRUB) | ||
+ if (cmd == POOL_SCRUB_PAUSE | ||
+ return (zfs_error(hdl, EZFS_SCRUB_PAUSE | ||
+ else | ||
+ return (zfs_error(hdl, EZFS_SCRUBBING, msg)); | ||
+ } else { | ||
return (zfs_error(hdl, EZFS_RESILVERING | ||
- } else if (errno == ENOENT) { | ||
+ } | ||
+ } else if (err == ENOENT) { | ||
return (zfs_error(hdl, EZFS_NO_SCRUB, msg)); | ||
} else { | ||
- return (zpool_standard_ | ||
+ return (zpool_standard_ | ||
} | ||
} | ||
@@ -24,6 +24,7 @@ | ||
* Copyright (c) 2013, Joyent, Inc. All rights reserved. | ||
* Copyright (c) 2011, 2015 by Delphix. All rights reserved. | ||
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmai | ||
+ * Copyright (c) 2017 Datto Inc. | ||
*/ | ||
/* | ||
@@ -224,6 +225,9 @@ libzfs_error_des | ||
case EZFS_POSTSPLIT_O | ||
return (dgettext(TEXT_D | ||
"into a new one")); | ||
+ case EZFS_SCRUB_PAUSE | ||
+ return (dgettext(TEXT_D | ||
+ "use 'zpool scrub' to resume")); | ||
case EZFS_SCRUBBING: | ||
return (dgettext(TEXT_D | ||
"use 'zpool scrub -s' to cancel current scrub")); |
@@ -735,11 +735,9 @@ static char ce_suffix[CE_IGN | ||
void | ||
vpanic(const char *fmt, va_list adx) | ||
{ | ||
- (void) fprintf(stderr, "error: "); | ||
- (void) vfprintf(stderr, | ||
- (void) fprintf(stderr, "\n"); | ||
- | ||
- abort(); /* think of it as a "user-level crash dump" */ | ||
+ char buf[512]; | ||
+ (void) vsnprintf(buf, 512, fmt, adx); | ||
+ assfail(buf, NULL, 0); | ||
} | ||
void |
@@ -54,6 +54,7 @@ DSRCS= errno.d \ | ||
siftr.d \ | ||
signal.d \ | ||
tcp.d \ | ||
+ socket.d \ | ||
udp.d \ | ||
unistd.d | ||
@@ -0,0 +1,301 @@ | ||
+/* | ||
+ * Copyright (c) 2017 George V. Neville-Neil | ||
+ * All rights reserved. | ||
+ * | ||
+ * Redistribution and use in source and binary forms, with or without | ||
+ * modification, are permitted provided that the following conditions | ||
+ * are met: | ||
+ * 1. Redistributions of source code must retain the above copyright | ||
+ * notice, this list of conditions and the following disclaimer. | ||
+ * 2. Redistributions in binary form must reproduce the above copyright | ||
+ * notice, this list of conditions and the following disclaimer in the | ||
+ * documentation and/or other materials provided with the distribution. | ||
+ * | ||
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | ||
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
+ * SUCH DAMAGE. | ||
+ * | ||
+ * $FreeBSD$ | ||
+ * | ||
+ * Translators and flags for the socket structure. FreeBSD specific code. | ||
+ */ | ||
+ | ||
+#pragma D depends_on module kernel | ||
+ | ||
+/* | ||
+ * Option flags per-socket. | ||
+ */ | ||
+#pragma D binding "1.13" SO_DEBUG | ||
+inline int SO_DEBUG = 0x0001; /* turn on debugging info recording */ | ||
+#pragma D binding "1.13" SO_ACCEPTCONN | ||
+inline int SO_ACCEPTCONN = 0x0002; /* socket has had listen() */ | ||
+#pragma D binding "1.13" SO_REUSEADDR | ||
+inline int SO_REUSEADDR = 0x0004; /* allow local address reuse */ | ||
+#pragma D binding "1.13" SO_KEEPALIVE | ||
+inline int SO_KEEPALIVE = 0x0008; /* keep connections alive */ | ||
+#pragma D binding "1.13" SO_DONTROUTE | ||
+inline int SO_DONTROUTE = 0x0010; /* just use interface addresses */ | ||
+#pragma D binding "1.13" SO_BROADCAST | ||
+inline int SO_BROADCAST = 0x0020; /* permit sending of broadcast msgs */ | ||
+#pragma D binding "1.13" SO_USELOOPBACK | ||
+inline int SO_USELOOPBACK = 0x0040; /* bypass hardware when possible */ | ||
+#pragma D binding "1.13" SO_LINGER | ||
+inline int SO_LINGER = 0x0080; /* linger on close if data present */ | ||
+#pragma D binding "1.13" SO_OOBINLINE | ||
+inline int SO_OOBINLINE = 0x0100; /* leave received OOB data in line */ | ||
+#pragma D binding "1.13" SO_REUSEPORT | ||
+inline int SO_REUSEPORT = 0x0200; /* allow local address & port reuse */ | ||
+#pragma D binding "1.13" SO_TIMESTAMP | ||
+inline int SO_TIMESTAMP = 0x0400; /* timestamp received dgram traffic */ | ||
+#pragma D binding "1.13" SO_NOSIGPIPE | ||
+inline int SO_NOSIGPIPE = 0x0800; /* no SIGPIPE from EPIPE */ | ||
+#pragma D binding "1.13" SO_ACCEPTFILTER | ||
+inline int SO_ACCEPTFILTER = 0x1000; /* there is an accept filter */ | ||
+#pragma D binding "1.13" SO_BINTIME | ||
+inline int SO_BINTIME = 0x2000; /* timestamp received dgram traffic */ | ||
+#pragma D binding "1.13" SO_NO_OFFLOAD | ||
+inline int SO_NO_OFFLOAD = 0x4000; /* socket cannot be offloaded */ | ||
+#pragma D binding "1.13" SO_NO_DDP | ||
+inline int SO_NO_DDP = 0x8000; /* disable direct data placement */ | ||
+ | ||
+/* | ||
+ * Additional options, not kept in so_options. | ||
+ */ | ||
+#pragma D binding "1.13" SO_SNDBUF | ||
+inline int SO_SNDBUF = 0x1001; /* send buffer size */ | ||
+#pragma D binding "1.13" SO_RCVBUF | ||
+inline int SO_RCVBUF = 0x1002; /* receive buffer size */ | ||
+#pragma D binding "1.13" SO_SNDLOWAT | ||
+inline int SO_SNDLOWAT = 0x1003; /* send low-water mark */ | ||
+#pragma D binding "1.13" SO_RCVLOWAT | ||
+inline int SO_RCVLOWAT = 0x1004; /* receive low-water mark */ | ||
+#pragma D binding "1.13" SO_SNDTIMEO | ||
+inline int SO_SNDTIMEO = 0x1005; /* send timeout */ | ||
+#pragma D binding "1.13" SO_RCVTIMEO | ||
+inline int SO_RCVTIMEO = 0x1006; /* receive timeout */ | ||
+#pragma D binding "1.13" SO_ERROR | ||
+inline int SO_ERROR = 0x1007; /* get error status and clear */ | ||
+#pragma D binding "1.13" SO_TYPE | ||
+inline int SO_TYPE = 0x1008; /* get socket type */ | ||
+#pragma D binding "1.13" SO_LABEL | ||
+inline int SO_LABEL = 0x1009; /* socket's MAC label */ | ||
+#pragma D binding "1.13" SO_PEERLABEL | ||
+inline int SO_PEERLABEL = 0x1010; /* socket's peer's MAC label */ | ||
+#pragma D binding "1.13" SO_LISTENQLIMIT | ||
+inline int SO_LISTENQLIMIT = 0x1011; /* socket's backlog limit */ | ||
+#pragma D binding "1.13" SO_LISTENQLEN | ||
+inline int SO_LISTENQLEN = 0x1012; /* socket's complete queue length */ | ||
+#pragma D binding "1.13" SO_LISTENINCQLEN | ||
+inline int SO_LISTENINCQLEN | ||
+#pragma D binding "1.13" SO_SETFIB | ||
+inline int SO_SETFIB = 0x1014; /* use this FIB to route */ | ||
+#pragma D binding "1.13" SO_USER_COOKIE | ||
+inline int SO_USER_COOKIE = 0x1015; /* user cookie (dummynet etc.) */ | ||
+#pragma D binding "1.13" SO_PROTOCOL | ||
+inline int SO_PROTOCOL = 0x1016; /* get socket protocol (Linux name) */ | ||
+#pragma D binding "1.13" SO_PROTOTYPE | ||
+inline int SO_PROTOTYPE = SO_PROTOCOL; /* alias for SO_PROTOCOL (SunOS name) */ | ||
+#pragma D binding "1.13" SO_TS_CLOCK | ||
+inline int SO_TS_CLOCK = 0x1017; /* clock type used for SO_TIMESTAMP */ | ||
+#pragma D binding "1.13" SO_MAX_PACING_RA | ||
+inline int SO_MAX_PACING_RA | ||
+ | ||
+#pragma D binding "1.13" SO_TS_REALTIME_M | ||
+inline int SO_TS_REALTIME_M | ||
+#pragma D binding "1.13" SO_TS_BINTIME | ||
+inline int SO_TS_BINTIME = 1; /* sub-nanosecond resolution, realtime */ | ||
+#pragma D binding "1.13" SO_TS_REALTIME | ||
+inline int SO_TS_REALTIME = 2; /* nanosecond resolution, realtime */ | ||
+#pragma D binding "1.13" SO_TS_MONOTONIC | ||
+inline int SO_TS_MONOTONIC = 3; /* nanosecond resolution, monotonic */ | ||
+#pragma D binding "1.13" SO_TS_DEFAULT | ||
+inline int SO_TS_DEFAULT = SO_TS_REALTIME_M | ||
+#pragma D binding "1.13" SO_TS_CLOCK_MAX | ||
+inline int SO_TS_CLOCK_MAX = SO_TS_MONOTONIC; | ||
+ | ||
+#pragma D binding "1.13" AF_UNSPEC | ||
+inline int AF_UNSPEC = 0; /* unspecified */ | ||
+#pragma D binding "1.13" AF_UNIX | ||
+inline int AF_UNIX = 1; /* standardized name for AF_LOCAL */ | ||
+#pragma D binding "1.13" AF_LOCAL | ||
+inline int AF_LOCAL = AF_UNIX; /* local to host (pipes, portals) */ | ||
+#pragma D binding "1.13" AF_INET | ||
+inline int AF_INET = 2; /* internetwork: UDP, TCP, etc. */ | ||
+#pragma D binding "1.13" AF_IMPLINK | ||
+inline int AF_IMPLINK = 3; /* arpanet imp addresses */ | ||
+#pragma D binding "1.13" AF_PUP | ||
+inline int AF_PUP = 4; /* pup protocols: e.g. BSP */ | ||
+#pragma D binding "1.13" AF_CHAOS | ||
+inline int AF_CHAOS = 5; /* mit CHAOS protocols */ | ||
+#pragma D binding "1.13" AF_NETBIOS | ||
+inline int AF_NETBIOS = 6; /* SMB protocols */ | ||
+#pragma D binding "1.13" AF_ISO | ||
+inline int AF_ISO = 7; /* ISO protocols */ | ||
+#pragma D binding "1.13" AF_OSI | ||
+inline int AF_OSI = AF_ISO; | ||
+#pragma D binding "1.13" AF_ECMA | ||
+inline int AF_ECMA = 8; /* European computer manufacturers */ | ||
+#pragma D binding "1.13" AF_DATAKIT | ||
+inline int AF_DATAKIT = 9; /* datakit protocols */ | ||
+#pragma D binding "1.13" AF_CCITT | ||
+inline int AF_CCITT = 10; /* CCITT protocols, X.25 etc */ | ||
+#pragma D binding "1.13" AF_SNA | ||
+inline int AF_SNA = 11; /* IBM SNA */ | ||
+#pragma D binding "1.13" AF_DECnet | ||
+inline int AF_DECnet = 12; /* DECnet */ | ||
+#pragma D binding "1.13" AF_DLI | ||
+inline int AF_DLI = 13; /* DEC Direct data link interface */ | ||
+#pragma D binding "1.13" AF_LAT | ||
+inline int AF_LAT = 14; /* LAT */ | ||
+#pragma D binding "1.13" AF_HYLINK | ||
+inline int AF_HYLINK = 15; /* NSC Hyperchannel */ | ||
+#pragma D binding "1.13" AF_APPLETALK | ||
+inline int AF_APPLETALK = 16; /* Apple Talk */ | ||
+#pragma D binding "1.13" AF_ROUTE | ||
+inline int AF_ROUTE = 17; /* Internal Routing Protocol */ | ||
+#pragma D binding "1.13" AF_LINK | ||
+inline int AF_LINK = 18; /* Link layer interface */ | ||
+#pragma D binding "1.13" pseudo_AF_XTP | ||
+inline int pseudo_AF_XTP = 19; /* eXpress Transfer Protocol (no AF) */ | ||
+#pragma D binding "1.13" AF_COIP | ||
+inline int AF_COIP = 20; /* connection-orien | ||
+#pragma D binding "1.13" AF_CNT | ||
+inline int AF_CNT = 21; /* Computer Network Technology */ | ||
+#pragma D binding "1.13" pseudo_AF_RTIP | ||
+inline int pseudo_AF_RTIP = 22; /* Help Identify RTIP packets */ | ||
+#pragma D binding "1.13" AF_IPX | ||
+inline int AF_IPX = 23; /* Novell Internet Protocol */ | ||
+#pragma D binding "1.13" AF_SIP | ||
+inline int AF_SIP = 24; /* Simple Internet Protocol */ | ||
+#pragma D binding "1.13" pseudo_AF_PIP | ||
+inline int pseudo_AF_PIP = 25; /* Help Identify PIP packets */ | ||
+#pragma D binding "1.13" AF_ISDN | ||
+inline int AF_ISDN = 26; /* Integrated Services Digital Network*/ | ||
+#pragma D binding "1.13" AF_E164 | ||
+inline int AF_E164 = AF_ISDN; /* CCITT E.164 recommendation */ | ||
+#pragma D binding "1.13" pseudo_AF_KEY | ||
+inline int pseudo_AF_KEY = 27; /* Internal key-management function */ | ||
+#pragma D binding "1.13" AF_INET6 | ||
+inline int AF_INET6 = 28; /* IPv6 */ | ||
+#pragma D binding "1.13" AF_NATM | ||
+inline int AF_NATM = 29; /* native ATM access */ | ||
+#pragma D binding "1.13" AF_ATM | ||
+inline int AF_ATM = 30; /* ATM */ | ||
+#pragma D binding "1.13" pseudo_AF_HDRCMP | ||
+inline int pseudo_AF_HDRCMP | ||
+ * in interface output routine | ||
+ */ | ||
+#pragma D binding "1.13" AF_NETGRAPH | ||
+inline int AF_NETGRAPH = 32; /* Netgraph sockets */ | ||
+#pragma D binding "1.13" AF_SLOW | ||
+inline int AF_SLOW = 33; /* 802.3ad slow protocol */ | ||
+#pragma D binding "1.13" AF_SCLUSTER | ||
+inline int AF_SCLUSTER = 34; /* Sitara cluster protocol */ | ||
+#pragma D binding "1.13" AF_ARP | ||
+inline int AF_ARP = 35; /* Address Resolution Protocol */ | ||
+#pragma D binding "1.13" AF_BLUETOOTH | ||
+inline int AF_BLUETOOTH = 36; /* Bluetooth sockets */ | ||
+#pragma D binding "1.13" AF_IEEE80211 | ||
+inline int AF_IEEE80211 = 37; /* IEEE 802.11 protocol */ | ||
+#pragma D binding "1.13" AF_INET_SDP | ||
+inline int AF_INET_SDP = 40; /* OFED Socket Direct Protocol ipv4 */ | ||
+#pragma D binding "1.13" AF_INET6_SDP | ||
+inline int AF_INET6_SDP = 42; /* OFED Socket Direct Protocol ipv6 */ | ||
+#pragma D binding "1.13" AF_MAX | ||
+inline int AF_MAX = 42; | ||
+ | ||
+/* | ||
+ * Protocol families, same as address families for now. | ||
+ */ | ||
+#pragma D binding "1.13" PF_UNSPEC | ||
+inline int PF_UNSPEC = AF_UNSPEC; | ||
+#pragma D binding "1.13" PF_LOCAL | ||
+inline int PF_LOCAL = AF_LOCAL; | ||
+#pragma D binding "1.13" PF_UNIX | ||
+inline int PF_UNIX = PF_LOCAL; /* backward compatibility */ | ||
+#pragma D binding "1.13" PF_INET | ||
+inline int PF_INET = AF_INET; | ||
+#pragma D binding "1.13" PF_IMPLINK | ||
+inline int PF_IMPLINK = AF_IMPLINK; | ||
+#pragma D binding "1.13" PF_PUP | ||
+inline int PF_PUP = AF_PUP; | ||
+#pragma D binding "1.13" PF_CHAOS | ||
+inline int PF_CHAOS = AF_CHAOS; | ||
+#pragma D binding "1.13" PF_NETBIOS | ||
+inline int PF_NETBIOS = AF_NETBIOS; | ||
+#pragma D binding "1.13" PF_ISO | ||
+inline int PF_ISO = AF_ISO; | ||
+#pragma D binding "1.13" PF_OSI | ||
+inline int PF_OSI = AF_ISO; | ||
+#pragma D binding "1.13" PF_ECMA | ||
+inline int PF_ECMA = AF_ECMA; | ||
+#pragma D binding "1.13" PF_DATAKIT | ||
+inline int PF_DATAKIT = AF_DATAKIT; | ||
+#pragma D binding "1.13" PF_CCITT | ||
+inline int PF_CCITT = AF_CCITT; | ||
+#pragma D binding "1.13" PF_SNA | ||
+inline int PF_SNA = AF_SNA; | ||
+#pragma D binding "1.13" PF_DECnet | ||
+inline int PF_DECnet = AF_DECnet; | ||
+#pragma D binding "1.13" PF_DLI | ||
+inline int PF_DLI = AF_DLI; | ||
+#pragma D binding "1.13" PF_LAT | ||
+inline int PF_LAT = AF_LAT; | ||
+#pragma D binding "1.13" PF_HYLINK | ||
+inline int PF_HYLINK = AF_HYLINK; | ||
+#pragma D binding "1.13" PF_APPLETALK | ||
+inline int PF_APPLETALK = AF_APPLETALK; | ||
+#pragma D binding "1.13" PF_ROUTE | ||
+inline int PF_ROUTE = AF_ROUTE; | ||
+#pragma D binding "1.13" PF_LINK | ||
+inline int PF_LINK = AF_LINK; | ||
+#pragma D binding "1.13" PF_XTP | ||
+inline int PF_XTP = pseudo_AF_XTP; /* really just proto family, no AF */ | ||
+#pragma D binding "1.13" PF_COIP | ||
+inline int PF_COIP = AF_COIP; | ||
+#pragma D binding "1.13" PF_CNT | ||
+inline int PF_CNT = AF_CNT; | ||
+#pragma D binding "1.13" PF_SIP | ||
+inline int PF_SIP = AF_SIP; | ||
+#pragma D binding "1.13" PF_IPX | ||
+inline int PF_IPX = AF_IPX; | ||
+#pragma D binding "1.13" PF_RTIP | ||
+inline int PF_RTIP = pseudo_AF_RTIP; /* same format as AF_INET */ | ||
+#pragma D binding "1.13" PF_PIP | ||
+inline int PF_PIP = pseudo_AF_PIP; | ||
+#pragma D binding "1.13" PF_ISDN | ||
+inline int PF_ISDN = AF_ISDN; | ||
+#pragma D binding "1.13" PF_KEY | ||
+inline int PF_KEY = pseudo_AF_KEY; | ||
+#pragma D binding "1.13" PF_INET6 | ||
+inline int PF_INET6 = AF_INET6; | ||
+#pragma D binding "1.13" PF_NATM | ||
+inline int PF_NATM = AF_NATM; | ||
+#pragma D binding "1.13" PF_ATM | ||
+inline int PF_ATM = AF_ATM; | ||
+#pragma D binding "1.13" PF_NETGRAPH | ||
+inline int PF_NETGRAPH = AF_NETGRAPH; | ||
+#pragma D binding "1.13" PF_SLOW | ||
+inline int PF_SLOW = AF_SLOW; | ||
+#pragma D binding "1.13" PF_SCLUSTER | ||
+inline int PF_SCLUSTER = AF_SCLUSTER; | ||
+#pragma D binding "1.13" PF_ARP | ||
+inline int PF_ARP = AF_ARP; | ||
+#pragma D binding "1.13" PF_BLUETOOTH | ||
+inline int PF_BLUETOOTH = AF_BLUETOOTH; | ||
+#pragma D binding "1.13" PF_IEEE80211 | ||
+inline int PF_IEEE80211 = AF_IEEE80211; | ||
+#pragma D binding "1.13" PF_INET_SDP | ||
+inline int PF_INET_SDP= AF_INET_SDP; | ||
+#pragma D binding "1.13" PF_INET6_SDP | ||
+inline int PF_INET6_SDP= AF_INET6_SDP; | ||
+#pragma D binding "1.13" PF_MAX | ||
+inline int PF_MAX = AF_MAX; |
@@ -26,7 +26,7 @@ ATOMIC_SRCS= opensolaris_atom | ||
LIB= zpool | ||
-ZFS_COMMON_SRCS | ||
+ZFS_COMMON_SRCS | ||
ZFS_SHARED_SRCS= | ||
KERNEL_SRCS= kernel.c taskq.c util.c | ||
LIST_SRCS= list.c |
@@ -22,6 +22,7 @@ ${PACKAGE}FILES= | ||
err.D_LLQUANT_LO | ||
err.D_LLQUANT_MA | ||
err.D_LLQUANT_MA | ||
+ err.D_LLQUANT_MA | ||
err.D_LLQUANT_NS | ||
err.D_LLQUANT_NS | ||
err.D_LLQUANT_NS |
@@ -36,6 +36,7 @@ | ||
#include <sys/cdefs.h> | ||
#include <sys/time.h> | ||
#include <sys/fs/zfs.h> | ||
+#include <sys/vdev_impl.h | ||
#include <syslog.h> | ||
@@ -93,6 +94,7 @@ DevfsEvent::Read | ||
pool_state_t poolState; | ||
char *poolName; | ||
boolean_t b_inuse; | ||
+ int nlabels; | ||
inUse = false; | ||
degraded = false; | ||
@@ -105,8 +107,16 @@ DevfsEvent::Read | ||
if (poolName != NULL) | ||
free(poolName); | ||
- if (zpool_read_labe | ||
- || devLabel == NULL) | ||
+ nlabels = zpool_read_all_l | ||
+ /* | ||
+ * If we find a disk with fewer than the maximum number of | ||
+ * labels, it might be the whole disk of a partitioned disk | ||
+ * where ZFS resides on a partition. In that case, we should do | ||
+ * nothing and wait for the partition to appear. Or, the disk | ||
+ * might be damaged. In that case, zfsd should do nothing and | ||
+ * wait for the sysadmin to decide. | ||
+ */ | ||
+ if (nlabels != VDEV_LABELS || devLabel == NULL) | ||
return (NULL); | ||
try { |
@@ -1302,7 +1302,7 @@ static const unsigned char twobyte_uses_REP | ||
/* 70 */ 1,0,0,0,0,0,0,0, | ||
/* 80 */ 0,0,0,0,0,0,0,0, | ||
/* 90 */ 0,0,0,0,0,0,0,0, | ||
- /* a0 */ 0,0,0,0,0,0,0,0, | ||
+ /* a0 */ 0,0,0,0,0,0,0,0, | ||
/* b0 */ 0,0,0,0,0,0,0,0, | ||
/* c0 */ 0,0,1,0,0,0,0,0, | ||
/* d0 */ 0,0,0,0,0,0,1,0, | ||
@@ -1793,10 +1793,10 @@ static const struct dis386 grps[][8] = { | ||
}, | ||
/* GRP15 */ | ||
{ | ||
- { "fxsave", { Ev } }, | ||
- { "fxrstor", { Ev } }, | ||
- { "ldmxcsr", { Ev } }, | ||
- { "stmxcsr", { Ev } }, | ||
+ { "fxsave", { { OP_0fae, v_mode } } }, | ||
+ { "fxrstor", { { OP_0fae, v_mode } } }, | ||
+ { "ldmxcsr", { { OP_0fae, v_mode } } }, | ||
+ { "stmxcsr", { { OP_0fae, v_mode } } }, | ||
{ "xsave", { Ev } }, | ||
{ "xrstor", { { OP_0fae, v_mode } } }, | ||
{ "xsaveopt", { { OP_0fae, v_mode } } }, | ||
@@ -5997,19 +5997,34 @@ OP_0fae (int bytemode, int sizeflag) | ||
{ | ||
if (modrm.mod == 3) | ||
{ | ||
- if (modrm.reg == 7) | ||
- strcpy (obuf + strlen (obuf) - sizeof ("clflush") + 1, "sfence"); | ||
- else if (modrm.reg == 6) | ||
- strcpy (obuf + strlen (obuf) - sizeof ("xsaveopt") + 1, "mfence"); | ||
- else if (modrm.reg == 5) | ||
- strcpy (obuf + strlen (obuf) - sizeof ("xrstor") + 1, "lfence"); | ||
- | ||
- if (modrm.reg < 5 || modrm.rm != 0) | ||
+ if (modrm.reg >= 5 && modrm.reg <= 7 && modrm.rm == 0) | ||
+ { | ||
+ if (modrm.reg == 7) | ||
+ strcpy (obuf + strlen (obuf) - sizeof ("clflush") + 1, "sfence"); | ||
+ else if (modrm.reg == 6) | ||
+ strcpy (obuf + strlen (obuf) - sizeof ("xsaveopt") + 1, "mfence"); | ||
+ else if (modrm.reg == 5) | ||
+ strcpy (obuf + strlen (obuf) - sizeof ("xrstor") + 1, "lfence"); | ||
+ bytemode = 0; | ||
+ } | ||
+ else if (modrm.reg <= 3 && (prefixes & PREFIX_REPZ) != 0) | ||
+ { | ||
+ if (modrm.reg == 0) | ||
+ strcpy (obuf + strlen (obuf) - sizeof ("fxsave") + 1, "rdfsbase"); | ||
+ else if (modrm.reg == 1) | ||
+ strcpy (obuf + strlen (obuf) - sizeof ("fxrstor") + 1, "rdgsbase"); | ||
+ else if (modrm.reg == 2) | ||
+ strcpy (obuf + strlen (obuf) - sizeof ("ldmxcsr") + 1, "wrfsbase"); | ||
+ else if (modrm.reg == 3) | ||
+ strcpy (obuf + strlen (obuf) - sizeof ("stmxcsr") + 1, "wrgsbase"); | ||
+ used_prefixes |= PREFIX_REPZ; | ||
+ bytemode = dq_mode; | ||
+ } | ||
+ else | ||
{ | ||
- BadOp (); /* bad sfence, mfence, or lfence */ | ||
+ BadOp (); | ||
return; | ||
} | ||
- bytemode = 0; | ||
} | ||
OP_E (bytemode, sizeflag); |
@@ -81,6 +81,7 @@ typedef struct template | ||
#define CpuPCLMUL 0x10000000 /* Carry-less Multiplication extensions */ | ||
#define CpuRdRnd 0x20000000 /* Intel Random Number Generator extensions */ | ||
#define CpuSMAP 0x40000000 /* Intel Supervisor Mode Access Prevention */ | ||
+#define CpuFSGSBase 0x80000000 /* Read/write fs/gs segment base registers */ | ||
/* SSE4.1/4.2 Instructions required */ | ||
#define CpuSSE4 (CpuSSE4_1|CpuSS | ||
@@ -89,7 +90,8 @@ typedef struct template | ||
#define CpuUnknownFlags (Cpu186|Cpu286|C | ||
|CpuP4|CpuSledge | ||
|Cpu3dnow|Cpu3dn | ||
- |CpuSSE4_2|CpuAB | ||
+ |CpuSSE4_2|CpuAB | ||
+ |CpuFSGSBase) | ||
/* the bits in opcode_modifier are used to generate the final opcode from | ||
the base_opcode. These bits also are used to detect alternate forms of |
@@ -1525,3 +1525,13 @@ pclmulhqhqdq, 2, 0x660f3a44, 0x11, CpuPCLMUL, Modrm|IgnoreSize | ||
// Intel Random Number Generator extensions | ||
rdrand, 1, 0x0fc7, 0x6, CpuRdRnd, Modrm|No_bSuf|No | ||
rdseed, 1, 0x0fc7, 0x7, CpuRdRnd, Modrm|No_bSuf|No | ||
+ | ||
+// Intel Supervisor Mode Access Prevention extensions | ||
+clac, 0, 0x0f01, 0xca, CpuSMAP, NoSuf|ImmExt, { 0 } | ||
+stac, 0, 0x0f01, 0xcb, CpuSMAP, NoSuf|ImmExt, { 0 } | ||
+ | ||
+// Read/write fs/gs segment base registers | ||
+rdfsbase, 1, 0xf30fae, 0x0, CpuFSGSBase|Cpu6 | ||
+rdgsbase, 1, 0xf30fae, 0x1, CpuFSGSBase|Cpu6 | ||
+wrfsbase, 1, 0xf30fae, 0x2, CpuFSGSBase|Cpu6 | ||
+wrgsbase, 1, 0xf30fae, 0x3, CpuFSGSBase|Cpu6 |
@@ -4400,6 +4400,20 @@ const template i386_optab[] = | ||
NoSuf|ImmExt, { 0, 0, 0 } }, | ||
{"stac", 0, 0x0f01, 0xcb, CpuSMAP, | ||
NoSuf|ImmExt, { 0, 0, 0 } }, | ||
+ | ||
+ /* Read/write fs/gs segment base registers */ | ||
+ {"rdfsbase", 1, 0xf30fae, 0x0, CpuFSGSBase|Cpu6 | ||
+ Modrm|No_bSuf|No | ||
+ { Reg32|Reg64 } }, | ||
+ {"rdgsbase", 1, 0xf30fae, 0x1, CpuFSGSBase|Cpu6 | ||
+ Modrm|No_bSuf|No | ||
+ { Reg32|Reg64 } }, | ||
+ {"wrfsbase", 1, 0xf30fae, 0x2, CpuFSGSBase|Cpu6 | ||
+ Modrm|No_bSuf|No | ||
+ { Reg32|Reg64 } }, | ||
+ {"wrgsbase", 1, 0xf30fae, 0x3, CpuFSGSBase|Cpu6 | ||
+ Modrm|No_bSuf|No | ||
+ { Reg32|Reg64 } }, | ||
{ NULL, 0, 0, 0, 0, 0, { 0 } } | ||
}; |
@@ -18,11 +18,20 @@ | ||
// } | ||
// } | ||
+#if defined(COMPILER | ||
+# define CONVERT_DCMP_ARG | ||
+ vmov d0, r0, r1 SEPARATOR \ | ||
+ vmov d1, r2, r3 | ||
+#else | ||
+# define CONVERT_DCMP_ARG | ||
+#endif | ||
+ | ||
#define DEFINE_AEABI_DCM | ||
.syntax unified SEPARATOR \ | ||
.p2align 2 SEPARATOR \ | ||
DEFINE_COMPILERR | ||
push { r4, lr } SEPARATOR \ | ||
+ CONVERT_DCMP_ARG | ||
bl SYMBOL_NAME(__ ## cond ## df2) SEPARATOR \ | ||
cmp r0, #0 SEPARATOR \ | ||
b ## cond 1f SEPARATOR \ |
@@ -18,11 +18,20 @@ | ||
// } | ||
// } | ||
+#if defined(COMPILER | ||
+# define CONVERT_FCMP_ARG | ||
+ vmov s0, r0 SEPARATOR \ | ||
+ vmov s1, r1 | ||
+#else | ||
+# define CONVERT_FCMP_ARG | ||
+#endif | ||
+ | ||
#define DEFINE_AEABI_FCM | ||
.syntax unified SEPARATOR \ | ||
.p2align 2 SEPARATOR \ | ||
DEFINE_COMPILERR | ||
push { r4, lr } SEPARATOR \ | ||
+ CONVERT_FCMP_ARG | ||
bl SYMBOL_NAME(__ ## cond ## sf2) SEPARATOR \ | ||
cmp r0, #0 SEPARATOR \ | ||
b ## cond 1f SEPARATOR \ |
@@ -92,12 +92,13 @@ | ||
* does not have dedicated bit counting instructions. | ||
*/ | ||
#if defined(__FreeBS | ||
- defined(__mips_n | ||
+ defined(__mips_n | ||
+ defined(__riscv) | ||
si_int __clzsi2(si_int) | ||
si_int __ctzsi2(si_int) | ||
#define __builtin_clz __clzsi2 | ||
#define __builtin_ctz __ctzsi2 | ||
-#endif /* FreeBSD && (sparc64 || mips_n64 || mips_o64) */ | ||
+#endif /* FreeBSD && (sparc64 || mips_n32 || mips_n64 || mips_o64 || riscv) */ | ||
COMPILER_RT_ABI si_int __paritysi2(si_i | ||
COMPILER_RT_ABI si_int __paritydi2(di_i |
@@ -70,7 +70,7 @@ int SidelineThread:: | ||
// Set up a signal handler on an alternate stack for safety. | ||
InternalScopedBu | ||
- struct sigaltstack SigAltStack; | ||
+ stack_t SigAltStack; | ||
SigAltStack.ss_s | ||
SigAltStack.ss_s | ||
SigAltStack.ss_f |
@@ -1,11 +1,11 @@ | ||
-//===- InstrProfilingNa | ||
-// | ||
-// The LLVM Compiler Infrastructure | ||
-// | ||
-// This file is distributed under the University of Illinois Open Source | ||
-// License. See LICENSE.TXT for details. | ||
-// | ||
-//===---------- | ||
+/*===- InstrProfilingNa | ||
+|* | ||
+|* The LLVM Compiler Infrastructure | ||
+|* | ||
+|* This file is distributed under the University of Illinois Open Source | ||
+|* License. See LICENSE.TXT for details. | ||
+|* | ||
+\*===---------- | ||
#include "InstrProfiling. | ||
@@ -77,8 +77,8 @@ | ||
#define D_h x13 | ||
#define E_l src | ||
#define E_h count | ||
-#define F_l srcend | ||
-#define F_h dst | ||
+#define F_l dst | ||
+#define F_h srcend | ||
#define tmp1 x9 | ||
#define L(l) .L ## l |
@@ -509,7 +509,7 @@ do_bid_note(stru | ||
size_t noff, size_t doff, int *flags) | ||
{ | ||
if (namesz == 4 && strcmp((char *)&nbuf[noff], "GNU") == 0 && | ||
- type == NT_GNU_BUILD_ID && (descsz >= 4 || descsz <= 20)) { | ||
+ type == NT_GNU_BUILD_ID && (descsz >= 4 && descsz <= 20)) { | ||
uint8_t desc[20]; | ||
const char *btype; | ||
uint32_t i; |
@@ -85,7 +85,10 @@ namespace ISD { | ||
/// If N is a BUILD_VECTOR node whose elements are all the same constant or | ||
/// undefined, return true and return the constant value in \p SplatValue. | ||
- bool isConstantSplatV | ||
+ /// This sets \p SplatValue to the smallest possible splat unless AllowShrink | ||
+ /// is set to false. | ||
+ bool isConstantSplatV | ||
+ bool AllowShrink = true); | ||
/// Return true if the specified node is a BUILD_VECTOR where all of the | ||
/// elements are ~0 or undef. | ||
@@ -798,7 +801,8 @@ public: | ||
/// if DAG changes. | ||
static bool hasPredecessorHe | ||
SmallPtrSetImpl< | ||
- SmallVectorImpl< | ||
+ SmallVectorImpl< | ||
+ unsigned int MaxSteps = 0) { | ||
if (Visited.count(N | ||
return true; | ||
while (!Worklist.empty | ||
@@ -813,6 +817,8 @@ public: | ||
} | ||
if (Found) | ||
return true; | ||
+ if (MaxSteps != 0 && Visited.size() >= MaxSteps) | ||
+ return false; | ||
} | ||
return false; | ||
} |
@@ -23,8 +23,6 @@ using namespace llvm; | ||
#define DEBUG_TYPE "postdomtree" | ||
-template class llvm::DominatorT | ||
- | ||
//===----------- | ||
// PostDominatorTre | ||
//===----------- |
@@ -1118,22 +1118,30 @@ SDValue DAGCombiner::Pro | ||
SDValue RV = | ||
DAG.getNode(ISD: | ||
- // New replace instances of N0 and N1 | ||
- if (Replace0 && N0 && N0.getOpcode() != ISD::DELETED_NOD | ||
- NN0.getOpcode() != ISD::DELETED_NOD | ||
+ // We are always replacing N0/N1's use in N and only need | ||
+ // additional replacements if there are additional uses. | ||
+ Replace0 &= !N0->hasOneUse() | ||
+ Replace1 &= (N0 != N1) && !N1->hasOneUse() | ||
+ | ||
+ // Combine Op here so it is presreved past replacements. | ||
+ CombineTo(Op.get | ||
+ | ||
+ // If operands have a use ordering, make sur we deal with | ||
+ // predecessor first. | ||
+ if (Replace0 && Replace1 && N0.getNode()->is | ||
+ std::swap(N0, N1); | ||
+ std::swap(NN0, NN1); | ||
+ } | ||
+ | ||
+ if (Replace0) { | ||
AddToWorklist(NN | ||
ReplaceLoadWithP | ||
} | ||
- | ||
- if (Replace1 && N1 && N1.getOpcode() != ISD::DELETED_NOD | ||
- NN1.getOpcode() != ISD::DELETED_NOD | ||
+ if (Replace1) { | ||
AddToWorklist(NN | ||
ReplaceLoadWithP | ||
} | ||
- | ||
- // Deal with Op being deleted. | ||
- if (Op && Op.getOpcode() != ISD::DELETED_NOD | ||
- return RV; | ||
+ return Op; | ||
} | ||
return SDValue(); | ||
} | ||
@@ -12599,25 +12607,37 @@ void DAGCombiner::get | ||
} | ||
} | ||
-// We need to check that merging these stores does not cause a loop | ||
-// in the DAG. Any store candidate may depend on another candidate | ||
+// We need to check that merging these stores does not cause a loop in | ||
+// the DAG. Any store candidate may depend on another candidate | ||
// indirectly through its operand (we already consider dependencies | ||
// through the chain). Check in parallel by searching up from | ||
// non-chain operands of candidates. | ||
+ | ||
bool DAGCombiner::che | ||
SmallVectorImpl< | ||
+ | ||
+ // FIXME: We should be able to truncate a full search of | ||
+ // predecessors by doing a BFS and keeping tabs the originating | ||
+ // stores from which worklist nodes come from in a similar way to | ||
+ // TokenFactor simplfication. | ||
+ | ||
SmallPtrSet<cons | ||
SmallVector<cons | ||
- // search ops of store candidates | ||
+ unsigned int Max = 8192; | ||
+ // Search Ops of store candidates. | ||
for (unsigned i = 0; i < NumStores; ++i) { | ||
SDNode *n = StoreNodes[i].Me | ||
// Potential loops may happen only through non-chain operands | ||
for (unsigned j = 1; j < n->getNumOperand | ||
Worklist.push_ba | ||
} | ||
- // search through DAG. We can stop early if we find a storenode | ||
+ // Search through DAG. We can stop early if we find a store node. | ||
for (unsigned i = 0; i < NumStores; ++i) { | ||
- if (SDNode::hasPred | ||
+ if (SDNode::hasPred | ||
+ Max)) | ||
+ return false; | ||
+ // Check if we ended early, failing conservatively if so. | ||
+ if (Visited.size() >= Max) | ||
return false; | ||
} | ||
return true; |
@@ -627,6 +627,7 @@ private: | ||
SDValue ScalarizeVecOp_C | ||
SDValue ScalarizeVecOp_E | ||
SDValue ScalarizeVecOp_V | ||
+ SDValue ScalarizeVecOp_V | ||
SDValue ScalarizeVecOp_S | ||
SDValue ScalarizeVecOp_F | ||
@@ -484,6 +484,9 @@ bool DAGTypeLegalizer | ||
case ISD::VSELECT: | ||
Res = ScalarizeVecOp_V | ||
break; | ||
+ case ISD::SETCC: | ||
+ Res = ScalarizeVecOp_V | ||
+ break; | ||
case ISD::STORE: | ||
Res = ScalarizeVecOp_S | ||
break; | ||
@@ -560,6 +563,36 @@ SDValue DAGTypeLegalizer | ||
N->getOperand(2) | ||
} | ||
+/// If the operand is a vector that needs to be scalarized then the | ||
+/// result must be v1i1, so just convert to a scalar SETCC and wrap | ||
+/// with a scalar_to_vector | ||
+SDValue DAGTypeLegalizer | ||
+ assert(N->getVal | ||
+ N->getOperand(0) | ||
+ "Operand types must be vectors"); | ||
+ assert(N->getVal | ||
+ | ||
+ EVT VT = N->getValueType( | ||
+ SDValue LHS = GetScalarizedVec | ||
+ SDValue RHS = GetScalarizedVec | ||
+ | ||
+ EVT OpVT = N->getOperand(0) | ||
+ EVT NVT = VT.getVectorElem | ||
+ SDLoc DL(N); | ||
+ // Turn it into a scalar SETCC. | ||
+ SDValue Res = DAG.getNode(ISD: | ||
+ N->getOperand(2) | ||
+ | ||
+ // Vectors may have a different boolean contents to scalars. Promote the | ||
+ // value appropriately. | ||
+ ISD::NodeType ExtendCode = | ||
+ TargetLowering:: | ||
+ | ||
+ Res = DAG.getNode(Exte | ||
+ | ||
+ return DAG.getNode(ISD: | ||
+} | ||
+ | ||
/// If the value to store is a vector that needs to be scalarized, it must be | ||
/// <1 x ty>. Just store the element. | ||
SDValue DAGTypeLegalizer |
@@ -116,7 +116,8 @@ bool ConstantFPSDNode | ||
// ISD Namespace | ||
//===----------- | ||
-bool ISD::isConstantS | ||
+bool ISD::isConstantS | ||
+ bool AllowShrink) { | ||
auto *BV = dyn_cast<BuildVe | ||
if (!BV) | ||
return false; | ||
@@ -124,9 +125,11 @@ bool ISD::isConstantS | ||
APInt SplatUndef; | ||
unsigned SplatBitSize; | ||
bool HasUndefs; | ||
- EVT EltVT = N->getValueType( | ||
- return BV->isConstantSp | ||
- EltVT.getSizeInB | ||
+ unsigned EltSize = N->getValueType( | ||
+ unsigned MinSplatBits = AllowShrink ? 0 : EltSize; | ||
+ return BV->isConstantSp | ||
+ MinSplatBits) && | ||
+ EltSize >= SplatBitSize; | ||
} | ||
// FIXME: AllOnes and AllZeros duplicate a lot of code. Could these be |
@@ -2239,14 +2239,14 @@ bool llvm::UpgradeDeb | ||
} | ||
bool llvm::UpgradeMod | ||
- const NamedMDNode *ModFlags = M.getModuleFlags | ||
+ NamedMDNode *ModFlags = M.getModuleFlags | ||
if (!ModFlags) | ||
return false; | ||
- bool HasObjCFlag = false, HasClassProperti | ||
+ bool HasObjCFlag = false, HasClassProperti | ||
for (unsigned I = 0, E = ModFlags->getNum | ||
MDNode *Op = ModFlags->getOpe | ||
- if (Op->getNumOpera | ||
+ if (Op->getNumOpera | ||
continue; | ||
MDString *ID = dyn_cast_or_null | ||
if (!ID) | ||
@@ -2255,7 +2255,24 @@ bool llvm::UpgradeMod | ||
HasObjCFlag = true; | ||
if (ID->getString() | ||
HasClassProperti | ||
+ // Upgrade PIC/PIE Module Flags. The module flag behavior for these two | ||
+ // field was Error and now they are Max. | ||
+ if (ID->getString() | ||
+ if (auto *Behavior = | ||
+ mdconst::dyn_ext | ||
+ if (Behavior->getLi | ||
+ Type *Int32Ty = Type::getInt32Ty | ||
+ Metadata *Ops[3] = { | ||
+ ConstantAsMetada | ||
+ MDString::get(M. | ||
+ Op->getOperand(2 | ||
+ ModFlags->setOpe | ||
+ Changed = true; | ||
+ } | ||
+ } | ||
+ } | ||
} | ||
+ | ||
// "Objective-C Class Properties" is recently added for Objective-C. We | ||
// upgrade ObjC bitcodes to contain a "Objective-C Class Properties" module | ||
// flag of value 0, so we can correclty downgrade this flag when trying to | ||
@@ -2264,9 +2281,10 @@ bool llvm::UpgradeMod | ||
if (HasObjCFlag && !HasClassPropert | ||
M.addModuleFlag( | ||
(uint32_t)0); | ||
- return true; | ||
+ Changed = true; | ||
} | ||
- return false; | ||
+ | ||
+ return Changed; | ||
} | ||
static bool isOldLoopArgumen |
@@ -232,7 +232,13 @@ private: | ||
for (;;) { | ||
read(); | ||
if (Tok.K == Identifier && Tok.Value[0] == '@') { | ||
- Tok.Value.drop_f | ||
+ if (Tok.Value.drop_ | ||
+ // Not an ordinal modifier at all, but the next export (fastcall | ||
+ // decorated) - complete the current one. | ||
+ unget(); | ||
+ Info.Exports.pus | ||
+ return Error::success() | ||
+ } | ||
read(); | ||
if (Tok.K == KwNoname) { | ||
E.Noname = true; |
@@ -5901,7 +5901,10 @@ static bool isVUZPMask(Array | ||
return false; | ||
for (unsigned i = 0; i < M.size(); i += NumElts) { | ||
- WhichResult = M[i] == 0 ? 0 : 1; | ||
+ if (M.size() == NumElts * 2) | ||
+ WhichResult = i / NumElts; | ||
+ else | ||
+ WhichResult = M[i] == 0 ? 0 : 1; | ||
for (unsigned j = 0; j < NumElts; ++j) { | ||
if (M[i+j] >= 0 && (unsigned) M[i+j] != 2 * j + WhichResult) | ||
return false; | ||
@@ -5932,7 +5935,10 @@ static bool isVUZP_v_undef_M | ||
unsigned Half = NumElts / 2; | ||
for (unsigned i = 0; i < M.size(); i += NumElts) { | ||
- WhichResult = M[i] == 0 ? 0 : 1; | ||
+ if (M.size() == NumElts * 2) | ||
+ WhichResult = i / NumElts; | ||
+ else | ||
+ WhichResult = M[i] == 0 ? 0 : 1; | ||
for (unsigned j = 0; j < NumElts; j += Half) { | ||
unsigned Idx = WhichResult; | ||
for (unsigned k = 0; k < Half; ++k) { | ||
@@ -5972,7 +5978,10 @@ static bool isVZIPMask(Array | ||
return false; | ||
for (unsigned i = 0; i < M.size(); i += NumElts) { | ||
- WhichResult = M[i] == 0 ? 0 : 1; | ||
+ if (M.size() == NumElts * 2) | ||
+ WhichResult = i / NumElts; | ||
+ else | ||
+ WhichResult = M[i] == 0 ? 0 : 1; | ||
unsigned Idx = WhichResult * NumElts / 2; | ||
for (unsigned j = 0; j < NumElts; j += 2) { | ||
if ((M[i+j] >= 0 && (unsigned) M[i+j] != Idx) || | ||
@@ -6005,7 +6014,10 @@ static bool isVZIP_v_undef_M | ||
return false; | ||
for (unsigned i = 0; i < M.size(); i += NumElts) { | ||
- WhichResult = M[i] == 0 ? 0 : 1; | ||
+ if (M.size() == NumElts * 2) | ||
+ WhichResult = i / NumElts; | ||
+ else | ||
+ WhichResult = M[i] == 0 ? 0 : 1; | ||
unsigned Idx = WhichResult * NumElts / 2; | ||
for (unsigned j = 0; j < NumElts; j += 2) { | ||
if ((M[i+j] >= 0 && (unsigned) M[i+j] != Idx) || | ||
@@ -8793,6 +8805,8 @@ ARMTargetLowerin | ||
.addReg(ARM::R4, | ||
.addReg(ARM::R4, | ||
.addReg(ARM::R12 | ||
+ RegState::Implic | ||
+ .addReg(ARM::CPS | ||
RegState::Implic | ||
break; | ||
case CodeModel::Large | ||
@@ -8808,6 +8822,8 @@ ARMTargetLowerin | ||
.addReg(ARM::R4, | ||
.addReg(ARM::R4, | ||
.addReg(ARM::R12 | ||
+ RegState::Implic | ||
+ .addReg(ARM::CPS | ||
RegState::Implic | ||
break; | ||
} |
@@ -29540,8 +29540,9 @@ static bool detectZextAbsDif | ||
// In SetLT case, The second operand of the comparison can be either 1 or 0. | ||
APInt SplatVal; | ||
if ((CC == ISD::SETLT) && | ||
- !((ISD::isConsta | ||
- SplatVal == 1) || | ||
+ !((ISD::isConsta | ||
+ /*AllowShrink*/f | ||
+ SplatVal.isOneVa | ||
(ISD::isBuildVec | ||
return false; | ||
@@ -30628,6 +30629,9 @@ static SDValue combineSelect(SD | ||
// Byte blends are only available in AVX2 | ||
if (VT == MVT::v32i8 && !Subtarget.hasAV | ||
return SDValue(); | ||
+ // There are no 512-bit blend instructions that use sign bits. | ||
+ if (VT.is512BitVect | ||
+ return SDValue(); | ||
assert(BitWidth >= 8 && BitWidth <= 64 && "Invalid mask size"); | ||
APInt DemandedMask(API | ||
@@ -30938,11 +30942,40 @@ static bool checkBoolTestAnd | ||
return true; | ||
} | ||
+// When legalizing carry, we create carries via add X, -1 | ||
+// If that comes from an actual carry, via setcc, we use the | ||
+// carry directly. | ||
+static SDValue combineCarryThro | ||
+ if (EFLAGS.getOpcod | ||
+ if (isAllOnesConsta | ||
+ SDValue Carry = EFLAGS.getOperan | ||
+ while (Carry.getOpcode | ||
+ Carry.getOpcode( | ||
+ Carry.getOpcode( | ||
+ Carry.getOpcode( | ||
+ (Carry.getOpcode | ||
+ isOneConstant(Ca | ||
+ Carry = Carry.getOperand | ||
+ if (Carry.getOpcode | ||
+ Carry.getOpcode( | ||
+ if (Carry.getConsta | ||
+ return Carry.getOperand | ||
+ } | ||
+ } | ||
+ } | ||
+ | ||
+ return SDValue(); | ||
+} | ||
+ | ||
/// Optimize an EFLAGS definition used according to the condition code \p CC | ||
/// into a simpler EFLAGS value, potentially returning a new \p CC and replacing | ||
/// uses of chain values. | ||
static SDValue combineSetCCEFLA | ||
SelectionDAG &DAG) { | ||
+ if (CC == X86::COND_B) | ||
+ if (SDValue Flags = combineCarryThro | ||
+ return Flags; | ||
+ | ||
if (SDValue R = checkBoolTestSet | ||
return R; | ||
return combineSetCCAtom | ||
@@ -32058,7 +32091,8 @@ static SDValue combineAndMaskTo | ||
return SDValue(); | ||
APInt SplatVal; | ||
- if (!ISD::isConstan | ||
+ if (!ISD::isConstan | ||
+ /*AllowShrink*/f | ||
!SplatVal.isMask | ||
return SDValue(); | ||
@@ -32642,7 +32676,8 @@ static SDValue detectUSatPatter | ||
"Unexpected types for truncate operation"); | ||
APInt C; | ||
- if (ISD::isConstant | ||
+ if (ISD::isConstant | ||
+ /*AllowShrink*/f | ||
// C should be equal to UINT32_MAX / UINT16_MAX / UINT8_MAX according | ||
// the element size of the destination type. | ||
return C.isMask(VT.getS | ||
@@ -34983,27 +35018,13 @@ static SDValue combineSIntToFP( | ||
return SDValue(); | ||
} | ||
-// Optimize RES, EFLAGS = X86ISD::ADD LHS, RHS | ||
-static SDValue combineX86ADD(SD | ||
- X86TargetLowerin | ||
- // When legalizing carry, we create carries via add X, -1 | ||
- // If that comes from an actual carry, via setcc, we use the | ||
- // carry directly. | ||
- if (isAllOnesConsta | ||
- SDValue Carry = N->getOperand(0) | ||
- while (Carry.getOpcode | ||
- Carry.getOpcode( | ||
- Carry.getOpcode( | ||
- Carry.getOpcode( | ||
- (Carry.getOpcode | ||
- isOneConstant(Ca | ||
- Carry = Carry.getOperand | ||
- | ||
- if (Carry.getOpcode | ||
- Carry.getOpcode( | ||
- if (Carry.getConsta | ||
- return DCI.CombineTo(N, | ||
- } | ||
+static SDValue combineSBB(SDNod | ||
+ if (SDValue Flags = combineCarryThro | ||
+ MVT VT = N->getSimpleValu | ||
+ SDVTList VTs = DAG.getVTList(VT | ||
+ return DAG.getNode(X86I | ||
+ N->getOperand(0) | ||
+ Flags); | ||
} | ||
return SDValue(); | ||
@@ -35032,6 +35053,14 @@ static SDValue combineADC(SDNod | ||
return DCI.CombineTo(N, | ||
} | ||
+ if (SDValue Flags = combineCarryThro | ||
+ MVT VT = N->getSimpleValu | ||
+ SDVTList VTs = DAG.getVTList(VT | ||
+ return DAG.getNode(X86I | ||
+ N->getOperand(0) | ||
+ Flags); | ||
+ } | ||
+ | ||
return SDValue(); | ||
} | ||
@@ -35346,7 +35375,8 @@ static SDValue combineIncDecVec | ||
SDNode *N1 = N->getOperand(1) | ||
APInt SplatVal; | ||
- if (!ISD::isConstan | ||
+ if (!ISD::isConstan | ||
+ !SplatVal.isOneV | ||
return SDValue(); | ||
SDValue AllOnesVec = getOnesVector(VT | ||
@@ -35670,7 +35700,7 @@ SDValue X86TargetLowerin | ||
case X86ISD::CMOV: return combineCMov(N, DAG, DCI, Subtarget); | ||
case ISD::ADD: return combineAdd(N, DAG, Subtarget); | ||
case ISD::SUB: return combineSub(N, DAG, Subtarget); | ||
- case X86ISD::ADD: return combineX86ADD(N, | ||
+ case X86ISD::SBB: return combineSBB(N, DAG); | ||
case X86ISD::ADC: return combineADC(N, DAG, DCI); | ||
case ISD::MUL: return combineMul(N, DAG, DCI, Subtarget); | ||
case ISD::SHL: |
@@ -3619,8 +3619,8 @@ let Predicates = [HasVLX] in { | ||
def : Pat<(alignedstor | ||
(v8f64 VR512:$src), (iPTR 0))), addr:$dst), | ||
(VMOVAPDZ256mr addr:$dst, (v4f64 (EXTRACT_SUBREG VR512:$src,sub_y | ||
- def : Pat<(alignedstor | ||
- (v16f32 VR512:$src), (iPTR 0))), addr:$dst), | ||
+ def : Pat<(alignedstor | ||
+ (v16f32 VR512:$src), (iPTR 0))), addr:$dst), | ||
(VMOVAPSZ256mr addr:$dst, (v8f32 (EXTRACT_SUBREG VR512:$src,sub_y | ||
def : Pat<(alignedstor | ||
(v8i64 VR512:$src), (iPTR 0))), addr:$dst), |
@@ -24,8 +24,8 @@ def SandyBridgeModel | ||
// Based on the LSD (loop-stream detector) queue size. | ||
let LoopMicroOpBuffe | ||
- // This flag is set to allow the scheduler to assign | ||
- // a default model to unrecognized opcodes. | ||
+ // FIXME: SSE4 and AVX are unimplemented. This flag is set to allow | ||
+ // the scheduler to assign a default model to unrecognized opcodes. | ||
let CompleteModel = 0; | ||
} | ||
@@ -48,7 +48,6 @@ def SBPort23 : ProcResource<2>; | ||
def SBPort4 : ProcResource<1>; | ||
// Many micro-ops are capable of issuing on multiple ports. | ||
-def SBPort01 : ProcResGroup<[SB | ||
def SBPort05 : ProcResGroup<[SB | ||
def SBPort15 : ProcResGroup<[SB | ||
def SBPort015 : ProcResGroup<[SB | ||
@@ -116,10 +115,10 @@ def : WriteRes<WriteID | ||
// Scalar and vector floating point. | ||
defm : SBWriteResPair<W | ||
defm : SBWriteResPair<W | ||
-defm : SBWriteResPair<W | ||
+defm : SBWriteResPair<W | ||
defm : SBWriteResPair<W | ||
defm : SBWriteResPair<W | ||
-defm : SBWriteResPair<W | ||
+defm : SBWriteResPair<W | ||
defm : SBWriteResPair<W | ||
defm : SBWriteResPair<W | ||
defm : SBWriteResPair<W | ||
@@ -135,11 +134,11 @@ def : WriteRes<WriteFV | ||
} | ||
// Vector integer operations. | ||
-defm : SBWriteResPair<W | ||
-defm : SBWriteResPair<W | ||
-defm : SBWriteResPair<W | ||
+defm : SBWriteResPair<W | ||
+defm : SBWriteResPair<W | ||
+defm : SBWriteResPair<W | ||
defm : SBWriteResPair<W | ||
-defm : SBWriteResPair<W | ||
+defm : SBWriteResPair<W | ||
defm : SBWriteResPair<W | ||
def : WriteRes<WriteVa | ||
let Latency = 2; | ||
@@ -149,15 +148,13 @@ def : WriteRes<WriteVa | ||
let Latency = 6; | ||
let ResourceCycles = [1, 1, 1]; | ||
} | ||
-def : WriteRes<WriteMP | ||
- let Latency = 5; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,2]; | ||
+def : WriteRes<WriteMP | ||
+ let Latency = 6; | ||
+ let ResourceCycles = [1, 1, 1]; | ||
} | ||
-def : WriteRes<WriteMP | ||
- let Latency = 11; | ||
- let NumMicroOps = 4; | ||
- let ResourceCycles = [1,1,2]; | ||
+def : WriteRes<WriteMP | ||
+ let Latency = 6; | ||
+ let ResourceCycles = [1, 1, 1, 1]; | ||
} | ||
//////////////// | ||
@@ -207,15 +204,13 @@ def : WriteRes<WritePC | ||
} | ||
// Packed Compare Implicit Length Strings, Return Index | ||
-def : WriteRes<WritePC | ||
- let Latency = 11; | ||
- let NumMicroOps = 3; | ||
+def : WriteRes<WritePC | ||
+ let Latency = 3; | ||
let ResourceCycles = [3]; | ||
} | ||
-def : WriteRes<WritePC | ||
- let Latency = 17; | ||
- let NumMicroOps = 4; | ||
- let ResourceCycles = [3,1]; | ||
+def : WriteRes<WritePC | ||
+ let Latency = 3; | ||
+ let ResourceCycles = [3, 1]; | ||
} | ||
// Packed Compare Explicit Length Strings, Return Index | ||
@@ -229,26 +224,22 @@ def : WriteRes<WritePC | ||
} | ||
// AES Instructions. | ||
-def : WriteRes<WriteAE | ||
- let Latency = 7; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
+def : WriteRes<WriteAE | ||
+ let Latency = 8; | ||
+ let ResourceCycles = [2]; | ||
} | ||
-def : WriteRes<WriteAE | ||
- let Latency = 13; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,1,1]; | ||
+def : WriteRes<WriteAE | ||
+ let Latency = 8; | ||
+ let ResourceCycles = [2, 1]; | ||
} | ||
-def : WriteRes<WriteAE | ||
- let Latency = 12; | ||
- let NumMicroOps = 2; | ||
+def : WriteRes<WriteAE | ||
+ let Latency = 8; | ||
let ResourceCycles = [2]; | ||
} | ||
-def : WriteRes<WriteAE | ||
- let Latency = 18; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [2,1]; | ||
+def : WriteRes<WriteAE | ||
+ let Latency = 8; | ||
+ let ResourceCycles = [2, 1]; | ||
} | ||
def : WriteRes<WriteAE | ||
@@ -281,2407 +272,4 @@ def : WriteRes<WriteNo | ||
defm : SBWriteResPair<W | ||
defm : SBWriteResPair<W | ||
defm : SBWriteResPair<W | ||
- | ||
-// Remaining SNB instrs. | ||
- | ||
-def SBWriteResGroup0 | ||
- let Latency = 1; | ||
- let NumMicroOps = 1; | ||
- let ResourceCycles = [1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 1; | ||
- let NumMicroOps = 1; | ||
- let ResourceCycles = [1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup2 | ||
- let Latency = 1; | ||
- let NumMicroOps = 1; | ||
- let ResourceCycles = [1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup3 | ||
- let Latency = 1; | ||
- let NumMicroOps = 1; | ||
- let ResourceCycles = [1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup4 | ||
- let Latency = 1; | ||
- let NumMicroOps = 1; | ||
- let ResourceCycles = [1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup5 | ||
- let Latency = 1; | ||
- let NumMicroOps = 1; | ||
- let ResourceCycles = [1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup6 | ||
- let Latency = 1; | ||
- let NumMicroOps = 1; | ||
- let ResourceCycles = [1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup7 | ||
- let Latency = 2; | ||
- let NumMicroOps = 1; | ||
- let ResourceCycles = [1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup9 | ||
- let Latency = 2; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [2]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 2; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [2]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 2; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [2]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 2; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 2; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 2; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 2; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 2; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 2; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 2; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 2; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup2 | ||
- let Latency = 3; | ||
- let NumMicroOps = 1; | ||
- let ResourceCycles = [1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup2 | ||
- let Latency = 3; | ||
- let NumMicroOps = 1; | ||
- let ResourceCycles = [1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup2 | ||
- let Latency = 3; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup2 | ||
- let Latency = 3; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup2 | ||
- let Latency = 3; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [3]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup2 | ||
- let Latency = 3; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [3]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup2 | ||
- let Latency = 3; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [2,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup2 | ||
- let Latency = 4; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup2 | ||
- let Latency = 4; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup2 | ||
- let Latency = 4; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup3 | ||
- let Latency = 5; | ||
- let NumMicroOps = 1; | ||
- let ResourceCycles = [1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup3 | ||
- let Latency = 5; | ||
- let NumMicroOps = 1; | ||
- let ResourceCycles = [1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup3 | ||
- let Latency = 5; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup3 | ||
- let Latency = 5; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup3 | ||
- let Latency = 5; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,2]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup3 | ||
- let Latency = 5; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,2]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup3 | ||
- let Latency = 5; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup3 | ||
- let Latency = 5; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup3 | ||
- let Latency = 5; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup3 | ||
- let Latency = 5; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup4 | ||
- let Latency = 5; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup4 | ||
- let Latency = 5; | ||
- let NumMicroOps = 4; | ||
- let ResourceCycles = [1,3]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup4 | ||
- let Latency = 5; | ||
- let NumMicroOps = 4; | ||
- let ResourceCycles = [1,3]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup4 | ||
- let Latency = 5; | ||
- let NumMicroOps = 4; | ||
- let ResourceCycles = [1,1,2]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup4 | ||
- let Latency = 5; | ||
- let NumMicroOps = 4; | ||
- let ResourceCycles = [1,1,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup4 | ||
- let Latency = 5; | ||
- let NumMicroOps = 4; | ||
- let ResourceCycles = [1,1,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup4 | ||
- let Latency = 5; | ||
- let NumMicroOps = 4; | ||
- let ResourceCycles = [1,1,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup4 | ||
- let Latency = 5; | ||
- let NumMicroOps = 5; | ||
- let ResourceCycles = [1,2,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup4 | ||
- let Latency = 6; | ||
- let NumMicroOps = 1; | ||
- let ResourceCycles = [1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup4 | ||
- let Latency = 6; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup5 | ||
- let Latency = 6; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup5 | ||
- let Latency = 6; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup5 | ||
- let Latency = 6; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup5 | ||
- let Latency = 6; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,2]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup5 | ||
- let Latency = 7; | ||
- let NumMicroOps = 1; | ||
- let ResourceCycles = [1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup5 | ||
- let Latency = 7; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup5 | ||
- let Latency = 7; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup5 | ||
- let Latency = 7; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup5 | ||
- let Latency = 7; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup5 | ||
- let Latency = 7; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup6 | ||
- let Latency = 7; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup6 | ||
- let Latency = 7; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [2,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup6 | ||
- let Latency = 7; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [2,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup6 | ||
- let Latency = 7; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,2]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup6 | ||
- let Latency = 7; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup6 | ||
- let Latency = 7; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup6 | ||
- let Latency = 7; | ||
- let NumMicroOps = 4; | ||
- let ResourceCycles = [1,1,2]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup6 | ||
- let Latency = 7; | ||
- let NumMicroOps = 4; | ||
- let ResourceCycles = [1,2,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup6 | ||
- let Latency = 7; | ||
- let NumMicroOps = 4; | ||
- let ResourceCycles = [1,1,2]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup6 | ||
- let Latency = 7; | ||
- let NumMicroOps = 4; | ||
- let ResourceCycles = [1,2,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup7 | ||
- let Latency = 7; | ||
- let NumMicroOps = 4; | ||
- let ResourceCycles = [1,2,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup7 | ||
- let Latency = 8; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup7 | ||
- let Latency = 8; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup7 | ||
- let Latency = 8; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup7 | ||
- let Latency = 8; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup7 | ||
- let Latency = 8; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,2]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup7 | ||
- let Latency = 8; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,2]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup7 | ||
- let Latency = 8; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup7 | ||
- let Latency = 8; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup7 | ||
- let Latency = 8; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup8 | ||
- let Latency = 8; | ||
- let NumMicroOps = 4; | ||
- let ResourceCycles = [1,3]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup8 | ||
- let Latency = 8; | ||
- let NumMicroOps = 4; | ||
- let ResourceCycles = [1,3]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup8 | ||
- let Latency = 8; | ||
- let NumMicroOps = 4; | ||
- let ResourceCycles = [1,2,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup8 | ||
- let Latency = 8; | ||
- let NumMicroOps = 5; | ||
- let ResourceCycles = [2,3]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup8 | ||
- let Latency = 8; | ||
- let NumMicroOps = 5; | ||
- let ResourceCycles = [1,2,2]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup8 | ||
- let Latency = 8; | ||
- let NumMicroOps = 5; | ||
- let ResourceCycles = [1,2,2]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup8 | ||
- let Latency = 8; | ||
- let NumMicroOps = 5; | ||
- let ResourceCycles = [1,2,2]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup8 | ||
- let Latency = 8; | ||
- let NumMicroOps = 5; | ||
- let ResourceCycles = [1,1,1,2]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup8 | ||
- let Latency = 8; | ||
- let NumMicroOps = 5; | ||
- let ResourceCycles = [1,2,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup8 | ||
- let Latency = 9; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup9 | ||
- let Latency = 9; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup9 | ||
- let Latency = 9; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,2]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup9 | ||
- let Latency = 9; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup9 | ||
- let Latency = 9; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup9 | ||
- let Latency = 9; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup9 | ||
- let Latency = 9; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup9 | ||
- let Latency = 9; | ||
- let NumMicroOps = 4; | ||
- let ResourceCycles = [1,3]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup9 | ||
- let Latency = 9; | ||
- let NumMicroOps = 4; | ||
- let ResourceCycles = [1,1,2]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup9 | ||
- let Latency = 9; | ||
- let NumMicroOps = 6; | ||
- let ResourceCycles = [1,2,3]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup9 | ||
- let Latency = 9; | ||
- let NumMicroOps = 6; | ||
- let ResourceCycles = [1,2,2,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 9; | ||
- let NumMicroOps = 6; | ||
- let ResourceCycles = [1,1,2,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 10; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 10; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 10; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 11; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 11; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [3]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 11; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [2,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 11; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 11; | ||
- let NumMicroOps = 4; | ||
- let ResourceCycles = [1,1,2]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 11; | ||
- let NumMicroOps = 4; | ||
- let ResourceCycles = [1,2,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 12; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [2]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 12; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 12; | ||
- let NumMicroOps = 4; | ||
- let ResourceCycles = [1,2,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 12; | ||
- let NumMicroOps = 4; | ||
- let ResourceCycles = [1,2,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 13; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [2,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 13; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 14; | ||
- let NumMicroOps = 1; | ||
- let ResourceCycles = [1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 14; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 14; | ||
- let NumMicroOps = 4; | ||
- let ResourceCycles = [2,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 15; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 15; | ||
- let NumMicroOps = 4; | ||
- let ResourceCycles = [1,1,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 17; | ||
- let NumMicroOps = 4; | ||
- let ResourceCycles = [3,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 18; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [2,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 20; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 21; | ||
- let NumMicroOps = 1; | ||
- let ResourceCycles = [1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 21; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 22; | ||
- let NumMicroOps = 1; | ||
- let ResourceCycles = [1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 24; | ||
- let NumMicroOps = 1; | ||
- let ResourceCycles = [1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 28; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 29; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [2,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 31; | ||
- let NumMicroOps = 2; | ||
- let ResourceCycles = [1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 34; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [1,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 36; | ||
- let NumMicroOps = 4; | ||
- let ResourceCycles = [2,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 45; | ||
- let NumMicroOps = 3; | ||
- let ResourceCycles = [2,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 52; | ||
- let NumMicroOps = 4; | ||
- let ResourceCycles = [2,1,1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
-def: InstRW<[SBWriteR | ||
- | ||
-def SBWriteResGroup1 | ||
- let Latency = 114; | ||
- let NumMicroOps = 1; | ||
- let ResourceCycles = [1]; | ||
-} | ||
-def: InstRW<[SBWriteR | ||
- | ||
} // SchedModel |
@@ -161,6 +161,22 @@ int llvm::dlltoolDri | ||
if (Path.empty()) | ||
Path = getImplibPath(De | ||
+ if (Machine == IMAGE_FILE_MACHI | ||
+ for (COFFShortExport | ||
+ if (E.isWeak() || (!E.Name.empty() | ||
+ continue; | ||
+ E.SymbolName = E.Name; | ||
+ // Trim off the trailing decoration. Symbols will always have a | ||
+ // starting prefix here (either _ for cdecl/stdcall, @ for fastcall | ||
+ // or ? for C++ functions). (Vectorcall functions also will end up having | ||
+ // a prefix here, even if they shouldn't.) | ||
+ E.Name = E.Name.substr(0, | ||
+ // By making sure E.SymbolName != E.Name for decorated symbols, | ||
+ // writeImportLibra | ||
+ // IMPORT_NAME_UNDE | ||
+ } | ||
+ } | ||
+ | ||
if (writeImportLibr | ||
return 1; | ||
return 0; |
@@ -12,13 +12,13 @@ def D_long : JoinedOrSeparate | ||
def d: JoinedOrSeparate | ||
def d_long : JoinedOrSeparate | ||
+def k: Flag<["-"], "k">, HelpText<"Kill @n Symbol from export">; | ||
+def k_alias: Flag<["--"], "kill-at">, Alias<k>; | ||
+ | ||
//============== | ||
// The flags below do nothing. They are defined only for dlltool compatibility. | ||
//============== | ||
-def k: Flag<["-"], "k">, HelpText<"Kill @n Symbol from export">; | ||
-def k_alias: Flag<["--"], "kill-at">, Alias<k>; | ||
- | ||
def S: JoinedOrSeparate | ||
def S_alias: JoinedOrSeparate | ||
@@ -155,8 +155,7 @@ public: | ||
} | ||
bool runOnFunction(Fu | ||
- if (skipFunction(F) | ||
- return false; | ||
+ // Don't skip optnone functions; atomics still need to be lowered. | ||
FunctionAnalysis | ||
auto PA = Impl.run(F, DummyFAM); | ||
return !PA.areAllPreser |
@@ -1941,6 +1941,12 @@ Instruction *ReassociatePass | ||
if (!User->isCommut | ||
return nullptr; | ||
+ // Don't canonicalize x + (-Constant * y) -> x - (Constant * y), if the | ||
+ // resulting subtract will be broken up later. This can get us into an | ||
+ // infinite loop during reassociation. | ||
+ if (UserOpcode == Instruction::FAd | ||
+ return nullptr; | ||
+ | ||
// Change the sign of the constant. | ||
APFloat Val = CF->getValueAPF( | ||
Val.changeSign() |
@@ -341,8 +341,9 @@ void PruningFunctionC | ||
SimplifyInstruct | ||
// On the off-chance that this simplifies to an instruction in the old | ||
// function, map it back into the new function. | ||
- if (Value *MappedV = VMap.lookup(V)) | ||
- V = MappedV; | ||
+ if (NewFunc != OldFunc) | ||
+ if (Value *MappedV = VMap.lookup(V)) | ||
+ V = MappedV; | ||
if (!NewInst->mayHa | ||
VMap[&*II] = V; |
@@ -375,6 +375,7 @@ class CXXRecordDecl : public RecordDecl { | ||
/// \brief These flags are \c true if a defaulted corresponding special | ||
/// member can't be fully analyzed without performing overload resolution. | ||
/// @{ | ||
+ unsigned NeedOverloadReso | ||
unsigned NeedOverloadReso | ||
unsigned NeedOverloadReso | ||
unsigned NeedOverloadReso | ||
@@ -383,6 +384,7 @@ class CXXRecordDecl : public RecordDecl { | ||
/// \brief These flags are \c true if an implicit defaulted corresponding | ||
/// special member would be defined as deleted. | ||
/// @{ | ||
+ unsigned DefaultedCopyCon | ||
unsigned DefaultedMoveCon | ||
unsigned DefaultedMoveAss | ||
unsigned DefaultedDestruc | ||
@@ -415,6 +417,12 @@ class CXXRecordDecl : public RecordDecl { | ||
/// constructor. | ||
unsigned HasDefaultedDefa | ||
+ /// \brief True if this class can be passed in a non-address-pres | ||
+ /// fashion (such as in registers) according to the C++ language rules. | ||
+ /// This does not imply anything about how the ABI in use will actually | ||
+ /// pass an object of this class. | ||
+ unsigned CanPassInRegiste | ||
+ | ||
/// \brief True if a defaulted default constructor for this class would | ||
/// be constexpr. | ||
unsigned DefaultedDefault | ||
@@ -811,18 +819,50 @@ public: | ||
return data().FirstFrie | ||
} | ||
+ /// \brief \c true if a defaulted copy constructor for this class would be | ||
+ /// deleted. | ||
+ bool defaultedCopyCon | ||
+ assert((!needsOv | ||
+ (data().Declared | ||
+ "this property has not yet been computed by Sema"); | ||
+ return data().Defaulted | ||
+ } | ||
+ | ||
+ /// \brief \c true if a defaulted move constructor for this class would be | ||
+ /// deleted. | ||
+ bool defaultedMoveCon | ||
+ assert((!needsOv | ||
+ (data().Declared | ||
+ "this property has not yet been computed by Sema"); | ||
+ return data().Defaulted | ||
+ } | ||
+ | ||
+ /// \brief \c true if a defaulted destructor for this class would be deleted. | ||
+ bool defaultedDestruc | ||
+ return !data().Defaulte | ||
+ } | ||
+ | ||
+ /// \brief \c true if we know for sure that this class has a single, | ||
+ /// accessible, unambiguous copy constructor that is not deleted. | ||
+ bool hasSimpleCopyCon | ||
+ return !hasUserDeclared | ||
+ !data().Defaulte | ||
+ } | ||
+ | ||
/// \brief \c true if we know for sure that this class has a single, | ||
/// accessible, unambiguous move constructor that is not deleted. | ||
bool hasSimpleMoveCon | ||
return !hasUserDeclared | ||
!data().Defaulte | ||
} | ||
+ | ||
/// \brief \c true if we know for sure that this class has a single, | ||
/// accessible, unambiguous move assignment operator that is not deleted. | ||
bool hasSimpleMoveAss | ||
return !hasUserDeclared | ||
!data().Defaulte | ||
} | ||
+ | ||
/// \brief \c true if we know for sure that this class has an accessible | ||
/// destructor that is not deleted. | ||
bool hasSimpleDestruc | ||
@@ -878,7 +918,16 @@ public: | ||
/// \brief Determine whether we need to eagerly declare a defaulted copy | ||
/// constructor for this class. | ||
bool needsOverloadRes | ||
- return data().HasMutabl | ||
+ // C++17 [class.copy.ctor | ||
+ // If the class definition declares a move constructor or move assignment | ||
+ // operator, the implicitly declared copy constructor is defined as | ||
+ // deleted. | ||
+ // In MSVC mode, sometimes a declared move assignment does not delete an | ||
+ // implicit copy constructor, so defer this choice to Sema. | ||
+ if (data().UserDecl | ||
+ (SMF_MoveConstru | ||
+ return true; | ||
+ return data().NeedOverl | ||
} | ||
/// \brief Determine whether an implicit copy constructor for this type | ||
@@ -919,7 +968,16 @@ public: | ||
needsImplicitMov | ||
} | ||
- /// \brief Set that we attempted to declare an implicitly move | ||
+ /// \brief Set that we attempted to declare an implicit copy | ||
+ /// constructor, but overload resolution failed so we deleted it. | ||
+ void setImplicitCopyC | ||
+ assert((data().D | ||
+ needsOverloadRes | ||
+ "Copy constructor should not be deleted"); | ||
+ data().Defaulted | ||
+ } | ||
+ | ||
+ /// \brief Set that we attempted to declare an implicit move | ||
/// constructor, but overload resolution failed so we deleted it. | ||
void setImplicitMoveC | ||
assert((data().D | ||
@@ -1316,6 +1374,18 @@ public: | ||
return data().HasIrrele | ||
} | ||
+ /// \brief Determine whether this class has at least one trivial, non-deleted | ||
+ /// copy or move constructor. | ||
+ bool canPassInRegiste | ||
+ return data().CanPassIn | ||
+ } | ||
+ | ||
+ /// \brief Set that we can pass this RecordDecl in registers. | ||
+ // FIXME: This should be set as part of completeDefiniti | ||
+ void setCanPassInRegi | ||
+ data().CanPassIn | ||
+ } | ||
+ | ||
/// \brief Determine whether this class has a non-literal or/ volatile type | ||
/// non-static data member or base class. | ||
bool hasNonLiteralTyp | ||
@@ -1958,7 +2028,10 @@ public: | ||
/// \brief Returns the type of the \c this pointer. | ||
/// | ||
- /// Should only be called for instance (i.e., non-static) methods. | ||
+ /// Should only be called for instance (i.e., non-static) methods. Note | ||
+ /// that for the call operator of a lambda closure type, this returns the | ||
+ /// desugared 'this' type (a pointer to the closure type), not the captured | ||
+ /// 'this' type. | ||
QualType getThisType(ASTC | ||
unsigned getTypeQualifier |
@@ -694,6 +694,9 @@ def fbuiltin : Flag<["-"], "fbuiltin">, Group<f_Group>; | ||
def fbuiltin_module_ | ||
Flags<[DriverOpt | ||
def fcaret_diagnosti | ||
+def fclang_abi_compa | ||
+ Flags<[CC1Option | ||
+ HelpText<"Attemp | ||
def fclasspath_EQ : Joined<["-"], "fclasspath=">, Group<f_Group>; | ||
def fcolor_diagnosti | ||
Flags<[CoreOptio |
@@ -120,6 +120,10 @@ CODEGENOPT(NoZer | ||
ENUM_CODEGENOPT( | ||
CODEGENOPT(OmitL | ||
///< enabled. | ||
+ | ||
+/// A version of Clang that we should attempt to be ABI-compatible with. | ||
+ENUM_CODEGENOPT | ||
+ | ||
VALUE_CODEGENOPT | ||
VALUE_CODEGENOPT | ||
@@ -69,6 +69,23 @@ public: | ||
LocalExecTLSMode | ||
}; | ||
+ /// Clang versions with different platform ABI conformance. | ||
+ enum class ClangABI { | ||
+ /// Attempt to be ABI-compatible with code generated by Clang 3.8.x | ||
+ /// (SVN r257626). This causes <1 x long long> to be passed in an | ||
+ /// integer register instead of an SSE register on x64_64. | ||
+ Ver3_8, | ||
+ | ||
+ /// Attempt to be ABI-compatible with code generated by Clang 4.0.x | ||
+ /// (SVN r291814). This causes move operations to be ignored when | ||
+ /// determining whether a class type can be passed or returned directly. | ||
+ Ver4, | ||
+ | ||
+ /// Conform to the underlying platform's C and C++ ABIs as closely | ||
+ /// as we can. | ||
+ Latest | ||
+ }; | ||
+ | ||
enum StructReturnConv | ||
SRCK_Default, // No special option was passed. | ||
SRCK_OnStack, // Small structs on the stack (-fpcc-struct-re |
@@ -1048,10 +1048,6 @@ public: | ||
/// which implicitly adds the builtin defines etc. | ||
void EnterMainSourceF | ||
- /// \brief After parser warm-up, initialize the conditional stack from | ||
- /// the preamble. | ||
- void replayPreambleCo | ||
- | ||
/// \brief Inform the preprocessor callbacks that processing is complete. | ||
void EndSourceFile(); | ||
@@ -2025,6 +2021,10 @@ public: | ||
} | ||
private: | ||
+ /// \brief After processing predefined file, initialize the conditional stack from | ||
+ /// the preamble. | ||
+ void replayPreambleCo | ||
+ | ||
// Macro handling. | ||
void HandleDefineDire | ||
void HandleUndefDirec |
@@ -956,12 +956,16 @@ bool ASTNodeImporter: | ||
ToData.HasUninit | ||
ToData.HasInheri | ||
ToData.HasInheri | ||
+ ToData.NeedOverl | ||
+ = FromData.NeedOve | ||
ToData.NeedOverl | ||
= FromData.NeedOve | ||
ToData.NeedOverl | ||
= FromData.NeedOve | ||
ToData.NeedOverl | ||
= FromData.NeedOve | ||
+ ToData.Defaulted | ||
+ = FromData.Default | ||
ToData.Defaulted | ||
= FromData.Default | ||
ToData.Defaulted | ||
@@ -973,6 +977,7 @@ bool ASTNodeImporter: | ||
= FromData.HasCons | ||
ToData.HasDefaul | ||
= FromData.HasDefa | ||
+ ToData.CanPassIn | ||
ToData.Defaulted | ||
= FromData.Default | ||
ToData.HasConste |
@@ -55,15 +55,18 @@ CXXRecordDecl::D | ||
HasOnlyCMembers( | ||
HasUninitialized | ||
HasInheritedCons | ||
+ NeedOverloadReso | ||
NeedOverloadReso | ||
NeedOverloadReso | ||
NeedOverloadReso | ||
+ DefaultedCopyCon | ||
DefaultedMoveCon | ||
DefaultedMoveAss | ||
DefaultedDestruc | ||
DeclaredNonTrivi | ||
HasConstexprNonC | ||
HasDefaultedDefa | ||
+ CanPassInRegiste | ||
DefaultedDefault | ||
HasConstexprDefa | ||
HasNonLiteralTyp | ||
@@ -352,8 +355,10 @@ CXXRecordDecl::s | ||
setHasVolatileMe | ||
// Keep track of the presence of mutable fields. | ||
- if (BaseClassDecl-> | ||
+ if (BaseClassDecl-> | ||
data().HasMutabl | ||
+ data().NeedOverl | ||
+ } | ||
if (BaseClassDecl-> | ||
data().HasUninit | ||
@@ -406,6 +411,8 @@ void CXXRecordDecl::a | ||
// -- a direct or virtual base class B that cannot be copied/moved [...] | ||
// -- a non-static data member of class type M (or array thereof) | ||
// that cannot be copied or moved [...] | ||
+ if (!Subobj->hasSim | ||
+ data().NeedOverl | ||
if (!Subobj->hasSim | ||
data().NeedOverl | ||
@@ -426,6 +433,7 @@ void CXXRecordDecl::a | ||
// -- any non-static data member has a type with a destructor | ||
// that is deleted or inaccessible from the defaulted [ctor or dtor]. | ||
if (!Subobj->hasSim | ||
+ data().NeedOverl | ||
data().NeedOverl | ||
data().NeedOverl | ||
} | ||
@@ -711,8 +719,10 @@ void CXXRecordDecl::a | ||
data().IsStandar | ||
// Keep track of the presence of mutable fields. | ||
- if (Field->isMutabl | ||
+ if (Field->isMutabl | ||
data().HasMutabl | ||
+ data().NeedOverl | ||
+ } | ||
// C++11 [class.union]p8, | ||
// If X is a union, a non-static data member of X that is not an anonymous | ||
@@ -756,6 +766,12 @@ void CXXRecordDecl::a | ||
// A standard-layout class is a class that: | ||
// -- has no non-static data members of type [...] reference, | ||
data().IsStandar | ||
+ | ||
+ // C++1z [class.copy.ctor | ||
+ // A defaulted copy constructor for a class X is defined as deleted if X has: | ||
+ // -- a non-static data member of rvalue reference type | ||
+ if (T->isRValueRefe | ||
+ data().Defaulted | ||
} | ||
if (!Field->hasInCl | ||
@@ -809,6 +825,10 @@ void CXXRecordDecl::a | ||
// We may need to perform overload resolution to determine whether a | ||
// field can be moved if it's const or volatile qualified. | ||
if (T.getCVRQualifi | ||
+ // We need to care about 'const' for the copy constructor because an | ||
+ // implicit copy constructor might be declared with a non-const | ||
+ // parameter. | ||
+ data().NeedOverl | ||
data().NeedOverl | ||
data().NeedOverl | ||
} | ||
@@ -819,6 +839,8 @@ void CXXRecordDecl::a | ||
// -- X is a union-like class that has a variant member with a | ||
// non-trivial [corresponding special member] | ||
if (isUnion()) { | ||
+ if (FieldRec->hasNo | ||
+ data().Defaulted | ||
if (FieldRec->hasNo | ||
data().Defaulted | ||
if (FieldRec->hasNo | ||
@@ -830,6 +852,8 @@ void CXXRecordDecl::a | ||
// For an anonymous union member, our overload resolution will perform | ||
// overload resolution for its members. | ||
if (Field->isAnonym | ||
+ data().NeedOverl | ||
+ FieldRec->data() | ||
data().NeedOverl | ||
FieldRec->data() | ||
data().NeedOverl | ||
@@ -915,8 +939,10 @@ void CXXRecordDecl::a | ||
} | ||
// Keep track of the presence of mutable fields. | ||
- if (FieldRec->hasMu | ||
+ if (FieldRec->hasMu | ||
data().HasMutabl | ||
+ data().NeedOverl | ||
+ } | ||
// C++11 [class.copy]p13: | ||
// If the implicitly-defin | ||
@@ -1450,7 +1476,7 @@ void CXXRecordDecl::c | ||
void CXXRecordDecl::c | ||
RecordDecl::comp | ||
- | ||
+ | ||
// If the class may be abstract (but hasn't been marked as such), check for | ||
// any pure final overriders. | ||
if (mayBeAbstract() |
@@ -36,7 +36,7 @@ std::string getClangReposito | ||
// If the SVN_REPOSITORY is empty, try to use the SVN keyword. This helps us | ||
// pick up a tag in an SVN export, for example. | ||
- StringRef SVNRepository("$ | ||
+ StringRef SVNRepository("$ | ||
if (URL.empty()) { | ||
URL = SVNRepository.sl | ||
SVNRepository.fi |
@@ -24,6 +24,7 @@ namespace llvm { | ||
namespace clang { | ||
class ASTContext; | ||
+ class CodeGenOptions; | ||
class TargetInfo; | ||
namespace CodeGen { | ||
@@ -68,6 +69,7 @@ namespace swiftcall { | ||
llvm::LLVMContex | ||
const llvm::DataLayout | ||
const TargetInfo &getTarget() const; | ||
+ const CodeGenOptions &getCodeGenOpts( | ||
/// Return the calling convention to use for system runtime | ||
/// functions. |
@@ -30,38 +30,9 @@ void CGCXXABI::ErrorU | ||
} | ||
bool CGCXXABI::canCop | ||
- // If RD has a non-trivial move or copy constructor, we cannot copy the | ||
- // argument. | ||
- if (RD->hasNonTrivi | ||
- return false; | ||
- | ||
- // If RD has a non-trivial destructor, we cannot copy the argument. | ||
- if (RD->hasNonTrivi | ||
- return false; | ||
- | ||
// We can only copy the argument if there exists at least one trivial, | ||
// non-deleted copy or move constructor. | ||
- // FIXME: This assumes that all lazily declared copy and move constructors are | ||
- // not deleted. This assumption might not be true in some corner cases. | ||
- bool CopyDeleted = false; | ||
- bool MoveDeleted = false; | ||
- for (const CXXConstructorDe | ||
- if (CD->isCopyConst | ||
- assert(CD->isTri | ||
- // We had at least one undeleted trivial copy or move ctor. Return | ||
- // directly. | ||
- if (!CD->isDeleted( | ||
- return true; | ||
- if (CD->isCopyConst | ||
- CopyDeleted = true; | ||
- else | ||
- MoveDeleted = true; | ||
- } | ||
- } | ||
- | ||
- // If all trivial copy and move constructors are deleted, we cannot copy the | ||
- // argument. | ||
- return !(CopyDeleted && MoveDeleted); | ||
+ return RD->canPassInReg | ||
} | ||
llvm::Constant *CGCXXABI::GetBo |
@@ -3260,7 +3260,7 @@ void CGDebugInfo::Emi | ||
llvm::DISubprogr | ||
if (FI != SPCache.end()) | ||
SP = dyn_cast_or_null | ||
- if (!SP) | ||
+ if (!SP || !SP->isDefinitio | ||
SP = getFunctionStub( | ||
FnBeginRegionCou | ||
LexicalBlockStac |
@@ -22,6 +22,7 @@ | ||
#include "CodeGenPGO.h" | ||
#include "TargetInfo.h" | ||
#include "clang/AST/ASTCo | ||
+#include "clang/AST/ASTLa | ||
#include "clang/AST/Decl. | ||
#include "clang/AST/DeclC | ||
#include "clang/AST/StmtC | ||
@@ -983,11 +984,22 @@ void CodeGenFunction: | ||
} | ||
// Check the 'this' pointer once per function, if it's available. | ||
- if (CXXThisValue) { | ||
+ if (CXXABIThisValue | ||
SanitizerSet SkippedChecks; | ||
SkippedChecks.se | ||
QualType ThisTy = MD->getThisType( | ||
- EmitTypeCheck(TC | ||
+ | ||
+ // If this is the call operator of a lambda with no capture-default, | ||
+ // may have a static invoker function, which may call this operator with | ||
+ // a null 'this' pointer. | ||
+ if (isLambdaCallOpe | ||
+ cast<CXXRecordDe | ||
+ LCD_None) | ||
+ SkippedChecks.se | ||
+ | ||
+ EmitTypeCheck(is | ||
+ : TCK_MemberCall, | ||
+ Loc, CXXABIThisValue, | ||
getContext().get | ||
SkippedChecks); | ||
} |
@@ -44,6 +44,10 @@ CodeGenTypes::~C | ||
delete &*I++; | ||
} | ||
+const CodeGenOptions &CodeGenTypes::g | ||
+ return CGM.getCodeGenOp | ||
+} | ||
+ | ||
void CodeGenTypes::ad | ||
llvm::StructType | ||
StringRef suffix) { |
@@ -178,6 +178,7 @@ public: | ||
const TargetInfo &getTarget() const { return Target; } | ||
CGCXXABI &getCXXABI() const { return TheCXXABI; } | ||
llvm::LLVMContex | ||
+ const CodeGenOptions &getCodeGenOpts( | ||
/// ConvertType - Convert type T into a llvm::Type. | ||
llvm::Type *ConvertType(Qua |
@@ -62,12 +62,20 @@ public: | ||
bool classifyReturnTy | ||
+ bool passClassIndirec | ||
+ // Clang <= 4 used the pre-C++11 rule, which ignores move operations. | ||
+ // The PS4 platform ABI follows the behavior of Clang 3.2. | ||
+ if (CGM.getCodeGenO | ||
+ CodeGenOptions:: | ||
+ CGM.getTriple(). | ||
+ return RD->hasNonTrivia | ||
+ RD->hasNonTrivia | ||
+ return !canCopyArgument | ||
+ } | ||
+ | ||
RecordArgABI getRecordArgABI( | ||
- // Structures with either a non-trivial destructor or a non-trivial | ||
- // copy constructor are always indirect. | ||
- // FIXME: Use canCopyArgument( | ||
- // special members. | ||
- if (RD->hasNonTrivi | ||
+ // If C++ prohibits us from making a copy, pass by address. | ||
+ if (passClassIndire | ||
return RAA_Indirect; | ||
return RAA_Default; | ||
} | ||
@@ -998,10 +1006,8 @@ bool ItaniumCXXABI::c | ||
if (!RD) | ||
return false; | ||
- // Return indirectly if we have a non-trivial copy ctor or non-trivial dtor. | ||
- // FIXME: Use canCopyArgument( | ||
- // special members. | ||
- if (RD->hasNonTrivi | ||
+ // If C++ prohibits us from making a copy, return by address. | ||
+ if (passClassIndire | ||
auto Align = CGM.getContext() | ||
FI.getReturnInfo | ||
return true; |
@@ -819,46 +819,44 @@ MicrosoftCXXABI: | ||
return RAA_Default; | ||
case llvm::Triple::x8 | ||
- // Win64 passes objects with non-trivial copy ctors indirectly. | ||
- if (RD->hasNonTrivi | ||
- return RAA_Indirect; | ||
- | ||
- // If an object has a destructor, we'd really like to pass it indirectly | ||
+ // If a class has a destructor, we'd really like to pass it indirectly | ||
// because it allows us to elide copies. Unfortunately, MSVC makes that | ||
// impossible for small types, which it will pass in a single register or | ||
// stack slot. Most objects with dtors are large-ish, so handle that early. | ||
// We can't call out all large objects as being indirect because there are | ||
// multiple x64 calling conventions and the C++ ABI code shouldn't dictate | ||
// how we pass large POD types. | ||
+ // | ||
+ // Note: This permits small classes with nontrivial destructors to be | ||
+ // passed in registers, which is non-conforming. | ||
if (RD->hasNonTrivi | ||
getContext().get | ||
return RAA_Indirect; | ||
- // If this is true, the implicit copy constructor that Sema would have | ||
- // created would not be deleted. FIXME: We should provide a more direct way | ||
- // for CodeGen to ask whether the constructor was deleted. | ||
- if (!RD->hasUserDec | ||
- !RD->hasUserDecl | ||
- !RD->needsOverlo | ||
- !RD->hasUserDecl | ||
- !RD->needsOverlo | ||
- return RAA_Default; | ||
- | ||
- // Otherwise, Sema should have created an implicit copy constructor if | ||
- // needed. | ||
- assert(!RD->need | ||
- | ||
- // We have to make sure the trivial copy constructor isn't deleted. | ||
- for (const CXXConstructorDe | ||
- if (CD->isCopyConst | ||
- assert(CD->isTri | ||
- // We had at least one undeleted trivial copy ctor. Return directly. | ||
- if (!CD->isDeleted( | ||
- return RAA_Default; | ||
+ // If a class has at least one non-deleted, trivial copy constructor, it | ||
+ // is passed according to the C ABI. Otherwise, it is passed indirectly. | ||
+ // | ||
+ // Note: This permits classes with non-trivial copy or move ctors to be | ||
+ // passed in registers, so long as they *also* have a trivial copy ctor, | ||
+ // which is non-conforming. | ||
+ if (RD->needsImplic | ||
+ // If the copy ctor has not yet been declared, we can read its triviality | ||
+ // off the AST. | ||
+ if (!RD->defaultedC | ||
+ RD->hasTrivialCo | ||
+ return RAA_Default; | ||
+ } else { | ||
+ // Otherwise, we need to find the copy constructor(s) and ask. | ||
+ for (const CXXConstructorDe | ||
+ if (CD->isCopyConst | ||
+ // We had at least one nondeleted trivial copy ctor. Return directly. | ||
+ if (!CD->isDeleted( | ||
+ return RAA_Default; | ||
+ } | ||
} | ||
} | ||
- // The trivial copy constructor was deleted. Return indirectly. | ||
+ // We have no trivial, non-deleted copy constructor. | ||
return RAA_Indirect; | ||
} | ||
@@ -183,7 +183,11 @@ const TargetInfo &ABIInfo::getTar | ||
return CGT.getTarget(); | ||
} | ||
-bool ABIInfo:: isAndroid() const { return getTarget().getT | ||
+const CodeGenOptions &ABIInfo::getCod | ||
+ return CGT.getCodeGenOp | ||
+} | ||
+ | ||
+bool ABIInfo::isAndro | ||
bool ABIInfo::isHomog | ||
return false; | ||
@@ -2095,9 +2099,14 @@ class X86_64ABIInfo : public SwiftABIInfo { | ||
return !getTarget().get | ||
} | ||
- /// GCC classifies <1 x long long> as SSE but compatibility with older clang | ||
- // compilers require us to classify it as INTEGER. | ||
+ /// GCC classifies <1 x long long> as SSE but some platform ABIs choose to | ||
+ /// classify it as INTEGER (for compatibility with older clang compilers). | ||
bool classifyIntegerM | ||
+ // Clang <= 3.8 did not do this. | ||
+ if (getCodeGenOpts( | ||
+ CodeGenOptions:: | ||
+ return false; | ||
+ | ||
const llvm::Triple &Triple = getTarget().getT | ||
if (Triple.isOSDarw | ||
return false; |
@@ -2855,6 +2855,9 @@ void Clang::Construct | ||
addPGOAndCoverag | ||
+ if (auto *ABICompatArg = Args.getLastArg( | ||
+ ABICompatArg->re | ||
+ | ||
// Add runtime flag for PS4 when PGO or Coverage are enabled. | ||
if (getToolChain(). | ||
PS4cpu::addProfi |
@@ -1837,7 +1837,12 @@ Darwin::Translat | ||
} | ||
bool MachO::IsUnwindT | ||
- return !UseSjLjExceptio | ||
+ // Unwind tables are not emitted if -fno-exceptions is supplied (except when | ||
+ // targeting x86_64). | ||
+ return getArch() == llvm::Triple::x8 | ||
+ (!UseSjLjExcepti | ||
+ Args.hasFlag(opt | ||
+ true)); | ||
} | ||
bool MachO::UseDwarfD |
@@ -76,7 +76,7 @@ static bool getSystemRegistr | ||
// Check various environment variables to try and find a toolchain. | ||
static bool findVCToolChainV | ||
- bool &IsVS2017OrNewer | ||
+ MSVCToolChain::T | ||
// These variables are typically set by vcvarsall.bat | ||
// when launching a developer command prompt. | ||
if (llvm::Optional< | ||
@@ -84,7 +84,7 @@ static bool findVCToolChainV | ||
// This is only set by newer Visual Studios, and it leads straight to | ||
// the toolchain directory. | ||
Path = std::move(*VCToo | ||
- IsVS2017OrNewer = true; | ||
+ VSLayout = MSVCToolChain::T | ||
return true; | ||
} | ||
if (llvm::Optional< | ||
@@ -94,7 +94,7 @@ static bool findVCToolChainV | ||
// so this check has to appear second. | ||
// In older Visual Studios, the VC directory is the toolchain. | ||
Path = std::move(*VCIns | ||
- IsVS2017OrNewer = false; | ||
+ VSLayout = MSVCToolChain::T | ||
return true; | ||
} | ||
@@ -134,9 +134,16 @@ static bool findVCToolChainV | ||
} | ||
if (IsBin) { | ||
llvm::StringRef ParentPath = llvm::sys::path: | ||
- if (llvm::sys::path | ||
+ llvm::StringRef ParentFilename = llvm::sys::path: | ||
+ if (ParentFilename == "VC") { | ||
Path = ParentPath; | ||
- IsVS2017OrNewer = false; | ||
+ VSLayout = MSVCToolChain::T | ||
+ return true; | ||
+ } | ||
+ if (ParentFilename == "x86ret" || ParentFilename == "x86chk" | ||
+ || ParentFilename == "amd64ret" || ParentFilename == "amd64chk") { | ||
+ Path = ParentPath; | ||
+ VSLayout = MSVCToolChain::T | ||
return true; | ||
} | ||
@@ -165,7 +172,7 @@ static bool findVCToolChainV | ||
ToolChainPath = llvm::sys::path: | ||
Path = ToolChainPath; | ||
- IsVS2017OrNewer = true; | ||
+ VSLayout = MSVCToolChain::T | ||
return true; | ||
} | ||
@@ -181,7 +188,7 @@ static bool findVCToolChainV | ||
// This is the preferred way to discover new Visual Studios, as they're no | ||
// longer listed in the registry. | ||
static bool findVCToolChainV | ||
- bool &IsVS2017OrNewer | ||
+ MSVCToolChain::T | ||
#if !defined(USE_MSV | ||
return false; | ||
#else | ||
@@ -263,7 +270,7 @@ static bool findVCToolChainV | ||
return false; | ||
Path = ToolchainPath.st | ||
- IsVS2017OrNewer = true; | ||
+ VSLayout = MSVCToolChain::T | ||
return true; | ||
#endif | ||
} | ||
@@ -272,7 +279,7 @@ static bool findVCToolChainV | ||
// a toolchain path. VS2017 and newer don't get added to the registry. | ||
// So if we find something here, we know that it's an older version. | ||
static bool findVCToolChainV | ||
- bool &IsVS2017OrNewer | ||
+ MSVCToolChain::T | ||
std::string VSInstallPath; | ||
if (getSystemRegist | ||
"InstallDir", VSInstallPath, nullptr) || | ||
@@ -284,7 +291,7 @@ static bool findVCToolChainV | ||
llvm::sys::path: | ||
Path = VCPath.str(); | ||
- IsVS2017OrNewer = false; | ||
+ VSLayout = MSVCToolChain::T | ||
return true; | ||
} | ||
} | ||
@@ -475,6 +482,7 @@ void visualstudio::Li | ||
// native target bin directory. | ||
// e.g. when compiling for x86 on an x64 host, PATH should start with: | ||
// /bin/HostX64/x86 | ||
+ // This doesn't attempt to handle ToolsetLayout::D | ||
if (TC.getIsVS2017O | ||
llvm::Triple(llv | ||
auto HostArch = llvm::Triple(llv | ||
@@ -677,9 +685,9 @@ MSVCToolChain::M | ||
// what they want to use. | ||
// Failing that, just try to find the newest Visual Studio version we can | ||
// and use its default VC toolchain. | ||
- findVCToolChainV | ||
- findVCToolChainV | ||
- findVCToolChainV | ||
+ findVCToolChainV | ||
+ findVCToolChainV | ||
+ findVCToolChainV | ||
} | ||
Tool *MSVCToolChain:: | ||
@@ -766,6 +774,21 @@ static const char *llvmArchToLegac | ||
} | ||
} | ||
+// Similar to the above function, but for DevDiv internal builds. | ||
+static const char *llvmArchToDevDi | ||
+ using ArchType = llvm::Triple::Ar | ||
+ switch (Arch) { | ||
+ case ArchType::x86: | ||
+ return "i386"; | ||
+ case ArchType::x86_64 | ||
+ return "amd64"; | ||
+ case ArchType::arm: | ||
+ return "arm"; | ||
+ default: | ||
+ return ""; | ||
+ } | ||
+} | ||
+ | ||
// Get the path to a specific subdirectory in the current toolchain for | ||
// a given target architecture. | ||
// VS2017 changed the VC toolchain layout, so this should be used instead | ||
@@ -773,26 +796,40 @@ static const char *llvmArchToLegac | ||
std::string | ||
MSVCToolChain::g | ||
llvm::Triple::Ar | ||
+ const char *SubdirName; | ||
+ const char *IncludeName; | ||
+ switch (VSLayout) { | ||
+ case ToolsetLayout::O | ||
+ SubdirName = llvmArchToLegacy | ||
+ IncludeName = "include"; | ||
+ break; | ||
+ case ToolsetLayout::V | ||
+ SubdirName = llvmArchToWindow | ||
+ IncludeName = "include"; | ||
+ break; | ||
+ case ToolsetLayout::D | ||
+ SubdirName = llvmArchToDevDiv | ||
+ IncludeName = "inc"; | ||
+ break; | ||
+ } | ||
+ | ||
llvm::SmallStrin | ||
switch (Type) { | ||
case SubDirectoryType | ||
- if (IsVS2017OrNewer | ||
- bool HostIsX64 = | ||
+ if (VSLayout == ToolsetLayout::V | ||
+ const bool HostIsX64 = | ||
llvm::Triple(llv | ||
- llvm::sys::path: | ||
- llvmArchToWindow | ||
- | ||
- } else { | ||
- llvm::sys::path: | ||
+ const char *const HostName = HostIsX64 ? "HostX64" : "HostX86"; | ||
+ llvm::sys::path: | ||
+ } else { // OlderVS or DevDivInternal | ||
+ llvm::sys::path: | ||
} | ||
break; | ||
case SubDirectoryType | ||
- llvm::sys::path: | ||
+ llvm::sys::path: | ||
break; | ||
case SubDirectoryType | ||
- llvm::sys::path: | ||
- Path, "lib", IsVS2017OrNewer ? llvmArchToWindow | ||
- : llvmArchToLegacy | ||
+ llvm::sys::path: | ||
break; | ||
} | ||
return Path.str(); |
@@ -92,7 +92,12 @@ public: | ||
return getSubDirectoryP | ||
} | ||
- bool getIsVS2017OrNew | ||
+ enum class ToolsetLayout { | ||
+ OlderVS, | ||
+ VS2017OrNewer, | ||
+ DevDivInternal, | ||
+ }; | ||
+ bool getIsVS2017OrNew | ||
void | ||
AddClangSystemIn | ||
@@ -130,7 +135,7 @@ protected: | ||
Tool *buildAssembler( | ||
private: | ||
std::string VCToolChainPath; | ||
- bool IsVS2017OrNewer = false; | ||
+ ToolsetLayout VSLayout = ToolsetLayout::O | ||
CudaInstallation | ||
}; | ||
@@ -246,12 +246,12 @@ AlignTokenSequen | ||
for (unsigned i = Start; i != End; ++i) { | ||
if (ScopeStack.size | ||
- Changes[i].nesti | ||
- Changes[ScopeSta | ||
+ Changes[i].inden | ||
+ Changes[ScopeSta | ||
ScopeStack.pop_b | ||
- if (i != Start && Changes[i].nesti | ||
- Changes[i - 1].nestingAndInd | ||
+ if (i != Start && Changes[i].inden | ||
+ Changes[i - 1].indentAndNest | ||
ScopeStack.push_ | ||
bool InsideNestedScop | ||
@@ -327,8 +327,8 @@ static unsigned AlignTokens(cons | ||
// Measure the scope level (i.e. depth of (), [], {}) of the first token, and | ||
// abort when we hit any token in a higher scope than the starting one. | ||
- auto NestingAndIndent | ||
- ? Changes[StartAt] | ||
+ auto IndentAndNesting | ||
+ ? Changes[StartAt] | ||
: std::pair<unsign | ||
// Keep track of the number of commas before the matching tokens, we will only | ||
@@ -359,7 +359,7 @@ static unsigned AlignTokens(cons | ||
unsigned i = StartAt; | ||
for (unsigned e = Changes.size(); i != e; ++i) { | ||
- if (Changes[i].nest | ||
+ if (Changes[i].inde | ||
break; | ||
if (Changes[i].Newl | ||
@@ -375,7 +375,7 @@ static unsigned AlignTokens(cons | ||
if (Changes[i].Tok- | ||
++CommasBeforeMa | ||
- } else if (Changes[i].nest | ||
+ } else if (Changes[i].inde | ||
// Call AlignTokens recursively, skipping over this scope block. | ||
unsigned StoppedAt = AlignTokens(Styl | ||
i = StoppedAt - 1; | ||
@@ -472,9 +472,14 @@ void WhitespaceManage | ||
continue; | ||
unsigned ChangeMinColumn = Changes[i].Start | ||
- unsigned ChangeMaxColumn = Style.ColumnLimi | ||
- ? Style.ColumnLimi | ||
- : ChangeMinColumn; | ||
+ unsigned ChangeMaxColumn; | ||
+ | ||
+ if (Style.ColumnLim | ||
+ ChangeMaxColumn = UINT_MAX; | ||
+ else if (Style.ColumnLim | ||
+ ChangeMaxColumn = Style.ColumnLimi | ||
+ else | ||
+ ChangeMaxColumn = ChangeMinColumn; | ||
// If we don't create a replacement for this change, we have to consider | ||
// it to be immovable. |
@@ -154,12 +154,11 @@ public: | ||
const Change *StartOfBlockCom | ||
int IndentationOffse | ||
- // A combination of nesting level and indent level, which are used in | ||
+ // A combination of indent level and nesting level, which are used in | ||
// tandem to compute lexical scope, for the purposes of deciding | ||
// when to stop consecutive alignment runs. | ||
- std::pair<unsign | ||
- nestingAndIndent | ||
- return std::make_pair(T | ||
+ std::pair<unsign | ||
+ return std::make_pair(T | ||
} | ||
}; | ||
@@ -573,6 +573,33 @@ static bool ParseCodeGenArgs | ||
if (!Opts.ProfileIn | ||
setPGOUseInstrum | ||
+ if (Arg *A = Args.getLastArg( | ||
+ Opts.setClangABI | ||
+ | ||
+ StringRef Ver = A->getValue(); | ||
+ std::pair<String | ||
+ unsigned Major, Minor = 0; | ||
+ | ||
+ // Check the version number is valid: either 3.x (0 <= x <= 9) or | ||
+ // y or y.0 (4 <= y <= current version). | ||
+ if (!VerParts.first | ||
+ !VerParts.first. | ||
+ 3 <= Major && Major <= CLANG_VERSION_MA | ||
+ (Major == 3 ? VerParts.second. | ||
+ !VerParts.second | ||
+ : VerParts.first.s | ||
+ VerParts.second == "0")) { | ||
+ // Got a valid version number. | ||
+ if (Major == 3 && Minor <= 8) | ||
+ Opts.setClangABI | ||
+ else if (Major <= 4) | ||
+ Opts.setClangABI | ||
+ } else if (Ver != "latest") { | ||
+ Diags.Report(dia | ||
+ << A->getAsString(A | ||
+ } | ||
+ } | ||
+ | ||
Opts.CoverageMap | ||
Args.hasFlag(OPT | ||
Opts.DumpCoverag |
@@ -76,13 +76,7 @@ typedef intptr_t _sleb128_t; | ||
typedef uintptr_t _uleb128_t; | ||
struct _Unwind_Context; | ||
-#if defined(__arm__) | ||
-struct _Unwind_Control_ | ||
-typedef struct _Unwind_Control_ | ||
-#else | ||
struct _Unwind_Exceptio | ||
-typedef struct _Unwind_Exceptio | ||
-#endif | ||
typedef enum { | ||
_URC_NO_REASON = 0, | ||
#if defined(__arm__) | ||
@@ -115,42 +109,8 @@ typedef enum { | ||
} _Unwind_Action; | ||
typedef void (*_Unwind_Except | ||
- _Unwind_Exceptio | ||
- | ||
-#if defined(__arm__) | ||
-typedef struct _Unwind_Control_ | ||
-typedef uint32_t _Unwind_EHT_Head | ||
- | ||
-struct _Unwind_Control_ | ||
- uint64_t exception_class; | ||
- void (*exception_clea | ||
- /* unwinder cache (private fields for the unwinder's use) */ | ||
- struct { | ||
- uint32_t reserved1; /* forced unwind stop function, 0 if not forced */ | ||
- uint32_t reserved2; /* personality routine */ | ||
- uint32_t reserved3; /* callsite */ | ||
- uint32_t reserved4; /* forced unwind stop argument */ | ||
- uint32_t reserved5; | ||
- } unwinder_cache; | ||
- /* propagation barrier cache (valid after phase 1) */ | ||
- struct { | ||
- uint32_t sp; | ||
- uint32_t bitpattern[5]; | ||
- } barrier_cache; | ||
- /* cleanup cache (preserved over cleanup) */ | ||
- struct { | ||
- uint32_t bitpattern[4]; | ||
- } cleanup_cache; | ||
- /* personality cache (for personality's benefit) */ | ||
- struct { | ||
- uint32_t fnstart; /* function start address */ | ||
- _Unwind_EHT_Head | ||
- uint32_t additional; /* additional data */ | ||
- uint32_t reserved1; | ||
- } pr_cache; | ||
- long long int : 0; /* force alignment of next item to 8-byte boundary */ | ||
-}; | ||
-#else | ||
+ struct _Unwind_Exceptio | ||
+ | ||
struct _Unwind_Exceptio | ||
_Unwind_Exceptio | ||
_Unwind_Exceptio | ||
@@ -160,24 +120,23 @@ struct _Unwind_Exceptio | ||
* aligned". GCC has interpreted this to mean "use the maximum useful | ||
* alignment for the target"; so do we. */ | ||
} __attribute__((_ | ||
-#endif | ||
typedef _Unwind_Reason_C | ||
_Unwind_Exceptio | ||
- _Unwind_Exceptio | ||
+ struct _Unwind_Exceptio | ||
struct _Unwind_Context *, | ||
void *); | ||
-typedef _Unwind_Reason_C | ||
- _Unwind_Exceptio | ||
- _Unwind_Exceptio | ||
- struct _Unwind_Context *); | ||
+typedef _Unwind_Reason_C | ||
+ int, _Unwind_Action, _Unwind_Exceptio | ||
+ struct _Unwind_Context *); | ||
typedef _Unwind_Personal | ||
typedef _Unwind_Reason_C | ||
void *); | ||
-#if defined(__arm__) | ||
+#if defined(__arm__) | ||
+ | ||
typedef enum { | ||
_UVRSC_CORE = 0, /* integer register */ | ||
_UVRSC_VFP = 1, /* vfp */ | ||
@@ -199,12 +158,14 @@ typedef enum { | ||
_UVRSR_FAILED = 2 | ||
} _Unwind_VRS_Resu | ||
+#if !defined(__USING | ||
typedef uint32_t _Unwind_State; | ||
#define _US_VIRTUAL_UNWI | ||
#define _US_UNWIND_FRAME | ||
#define _US_UNWIND_FRAME | ||
#define _US_ACTION_MASK ((_Unwind_State) | ||
#define _US_FORCE_UNWIND | ||
+#endif | ||
_Unwind_VRS_Resu | ||
_Unwind_VRS_RegC | ||
@@ -263,12 +224,13 @@ _Unwind_Ptr _Unwind_GetRegio | ||
/* DWARF EH functions; currently not available on Darwin/ARM */ | ||
#if !defined(__APPLE | ||
-_Unwind_Reason_ | ||
-_Unwind_Reason_ | ||
- void *); | ||
-void _Unwind_DeleteEx | ||
-void _Unwind_Resume(_ | ||
-_Unwind_Reason_ | ||
+ | ||
+_Unwind_Reason_ | ||
+_Unwind_Reason_ | ||
+ _Unwind_Stop_Fn, | ||
+void _Unwind_DeleteEx | ||
+void _Unwind_Resume(s | ||
+_Unwind_Reason_ | ||
#endif | ||
@@ -279,11 +241,11 @@ typedef struct SjLj_Function_Co | ||
void _Unwind_SjLj_Reg | ||
void _Unwind_SjLj_Unr | ||
-_Unwind_Reason_ | ||
-_Unwind_Reason_ | ||
+_Unwind_Reason_ | ||
+_Unwind_Reason_ | ||
_Unwind_Stop_Fn, | ||
-void _Unwind_SjLj_Res | ||
-_Unwind_Reason_ | ||
+void _Unwind_SjLj_Res | ||
+_Unwind_Reason_ | ||
void *_Unwind_FindEnc | ||
@@ -458,10 +458,16 @@ bool Preprocessor::Ha | ||
SourceMgr.setNum | ||
} | ||
+ bool ExitedFromPredef | ||
FileID ExitedFID; | ||
- if (Callbacks && !isEndOfMacro && CurPPLexer) | ||
+ if (!isEndOfMacro && CurPPLexer) { | ||
ExitedFID = CurPPLexer->getF | ||
+ assert(Predefine | ||
+ "HandleEndOfFile | ||
+ ExitedFromPredef | ||
+ } | ||
+ | ||
if (LeavingSubmodul | ||
// We're done with this submodule. | ||
Module *M = LeaveSubmodule(/ | ||
@@ -489,6 +495,11 @@ bool Preprocessor::Ha | ||
PPCallbacks::Exi | ||
} | ||
+ // Restore conditional stack from the preamble right after exiting from the | ||
+ // predefines file. | ||
+ if (ExitedFromPrede | ||
+ replayPreambleCo | ||
+ | ||
// Client should lex another token unless we generated an EOM. | ||
return LeavingSubmodule | ||
} |
@@ -540,6 +540,8 @@ void Preprocessor::En | ||
void Preprocessor::re | ||
// Restore the conditional stack from the preamble, if there is one. | ||
if (PreambleConditi | ||
+ assert(CurPPLexe | ||
+ "CurPPLexer is null when calling replayPreambleCo | ||
CurPPLexer->setC | ||
PreambleConditio | ||
} |
@@ -516,8 +516,6 @@ void Parser::Initiali | ||
// Prime the lexer look-ahead. | ||
ConsumeToken(); | ||
- | ||
- PP.replayPreambl | ||
} | ||
void Parser::LateTemp |
@@ -5726,6 +5726,53 @@ static void DefineImplicitSp | ||
} | ||
} | ||
+/// Determine whether a type is permitted to be passed or returned in | ||
+/// registers, per C++ [class.temporary | ||
+static bool computeCanPassIn | ||
+ if (D->isDependentT | ||
+ return false; | ||
+ | ||
+ // Per C++ [class.temporary | ||
+ // each copy constructor, move constructor, and destructor of X is | ||
+ // either trivial or deleted, and X has at least one non-deleted copy | ||
+ // or move constructor | ||
+ bool HasNonDeletedCop | ||
+ | ||
+ if (D->needsImplici | ||
+ !D->defaultedCop | ||
+ if (!D->hasTrivialC | ||
+ return false; | ||
+ HasNonDeletedCop | ||
+ } | ||
+ | ||
+ if (S.getLangOpts() | ||
+ !D->defaultedMov | ||
+ if (!D->hasTrivialM | ||
+ return false; | ||
+ HasNonDeletedCop | ||
+ } | ||
+ | ||
+ if (D->needsImplici | ||
+ !D->hasTrivialDe | ||
+ return false; | ||
+ | ||
+ for (const CXXMethodDecl *MD : D->methods()) { | ||
+ if (MD->isDeleted() | ||
+ continue; | ||
+ | ||
+ auto *CD = dyn_cast<CXXCons | ||
+ if (CD && CD->isCopyOrMove | ||
+ HasNonDeletedCop | ||
+ else if (!isa<CXXDestruc | ||
+ continue; | ||
+ | ||
+ if (!MD->isTrivial( | ||
+ return false; | ||
+ } | ||
+ | ||
+ return HasNonDeletedCop | ||
+} | ||
+ | ||
/// \brief Perform semantic checks on a class definition that has been | ||
/// completing, introducing implicitly-decla | ||
/// abstract types, etc. | ||
@@ -5870,6 +5917,8 @@ void Sema::CheckCompl | ||
} | ||
checkClassLevelD | ||
+ | ||
+ Record->setCanPa | ||
} | ||
/// Look up the special member function that would be called by a special | ||
@@ -7496,8 +7545,7 @@ void Sema::ActOnFinis | ||
reinterpret_cast | ||
FieldCollector-> | ||
- CheckCompletedCX | ||
- dyn_cast_or_null | ||
+ CheckCompletedCX | ||
} | ||
/// AddImplicitlyDec | ||
@@ -11929,8 +11977,10 @@ CXXConstructorDe | ||
Scope *S = getScopeForConte | ||
CheckImplicitSpe | ||
- if (ShouldDeleteSpe | ||
+ if (ShouldDeleteSpe | ||
+ ClassDecl->setIm | ||
SetDeclDeleted(C | ||
+ } | ||
if (S) | ||
PushOnScopeChain |
@@ -872,7 +872,7 @@ SelectPropertyFo | ||
} | ||
QualType RHSType = S.Context.getCan | ||
- unsigned OriginalAttribut | ||
+ unsigned OriginalAttribut | ||
enum MismatchKind { | ||
IncompatibleType | ||
HasNoExpectedAtt | ||
@@ -890,7 +890,7 @@ SelectPropertyFo | ||
SmallVector<Mism | ||
for (ObjCPropertyDec | ||
// Verify the property attributes. | ||
- unsigned Attr = Prop->getPropert | ||
+ unsigned Attr = Prop->getPropert | ||
if (Attr != OriginalAttribut | ||
auto Diag = [&](bool OriginalHasAttri | ||
MismatchKind Kind = OriginalHasAttri |
@@ -1559,9 +1559,11 @@ void ASTDeclReader::R | ||
Data.HasUninitia | ||
Data.HasInherite | ||
Data.HasInherite | ||
+ Data.NeedOverloa | ||
Data.NeedOverloa | ||
Data.NeedOverloa | ||
Data.NeedOverloa | ||
+ Data.DefaultedCo | ||
Data.DefaultedMo | ||
Data.DefaultedMo | ||
Data.DefaultedDe | ||
@@ -1570,6 +1572,7 @@ void ASTDeclReader::R | ||
Data.HasIrreleva | ||
Data.HasConstexp | ||
Data.HasDefaulte | ||
+ Data.CanPassInRe | ||
Data.DefaultedDe | ||
Data.HasConstexp | ||
Data.HasNonLiter | ||
@@ -1697,9 +1700,11 @@ void ASTDeclReader::M | ||
MATCH_FIELD(HasU | ||
MATCH_FIELD(HasI | ||
MATCH_FIELD(HasI | ||
+ MATCH_FIELD(Need | ||
MATCH_FIELD(Need | ||
MATCH_FIELD(Need | ||
MATCH_FIELD(Need | ||
+ MATCH_FIELD(Defa | ||
MATCH_FIELD(Defa | ||
MATCH_FIELD(Defa | ||
MATCH_FIELD(Defa | ||
@@ -1708,6 +1713,7 @@ void ASTDeclReader::M | ||
MATCH_FIELD(HasI | ||
OR_FIELD(HasCons | ||
OR_FIELD(HasDefa | ||
+ MATCH_FIELD(CanP | ||
MATCH_FIELD(Defa | ||
OR_FIELD(HasCons | ||
MATCH_FIELD(HasN |
@@ -5874,9 +5874,11 @@ void ASTRecordWriter: | ||
Record->push_bac | ||
Record->push_bac | ||
Record->push_bac | ||
+ Record->push_bac | ||
Record->push_bac | ||
Record->push_bac | ||
Record->push_bac | ||
+ Record->push_bac | ||
Record->push_bac | ||
Record->push_bac | ||
Record->push_bac | ||
@@ -5885,6 +5887,7 @@ void ASTRecordWriter: | ||
Record->push_bac | ||
Record->push_bac | ||
Record->push_bac | ||
+ Record->push_bac | ||
Record->push_bac | ||
Record->push_bac | ||
Record->push_bac |
@@ -409,6 +409,19 @@ public: // Part of public interface to class. | ||
// BindDefault is only used to initialize a region with a default value. | ||
StoreRef BindDefault(Stor | ||
+ // FIXME: The offsets of empty bases can be tricky because of | ||
+ // of the so called "empty base class optimization". | ||
+ // If a base class has been optimized out | ||
+ // we should not try to create a binding, otherwise we should. | ||
+ // Unfortunately, at the moment ASTRecordLayout doesn't expose | ||
+ // the actual sizes of the empty bases | ||
+ // and trying to infer them from offsets/alignmen | ||
+ // seems to be error-prone and non-trivial because of the trailing padding. | ||
+ // As a temporary mitigation we don't create bindings for empty bases. | ||
+ if (R->getKind() == MemRegion::CXXBa | ||
+ cast<CXXBaseObje | ||
+ return StoreRef(store, *this); | ||
+ | ||
RegionBindingsRe | ||
assert(!B.lookup | ||
@@ -198,9 +198,14 @@ Status TCPSocket::Liste | ||
::setsockopt(fd, | ||
sizeof(option_va | ||
- address.SetPort( | ||
- | ||
- int err = ::bind(fd, &address.sockadd | ||
+ SocketAddress listen_address = address; | ||
+ if(!listen_addre | ||
+ listen_address.S | ||
+ else | ||
+ listen_address.S | ||
+ | ||
+ int err = | ||
+ ::bind(fd, &listen_address. | ||
if (-1 != err) | ||
err = ::listen(fd, backlog); | ||
@@ -36,8 +36,7 @@ struct GPR { | ||
struct FPR_i386 { | ||
uint16_t fctrl; // FPU Control Word (fcw) | ||
uint16_t fstat; // FPU Status Word (fsw) | ||
- uint8_t ftag; // FPU Tag Word (ftw) | ||
- uint8_t reserved_1; // Reserved | ||
+ uint16_t ftag; // FPU Tag Word (ftw) | ||
uint16_t fop; // Last Instruction Opcode (fop) | ||
union { | ||
struct { |
@@ -257,8 +257,7 @@ struct XMMReg { | ||
struct FXSAVE { | ||
uint16_t fctrl; // FPU Control Word (fcw) | ||
uint16_t fstat; // FPU Status Word (fsw) | ||
- uint8_t ftag; // FPU Tag Word (ftw) | ||
- uint8_t reserved_1; // Reserved | ||
+ uint16_t ftag; // FPU Tag Word (ftw) | ||
uint16_t fop; // Last Instruction Opcode (fop) | ||
union { | ||
struct { |
@@ -687,6 +687,59 @@ matchall_body() | ||
atf_check -s exit:1 grep "" test1 | ||
} | ||
+ | ||
+atf_test_case fgrep_multipatte | ||
+fgrep_multipatt | ||
+{ | ||
+ atf_set "descr" "Check proper behavior with multiple patterns supplied to fgrep" | ||
+} | ||
+fgrep_multipatt | ||
+{ | ||
+ printf "Foo\nBar\nBaz" > test1 | ||
+ | ||
+ atf_check -o inline:"Foo\nBaz | ||
+ atf_check -o inline:"Foo\nBaz | ||
+ atf_check -o inline:"Bar\nBaz | ||
+} | ||
+ | ||
+atf_test_case fgrep_icase | ||
+fgrep_icase_hea | ||
+{ | ||
+ atf_set "descr" "Check proper handling of -i supplied to fgrep" | ||
+} | ||
+fgrep_icase_bod | ||
+{ | ||
+ printf "Foo\nBar\nBaz" > test1 | ||
+ | ||
+ atf_check -o inline:"Foo\nBaz | ||
+ atf_check -o inline:"Foo\nBaz | ||
+ atf_check -o inline:"Bar\nBaz | ||
+ atf_check -o inline:"Bar\nBaz | ||
+} | ||
+ | ||
+atf_test_case fgrep_oflag | ||
+fgrep_oflag_hea | ||
+{ | ||
+ atf_set "descr" "Check proper handling of -o supplied to fgrep" | ||
+} | ||
+fgrep_oflag_bod | ||
+{ | ||
+ printf "abcdefghi\n" > test1 | ||
+ | ||
+ atf_check -o inline:"a\n" grep -Fo "a" test1 | ||
+ atf_check -o inline:"i\n" grep -Fo "i" test1 | ||
+ atf_check -o inline:"abc\n" grep -Fo "abc" test1 | ||
+ atf_check -o inline:"fgh\n" grep -Fo "fgh" test1 | ||
+ atf_check -o inline:"cde\n" grep -Fo "cde" test1 | ||
+ atf_check -o inline:"bcd\n" grep -Fo -e "bcd" -e "cde" test1 | ||
+ atf_check -o inline:"bcd\nefg | ||
+ | ||
+ atf_check -s exit:1 grep -Fo "xabc" test1 | ||
+ atf_check -s exit:1 grep -Fo "abcx" test1 | ||
+ atf_check -s exit:1 grep -Fo "xghi" test1 | ||
+ atf_check -s exit:1 grep -Fo "ghix" test1 | ||
+ atf_check -s exit:1 grep -Fo "abcdefghiklmnop | ||
+} | ||
# End FreeBSD | ||
atf_init_test_ca | ||
@@ -728,5 +781,8 @@ atf_init_test_ca | ||
atf_add_test_cas | ||
atf_add_test_cas | ||
atf_add_test_cas | ||
+ atf_add_test_cas | ||
+ atf_add_test_cas | ||
+ atf_add_test_cas | ||
# End FreeBSD | ||
} |
@@ -19,7 +19,7 @@ | ||
* | ||
* Defined types: load_avg for load averages, pctcpu for cpu percentages. | ||
*/ | ||
-#if defined(mips) && !(defined(NetBSD | ||
+#if defined(__mips__ | ||
# include <sys/fixpoint.h> | ||
# if defined(FBITS) && !defined(FSCALE) | ||
# define FSCALE (1 << FBITS) /* RISC/os on mips */ |
@@ -1571,6 +1571,11 @@ key_matches_a_ds | ||
verbose(VERB_ALG | ||
continue; | ||
} | ||
+ /* match of hash is sufficient for bootstrap of trust point */ | ||
+ (void)reason; | ||
+ (void)ve; | ||
+ return 1; | ||
+ /* no need to check RRSIG, DS hash already matched with source | ||
if(dnskey_verify | ||
dnskey_rrset, key_idx, &reason) == sec_status_secur | ||
return 1; | ||
@@ -1578,6 +1583,7 @@ key_matches_a_ds | ||
verbose(VERB_ALG | ||
"does not verify the keyset: %s", reason); | ||
} | ||
+ */ | ||
} | ||
return 0; | ||
} |
@@ -494,7 +494,7 @@ int ZEXPORT deflateResetKeep | ||
s->wrap == 2 ? crc32(0L, Z_NULL, 0) : | ||
#endif | ||
adler32(0L, Z_NULL, 0); | ||
- s->last_flush = Z_NO_FLUSH; | ||
+ s->last_flush = -2; | ||
_tr_init(s); | ||
@@ -587,12 +587,12 @@ int ZEXPORT deflateParams(st | ||
func = configuration_ta | ||
if ((strategy != s->strategy || func != configuration_ta | ||
- s->high_water) { | ||
+ s->last_flush != -2) { | ||
/* Flush the last buffer: */ | ||
int err = deflate(strm, Z_BLOCK); | ||
if (err == Z_STREAM_ERROR) | ||
return err; | ||
- if (strm->avail_out | ||
+ if (strm->avail_in || (s->strstart - s->block_start) + s->lookahead) | ||
return Z_BUF_ERROR; | ||
} | ||
if (s->level != level) { |
@@ -712,11 +712,12 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, | ||
used to switch between compression and straight copy of the input data, or | ||
to switch to a different kind of input data requiring a different strategy. | ||
If the compression approach (which is a function of the level) or the | ||
- strategy is changed, and if any input has been consumed in a previous | ||
- deflate() call, then the input available so far is compressed with the old | ||
- level and strategy using deflate(strm, Z_BLOCK). There are three approaches | ||
- for the compression levels 0, 1..3, and 4..9 respectively. The new level | ||
- and strategy will take effect at the next call of deflate(). | ||
+ strategy is changed, and if there have been any deflate() calls since the | ||
+ state was initialized or reset, then the input available so far is | ||
+ compressed with the old level and strategy using deflate(strm, Z_BLOCK). | ||
+ There are three approaches for the compression levels 0, 1..3, and 4..9 | ||
+ respectively. The new level and strategy will take effect at the next call | ||
+ of deflate(). | ||
If a deflate(strm, Z_BLOCK) is performed by deflateParams(), | ||
not have enough output space to complete, then the parameter change will not |
@@ -39,4 +39,4 @@ outlined on that page and do not file a public issue. | ||
## License | ||
By contributing to Zstandard, you agree that your contributions will be licensed | ||
-under the [LICENSE](LICENS | ||
+under both the [LICENSE](LICENS |
@@ -74,12 +74,9 @@ zstdmt: | ||
zlibwrapper: | ||
$(MAKE) -C $(ZWRAPDIR) test | ||
-.PHONY: shortest | ||
-shortest: | ||
- $(MAKE) -C $(TESTDIR) $@ | ||
- | ||
-.PHONY: test | ||
-test: | ||
+.PHONY: test shortest | ||
+test shortest: | ||
+ $(MAKE) -C $(PRGDIR) allVariants | ||
$(MAKE) -C $(TESTDIR) $@ | ||
.PHONY: examples | ||
@@ -146,6 +143,11 @@ gcc6build: clean | ||
gcc-6 -v | ||
CC=gcc-6 $(MAKE) all MOREFLAGS="-Werr | ||
+.PHONY: gcc7build | ||
+gcc7build: clean | ||
+ gcc-7 -v | ||
+ CC=gcc-7 $(MAKE) all MOREFLAGS="-Werr | ||
+ | ||
.PHONY: clangbuild | ||
clangbuild: clean | ||
clang -v | ||
@@ -180,7 +182,7 @@ ppc64fuzz: clean | ||
CC=powerpc-linux | ||
gpptest: clean | ||
- CC=g++ $(MAKE) -C $(PRGDIR) all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror" | ||
+ CC=$(CXX) $(MAKE) -C $(PRGDIR) all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror" | ||
gcc5test: clean | ||
gcc-5 -v |
@@ -1,3 +1,18 @@ | ||
+v1.3.1 | ||
+New license : BSD + GPLv2 | ||
+perf: substantially decreased memory usage in Multi-threading mode, thanks to reports by Tino Reichardt (@mcmilk) | ||
+perf: Multi-threading supports up to 256 threads. Cap at 256 when more are requested (#760) | ||
+cli : improved and fixed --list command, by @ib (#772) | ||
+cli : command -vV to list supported formats, by @ib (#771) | ||
+build : fixed binary variants, reported by @svenha (#788) | ||
+build : fix Visual compilation for non x86/x64 targets, reported by Greg Slazinski (@GregSlazinski) | ||
+API exp : breaking change : ZSTD_getframeHea | ||
+API exp : breaking change : pinned down values of error codes | ||
+doc : fixed huffman example, by Ulrich Kunitz (@ulikunitz) | ||
+new : contrib/adaptive | ||
+new : contrib/long_dis | ||
+updated : contrib/linux-ke | ||
+ | ||
v1.3.0 | ||
cli : new : `--list` command, by Paul Cruz | ||
cli : changed : xz/lzma support enabled by default |
@@ -1,33 +0,0 @@ | ||
-Additional Grant of Patent Rights Version 2 | ||
- | ||
-"Software" means the Zstandard software distributed by Facebook, Inc. | ||
- | ||
-Facebook, Inc. ("Facebook") hereby grants to each recipient of the Software | ||
-("you") a perpetual, worldwide, royalty-free, non-exclusive, irrevocable | ||
-(subject to the termination provision below) license under any Necessary | ||
-Claims, to make, have made, use, sell, offer to sell, import, and otherwise | ||
-transfer the Software. For avoidance of doubt, no license is granted under | ||
-Facebook’s rights in any patent claims that are infringed by (i) modifications | ||
-to the Software made by you or any third party or (ii) the Software in | ||
-combination with any software or other technology. | ||
- | ||
-The license granted hereunder will terminate, automatically and without notice, | ||
-if you (or any of your subsidiaries, corporate affiliates or agents) initiate | ||
-directly or indirectly, or take a direct financial interest in, any Patent | ||
-Assertion: (i) against Facebook or any of its subsidiaries or corporate | ||
-affiliates, (ii) against any party if such Patent Assertion arises in whole or | ||
-in part from any software, technology, product or service of Facebook or any of | ||
-its subsidiaries or corporate affiliates, or (iii) against any party relating | ||
-to the Software. Notwithstanding the foregoing, if Facebook or any of its | ||
-subsidiaries or corporate affiliates files a lawsuit alleging patent | ||
-infringement against you in the first instance, and you respond by filing a | ||
-patent infringement counterclaim in that lawsuit against that party that is | ||
-unrelated to the Software, the license granted hereunder will not terminate | ||
-under section (i) of this paragraph due to such counterclaim. | ||
- | ||
-A "Necessary Claim" is a claim of a patent owned by Facebook that is | ||
-necessarily infringed by the Software standing alone. | ||
- | ||
-A "Patent Assertion" is any lawsuit or other action alleging direct, indirect, | ||
-or contributory infringement or inducement to infringe any patent, including a | ||
-cross-claim or counterclaim. |
@@ -134,12 +134,12 @@ Going into `build` directory, you will find additional possibilities : | ||
### Status | ||
-Zstandard is currently deployed within Facebook. It is used daily to compress and decompress very large amounts of data in multiple formats and use cases. | ||
+Zstandard is currently deployed within Facebook. It is used continuously to compress large amounts of data in multiple formats and use cases. | ||
Zstandard is considered safe for production environments. | ||
### License | ||
-Zstandard is [BSD-licensed](L | ||
+Zstandard is dual-licensed under [BSD](LICENSE) and [GPLv2](COPYING) | ||
### Contributing | ||
@@ -3,7 +3,7 @@ dependencies: | ||
- sudo dpkg --add-architectu | ||
- sudo add-apt-reposito | ||
- sudo apt-get -y install gcc-powerpc-linu | ||
- - sudo apt-get -y install libstdc++-6-dev clang gcc g++ gcc-5 gcc-6 zlib1g-dev liblzma-dev | ||
+ - sudo apt-get -y install libstdc++-7-dev clang gcc g++ gcc-5 gcc-6 gcc-7 zlib1g-dev liblzma-dev | ||
- sudo apt-get -y install linux-libc-dev:i | ||
test: | ||
@@ -45,7 +45,7 @@ test: | ||
parallel: true | ||
- ? | | ||
if [[ "$CIRCLE_NODE_IN | ||
- if [[ "$CIRCLE_NODE_TO | ||
+ if [[ "$CIRCLE_NODE_TO | ||
: | ||
parallel: true | ||
- ? | | ||
@@ -64,7 +64,7 @@ test: | ||
#- gcc -v; make -C tests test32 MOREFLAGS="-I/us | ||
#- make uasan && make clean | ||
#- make asan32 && make clean | ||
- #- make -C tests test32 CC=clang MOREFLAGS="-g -fsanitize=addre | ||
+ #- make -C tests test32 CC=clang MOREFLAGS="-g -fsanitize=addre | ||
# Valgrind tests | ||
#- CFLAGS="-O1 -g" make -C zlibWrapper valgrindTest && make clean | ||
#- make -C tests valgrindTest && make clean |
@@ -87,7 +87,7 @@ int main(int argc, char **argv) { | ||
} | ||
size_t decompressed_siz | ||
- if (decompressed_si | ||
+ if (decompressed_si | ||
decompressed_siz | ||
fprintf(stderr, "WARNING: Compressed data does not contain " | ||
"decompressed size, going to assume the compression " | ||
@@ -106,9 +106,15 @@ int main(int argc, char **argv) { | ||
return 1; | ||
} | ||
+ dictionary_t* const parsed_dict = create_dictionar | ||
+ if (dict) { | ||
+ parse_dictionary | ||
+ } | ||
size_t decompressed = | ||
ZSTD_decompress_ | ||
- input, input_size, dict, dict_size); | ||
+ input, input_size, parsed_dict); | ||
+ | ||
+ free_dictionary( | ||
write_file(argv[ | ||
@@ -117,4 +123,3 @@ int main(int argc, char **argv) { | ||
free(dict); | ||
input = output = dict = NULL; | ||
} | ||
- |
@@ -14,21 +14,7 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
- | ||
-/// Zstandard decompression functions. | ||
-/// `dst` must point to a space at least as large as the reconstructed output. | ||
-size_t ZSTD_decompress( | ||
- const void *const src, const size_t src_len); | ||
-/// If `dict != NULL` and `dict_len >= 8`, does the same thing as | ||
-/// `ZSTD_decompress | ||
-size_t ZSTD_decompress_ | ||
- const void *const src, const size_t src_len, | ||
- const void *const dict, const size_t dict_len); | ||
- | ||
-/// Get the decompressed size of an input stream so memory can be allocated in | ||
-/// advance | ||
-/// Returns -1 if the size can't be determined | ||
-size_t ZSTD_get_decompr | ||
+#include "zstd_decompress | ||
/******* UTILITY MACROS AND TYPES **************** | ||
// Max block size decompressed size is 128 KB and literal blocks can't be | ||
@@ -108,10 +94,10 @@ static inline size_t IO_istream_len(c | ||
/// Advances the stream by `len` bytes, and returns a pointer to the chunk that | ||
/// was skipped. The stream must be byte aligned. | ||
-static inline const u8 *IO_read_bytes(i | ||
+static inline const u8 *IO_get_read_ptr | ||
/// Advances the stream by `len` bytes, and returns a pointer to the chunk that | ||
/// was skipped so it can be written to. | ||
-static inline u8 *IO_write_bytes( | ||
+static inline u8 *IO_get_write_pt | ||
/// Advance the inner state by `len` bytes. The stream must be byte aligned. | ||
static inline void IO_advance_input | ||
@@ -307,7 +293,7 @@ typedef struct { | ||
/// The decoded contents of a dictionary so that it doesn't have to be repeated | ||
/// for each frame that uses it | ||
-typedef struct { | ||
+struct dictionary_s { | ||
// Entropy tables | ||
HUF_dtable literals_dtable; | ||
FSE_dtable ll_dtable; | ||
@@ -322,7 +308,7 @@ typedef struct { | ||
u64 previous_offsets | ||
u32 dictionary_id; | ||
-} dictionary_t; | ||
+}; | ||
/// A tuple containing the parts necessary to decode and execute a ZSTD sequence | ||
/// command | ||
@@ -367,27 +353,36 @@ static void execute_sequence | ||
const sequence_command | ||
const size_t num_sequences); | ||
-// Parse a provided dictionary blob for use in decompression | ||
-static void parse_dictionary | ||
- size_t src_len); | ||
-static void free_dictionary( | ||
+// Copies literals and returns the total literal length that was copied | ||
+static u32 copy_literals(co | ||
+ ostream_t *const out); | ||
+ | ||
+// Given an offset code from a sequence command (either an actual offset value | ||
+// or an index for previous offset), computes the correct offset and udpates | ||
+// the offset history | ||
+static size_t compute_offset(s | ||
+ | ||
+// Given an offset, match length, and total output, as well as the frame | ||
+// context for the dictionary, determines if the dictionary is used and | ||
+// executes the copy operation | ||
+static void execute_match_co | ||
+ size_t match_length, size_t total_output, | ||
+ ostream_t *const out); | ||
+ | ||
/******* END ZSTD HELPER STRUCTS AND PROTOTYPES **************** | ||
size_t ZSTD_decompress( | ||
const void *const src, const size_t src_len) { | ||
- return ZSTD_decompress_ | ||
+ dictionary_t* uninit_dict = create_dictionar | ||
+ size_t const decomp_size = ZSTD_decompress_ | ||
+ src_len, uninit_dict); | ||
+ free_dictionary( | ||
+ return decomp_size; | ||
} | ||
size_t ZSTD_decompress_ | ||
const void *const src, const size_t src_len, | ||
- const void *const dict, | ||
- const size_t dict_len) { | ||
- dictionary_t parsed_dict; | ||
- memset(&parsed_d | ||
- // dict_len < 8 is not a valid dictionary | ||
- if (dict && dict_len > 8) { | ||
- parse_dictionary | ||
- } | ||
+ dictionary_t* parsed_dict) { | ||
istream_t in = IO_make_istream( | ||
ostream_t out = IO_make_ostream( | ||
@@ -396,11 +391,9 @@ size_t ZSTD_decompress_ | ||
// Multiple frames can be appended into a single file or stream. A frame is | ||
// totally independent, has a defined beginning and end, and a set of | ||
// parameters which tells the decoder how to decompress it." | ||
- while (IO_istream_len( | ||
- decode_frame(&ou | ||
- } | ||
- free_dictionary( | ||
+ /* this decoder assumes decompression of a single frame */ | ||
+ decode_frame(&ou | ||
return out.ptr - (u8 *)dst; | ||
} | ||
@@ -424,30 +417,6 @@ static void decompress_data( | ||
static void decode_frame(ost | ||
const dictionary_t *const dict) { | ||
const u32 magic_number = IO_read_bits(in, | ||
- | ||
- // Skippable frame | ||
- // | ||
- // "Magic_Number | ||
- // | ||
- // 4 Bytes, little-endian format. Value : 0x184D2A5?, which means any value | ||
- // from 0x184D2A50 to 0x184D2A5F. All 16 values are valid to identify a | ||
- // skippable frame." | ||
- if ((magic_number & ~0xFU) == 0x184D2A50U) { | ||
- // "Skippable frames allow the insertion of user-defined data into a | ||
- // flow of concatenated frames. Its design is pretty straightforward, | ||
- // with the sole objective to allow the decoder to quickly skip over | ||
- // user-defined data and continue decoding. | ||
- // | ||
- // Skippable frames defined in this specification are compatible with | ||
- // LZ4 ones." | ||
- const size_t frame_size = IO_read_bits(in, | ||
- | ||
- // skip over frame | ||
- IO_advance_input | ||
- | ||
- return; | ||
- } | ||
- | ||
// Zstandard frame | ||
// | ||
// "Magic_Number | ||
@@ -460,8 +429,8 @@ static void decode_frame(ost | ||
return; | ||
} | ||
- // not a real frame | ||
- ERROR("Invalid magic number"); | ||
+ // not a real frame or a skippable frame | ||
+ ERROR("Tried to decode non-ZSTD frame"); | ||
} | ||
/// Decode a frame that contains compressed data. Not all frames do as there | ||
@@ -672,8 +641,8 @@ static void decompress_data( | ||
case 0: { | ||
// "Raw_Block - this is an uncompressed block. Block_Size is the | ||
// number of bytes to read and copy." | ||
- const u8 *const read_ptr = IO_read_bytes(in | ||
- u8 *const write_ptr = IO_write_bytes(o | ||
+ const u8 *const read_ptr = IO_get_read_ptr( | ||
+ u8 *const write_ptr = IO_get_write_ptr | ||
// Copy the raw data into the output | ||
memcpy(write_ptr | ||
@@ -685,8 +654,8 @@ static void decompress_data( | ||
// "RLE_Block - this is a single byte, repeated N times. In which | ||
// case, Block_Size is the size to regenerate, while the | ||
// "compressed" block is just 1 byte (the byte to repeat)." | ||
- const u8 *const read_ptr = IO_read_bytes(in | ||
- u8 *const write_ptr = IO_write_bytes(o | ||
+ const u8 *const read_ptr = IO_get_read_ptr( | ||
+ u8 *const write_ptr = IO_get_write_ptr | ||
// Copy `block_len` copies of `read_ptr[0]` to the output | ||
memset(write_ptr | ||
@@ -832,13 +801,13 @@ static size_t decode_literals_ | ||
switch (block_type) { | ||
case 0: { | ||
// "Raw_Literals_Bl | ||
- const u8 *const read_ptr = IO_read_bytes(in | ||
+ const u8 *const read_ptr = IO_get_read_ptr( | ||
memcpy(*literals | ||
break; | ||
} | ||
case 1: { | ||
// "RLE_Literals_Bl | ||
- const u8 *const read_ptr = IO_read_bytes(in | ||
+ const u8 *const read_ptr = IO_get_read_ptr( | ||
memset(*literals | ||
break; | ||
} | ||
@@ -949,7 +918,7 @@ static void decode_huf_table | ||
num_symbs = header - 127; | ||
const size_t bytes = (num_symbs + 1) / 2; | ||
- const u8 *const weight_src = IO_read_bytes(in | ||
+ const u8 *const weight_src = IO_get_read_ptr( | ||
for (int i = 0; i < num_symbs; i++) { | ||
// "They are encoded forward, 2 | ||
@@ -1157,7 +1126,7 @@ static void decompress_seque | ||
} | ||
const size_t len = IO_istream_len(i | ||
- const u8 *const src = IO_read_bytes(in | ||
+ const u8 *const src = IO_get_read_ptr( | ||
// "After writing the last bit containing information, the compressor writes | ||
// a single 1-bit and then fills the byte with 0-7 0 bits of padding." | ||
@@ -1262,7 +1231,7 @@ static void decode_seq_table | ||
} | ||
case seq_rle: { | ||
// "RLE_Mode : it's a single code, repeated Number_of_Sequen | ||
- const u8 symb = IO_read_bytes(in | ||
+ const u8 symb = IO_get_read_ptr( | ||
FSE_init_dtable_ | ||
break; | ||
} | ||
@@ -1303,145 +1272,146 @@ static void execute_sequence | ||
for (size_t i = 0; i < num_sequences; i++) { | ||
const sequence_command | ||
- | ||
{ | ||
- // If the sequence asks for more literals than are left, the | ||
- // sequence must be corrupted | ||
- if (seq.literal_len | ||
- CORRUPTION(); | ||
- } | ||
+ const u32 literals_size = copy_literals(se | ||
+ total_output += literals_size; | ||
+ } | ||
- u8 *const write_ptr = IO_write_bytes(o | ||
- const u8 *const read_ptr = | ||
- IO_read_bytes(&l | ||
- // Copy literals to output | ||
- memcpy(write_ptr | ||
+ size_t const offset = compute_offset(s | ||
- total_output += seq.literal_leng | ||
- } | ||
+ size_t const match_length = seq.match_length | ||
- size_t offset; | ||
- | ||
- // Offsets are special, we need to handle the repeat offsets | ||
- if (seq.offset <= 3) { | ||
- // "The first 3 values define a repeated offset and we will call | ||
- // them Repeated_Offset1 | ||
- // They are sorted in recency order, with Repeated_Offset1 | ||
- // 'most recent one'". | ||
- | ||
- // Use 0 indexing for the array | ||
- u32 idx = seq.offset - 1; | ||
- if (seq.literal_len | ||
- // "There is an exception though, when current sequence's | ||
- // literals length is 0. In this case, repeated offsets are | ||
- // shifted by one, so Repeated_Offset1 | ||
- // Repeated_Offset2 | ||
- // Repeated_Offset3 | ||
- idx++; | ||
- } | ||
+ execute_match_co | ||
- if (idx == 0) { | ||
- offset = offset_hist[0]; | ||
- } else { | ||
- // If idx == 3 then literal length was 0 and the offset was 3, | ||
- // as per the exception listed above | ||
- offset = idx < 3 ? offset_hist[idx] | ||
- | ||
- // If idx == 1 we don't need to modify offset_hist[2], since | ||
- // we're using the second-most recent code | ||
- if (idx > 1) { | ||
- offset_hist[2] = offset_hist[1]; | ||
- } | ||
- offset_hist[1] = offset_hist[0]; | ||
- offset_hist[0] = offset; | ||
- } | ||
- } else { | ||
- // When it's not a repeat offset: | ||
- // "if (Offset_Value > 3) offset = Offset_Value - 3;" | ||
- offset = seq.offset - 3; | ||
+ total_output += match_length; | ||
+ } | ||
- // Shift back history | ||
- offset_hist[2] = offset_hist[1]; | ||
- offset_hist[1] = offset_hist[0]; | ||
- offset_hist[0] = offset; | ||
- } | ||
+ // Copy any leftover literals | ||
+ { | ||
+ size_t len = IO_istream_len(& | ||
+ copy_literals(le | ||
+ total_output += len; | ||
+ } | ||
- size_t match_length = seq.match_length | ||
+ ctx->current_tot | ||
+} | ||
- u8 *write_ptr = IO_write_bytes(o | ||
- if (total_output <= ctx->header.wind | ||
- // In this case offset might go back into the dictionary | ||
- if (offset > total_output + ctx->dict_conten | ||
- // The offset goes beyond even the dictionary | ||
- CORRUPTION(); | ||
- } | ||
+static u32 copy_literals(co | ||
+ ostream_t *const out) { | ||
+ // If the sequence asks for more literals than are left, the | ||
+ // sequence must be corrupted | ||
+ if (literal_length > IO_istream_len(l | ||
+ CORRUPTION(); | ||
+ } | ||
- if (offset > total_output) { | ||
- // "The rest of the dictionary is its content. The content act | ||
- // as a "past" in front of data to compress or decompress, so it | ||
- // can be referenced in sequence commands." | ||
- const size_t dict_copy = | ||
- MIN(offset - total_output, match_length); | ||
- const size_t dict_offset = | ||
- ctx->dict_conten | ||
- | ||
- memcpy(write_ptr | ||
- write_ptr += dict_copy; | ||
- match_length -= dict_copy; | ||
- } | ||
- } else if (offset > ctx->header.wind | ||
- CORRUPTION(); | ||
+ u8 *const write_ptr = IO_get_write_ptr | ||
+ const u8 *const read_ptr = | ||
+ IO_get_read_ptr( | ||
+ // Copy literals to output | ||
+ memcpy(write_ptr | ||
+ | ||
+ return literal_length; | ||
+} | ||
+ | ||
+static size_t compute_offset(s | ||
+ size_t offset; | ||
+ // Offsets are special, we need to handle the repeat offsets | ||
+ if (seq.offset <= 3) { | ||
+ // "The first 3 values define a repeated offset and we will call | ||
+ // them Repeated_Offset1 | ||
+ // They are sorted in recency order, with Repeated_Offset1 | ||
+ // 'most recent one'". | ||
+ | ||
+ // Use 0 indexing for the array | ||
+ u32 idx = seq.offset - 1; | ||
+ if (seq.literal_len | ||
+ // "There is an exception though, when current sequence's | ||
+ // literals length is 0. In this case, repeated offsets are | ||
+ // shifted by one, so Repeated_Offset1 | ||
+ // Repeated_Offset2 | ||
+ // Repeated_Offset3 | ||
+ idx++; | ||
} | ||
- // We must copy byte by byte because the match length might be larger | ||
- // than the offset | ||
- // ex: if the output so far was "abc", a command with offset=3 and | ||
- // match_length=6 would produce "abcabcabc" as the new output | ||
- for (size_t i = 0; i < match_length; i++) { | ||
- *write_ptr = *(write_ptr - offset); | ||
- write_ptr++; | ||
+ if (idx == 0) { | ||
+ offset = offset_hist[0]; | ||
+ } else { | ||
+ // If idx == 3 then literal length was 0 and the offset was 3, | ||
+ // as per the exception listed above | ||
+ offset = idx < 3 ? offset_hist[idx] | ||
+ | ||
+ // If idx == 1 we don't need to modify offset_hist[2], since | ||
+ // we're using the second-most recent code | ||
+ if (idx > 1) { | ||
+ offset_hist[2] = offset_hist[1]; | ||
+ } | ||
+ offset_hist[1] = offset_hist[0]; | ||
+ offset_hist[0] = offset; | ||
} | ||
+ } else { | ||
+ // When it's not a repeat offset: | ||
+ // "if (Offset_Value > 3) offset = Offset_Value - 3;" | ||
+ offset = seq.offset - 3; | ||
- total_output += seq.match_length | ||
+ // Shift back history | ||
+ offset_hist[2] = offset_hist[1]; | ||
+ offset_hist[1] = offset_hist[0]; | ||
+ offset_hist[0] = offset; | ||
} | ||
+ return offset; | ||
+} | ||
- // Copy any leftover literals | ||
- { | ||
- size_t len = IO_istream_len(& | ||
- u8 *const write_ptr = IO_write_bytes(o | ||
- const u8 *const read_ptr = IO_read_bytes(&l | ||
- memcpy(write_ptr | ||
+static void execute_match_co | ||
+ size_t match_length, size_t total_output, | ||
+ ostream_t *const out) { | ||
+ u8 *write_ptr = IO_get_write_ptr | ||
+ if (total_output <= ctx->header.wind | ||
+ // In this case offset might go back into the dictionary | ||
+ if (offset > total_output + ctx->dict_conten | ||
+ // The offset goes beyond even the dictionary | ||
+ CORRUPTION(); | ||
+ } | ||
- total_output += len; | ||
+ if (offset > total_output) { | ||
+ // "The rest of the dictionary is its content. The content act | ||
+ // as a "past" in front of data to compress or decompress, so it | ||
+ // can be referenced in sequence commands." | ||
+ const size_t dict_copy = | ||
+ MIN(offset - total_output, match_length); | ||
+ const size_t dict_offset = | ||
+ ctx->dict_conten | ||
+ | ||
+ memcpy(write_ptr | ||
+ write_ptr += dict_copy; | ||
+ match_length -= dict_copy; | ||
+ } | ||
+ } else if (offset > ctx->header.wind | ||
+ CORRUPTION(); | ||
} | ||
- ctx->current_tot | ||
+ // We must copy byte by byte because the match length might be larger | ||
+ // than the offset | ||
+ // ex: if the output so far was "abc", a command with offset=3 and | ||
+ // match_length=6 would produce "abcabcabc" as the new output | ||
+ for (size_t j = 0; j < match_length; j++) { | ||
+ *write_ptr = *(write_ptr - offset); | ||
+ write_ptr++; | ||
+ } | ||
} | ||
/******* END SEQUENCE EXECUTION **************** | ||
/******* OUTPUT SIZE COUNTING **************** | ||
-static void traverse_frame(c | ||
- | ||
/// Get the decompressed size of an input stream so memory can be allocated in | ||
/// advance. | ||
-/// This is more complex than the implementation in the reference | ||
-/// implementation, as this API allows for the decompression of multiple | ||
-/// concatenated frames. | ||
+/// This implementation assumes `src` points to a single ZSTD-compressed frame | ||
size_t ZSTD_get_decompr | ||
istream_t in = IO_make_istream( | ||
- size_t dst_size = 0; | ||
- // Each frame header only gives us the size of its frame, so iterate over | ||
- // all | ||
- // frames | ||
- while (IO_istream_len( | ||
+ // get decompressed size from ZSTD frame header | ||
+ { | ||
const u32 magic_number = IO_read_bits(&in | ||
- if ((magic_number & ~0xFU) == 0x184D2A50U) { | ||
- // skippable frame, this has no impact on output size | ||
- const size_t frame_size = IO_read_bits(&in | ||
- IO_advance_input | ||
- } else if (magic_number == 0xFD2FB528U) { | ||
+ if (magic_number == 0xFD2FB528U) { | ||
// ZSTD frame | ||
frame_header_t header; | ||
parse_frame_head | ||
@@ -1451,68 +1421,42 @@ size_t ZSTD_get_decompr | ||
return -1; | ||
} | ||
- dst_size += header.frame_con | ||
- | ||
- // Consume the input from the frame to reach the start of the next | ||
- traverse_frame(& | ||
+ return header.frame_con | ||
} else { | ||
- // not a real frame | ||
- ERROR("Invalid magic number"); | ||
+ // not a real frame or skippable frame | ||
+ ERROR("ZSTD frame magic number did not match"); | ||
} | ||
} | ||
- | ||
- return dst_size; | ||
} | ||
+/******* END OUTPUT SIZE COUNTING **************** | ||
-/// Iterate over each block in a frame to find the end of it, to get to the | ||
-/// start of the next frame | ||
-static void traverse_frame(c | ||
- int last_block = 0; | ||
- | ||
- do { | ||
- // Parse the block header | ||
- last_block = IO_read_bits(in, | ||
- const int block_type = IO_read_bits(in, | ||
- const size_t block_len = IO_read_bits(in, | ||
- | ||
- switch (block_type) { | ||
- case 0: // Raw block, block_len bytes | ||
- IO_advance_input | ||
- break; | ||
- case 1: // RLE block, 1 byte | ||
- IO_advance_input | ||
- break; | ||
- case 2: // Compressed block, compressed size is block_len | ||
- IO_advance_input | ||
- break; | ||
- case 3: | ||
- // Reserved block type | ||
- CORRUPTION(); | ||
- break; | ||
- default: | ||
- IMPOSSIBLE(); | ||
- } | ||
- } while (!last_block); | ||
+/******* DICTIONARY PARSING **************** | ||
+#define DICT_SIZE_ERROR( | ||
+#define NULL_SRC() ERROR("Tried to create dictionary with pointer to null src"); | ||
- if (header->content | ||
- IO_advance_input | ||
+dictionary_t* create_dictionar | ||
+ dictionary_t* dict = calloc(1, sizeof(dictionar | ||
+ if (!dict) { | ||
+ BAD_ALLOC(); | ||
} | ||
+ return dict; | ||
} | ||
-/******* END OUTPUT SIZE COUNTING **************** | ||
- | ||
-/******* DICTIONARY PARSING **************** | ||
static void init_dictionary_ | ||
istream_t *const in); | ||
-static void parse_dictionary | ||
+void parse_dictionary | ||
size_t src_len) { | ||
+ const u8 *byte_src = (const u8 *)src; | ||
memset(dict, 0, sizeof(dictionar | ||
+ if (src == NULL) { /* cannot initialize dictionary with null src */ | ||
+ NULL_SRC(); | ||
+ } | ||
if (src_len < 8) { | ||
- INP_SIZE(); | ||
+ DICT_SIZE_ERROR( | ||
} | ||
- istream_t in = IO_make_istream( | ||
+ istream_t in = IO_make_istream( | ||
const u32 magic_number = IO_read_bits(&in | ||
if (magic_number != 0xEC30A437) { | ||
@@ -1564,13 +1508,13 @@ static void init_dictionary_ | ||
BAD_ALLOC(); | ||
} | ||
- const u8 *const content = IO_read_bytes(in | ||
+ const u8 *const content = IO_get_read_ptr( | ||
memcpy(dict->con | ||
} | ||
/// Free an allocated dictionary | ||
-static void free_dictionary( | ||
+void free_dictionary( | ||
HUF_free_dtable( | ||
FSE_free_dtable( | ||
FSE_free_dtable( | ||
@@ -1579,6 +1523,8 @@ static void free_dictionary( | ||
free(dict->conte | ||
memset(dict, 0, sizeof(dictionar | ||
+ | ||
+ free(dict); | ||
} | ||
/******* END DICTIONARY PARSING **************** | ||
@@ -1657,7 +1603,7 @@ static inline size_t IO_istream_len(c | ||
/// Returns a pointer where `len` bytes can be read, and advances the internal | ||
/// state. The stream must be byte aligned. | ||
-static inline const u8 *IO_read_bytes(i | ||
+static inline const u8 *IO_get_read_ptr | ||
if (len > in->len) { | ||
INP_SIZE(); | ||
} | ||
@@ -1671,7 +1617,7 @@ static inline const u8 *IO_read_bytes(i | ||
return ptr; | ||
} | ||
/// Returns a pointer to write `len` bytes to, and advances the internal state | ||
-static inline u8 *IO_write_bytes( | ||
+static inline u8 *IO_get_write_pt | ||
if (len > out->len) { | ||
OUT_SIZE(); | ||
} | ||
@@ -1710,7 +1656,7 @@ static inline istream_t IO_make_istream( | ||
/// `in` must be byte aligned | ||
static inline istream_t IO_make_sub_istr | ||
// Consume `len` bytes of the parent stream | ||
- const u8 *const ptr = IO_read_bytes(in | ||
+ const u8 *const ptr = IO_get_read_ptr( | ||
// Make a substream using the pointer to those `len` bytes | ||
return IO_make_istream( | ||
@@ -1814,7 +1760,7 @@ static size_t HUF_decompress_1 | ||
if (len == 0) { | ||
INP_SIZE(); | ||
} | ||
- const u8 *const src = IO_read_bytes(in | ||
+ const u8 *const src = IO_get_read_ptr( | ||
// "Each bitstream must be read backward, that is starting from the end down | ||
// to the beginning. Therefore it's necessary to know the size of each | ||
@@ -2065,7 +2011,7 @@ static size_t FSE_decompress_i | ||
if (len == 0) { | ||
INP_SIZE(); | ||
} | ||
- const u8 *const src = IO_read_bytes(in | ||
+ const u8 *const src = IO_get_read_ptr( | ||
// "Each bitstream must be read backward, that is starting from the end down | ||
// to the beginning. Therefore it's necessary to know the size of each | ||
@@ -2192,7 +2138,7 @@ static void FSE_init_dtable( | ||
} | ||
// Now we can fill baseline and num bits | ||
- for (int i = 0; i < size; i++) { | ||
+ for (size_t i = 0; i < size; i++) { | ||
u8 symbol = dtable->symbols[ | ||
u16 next_state_desc = state_desc[symbo | ||
// Fills in the table appropriately, next_state_desc increases by symbol | ||
@@ -2355,4 +2301,3 @@ static void FSE_copy_dtable( | ||
memcpy(dst->new_ | ||
} | ||
/******* END FSE PRIMITIVES **************** | ||
- |
@@ -7,10 +7,52 @@ | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
*/ | ||
+/******* EXPOSED TYPES **************** | ||
+/* | ||
+* Contains the parsed contents of a dictionary | ||
+* This includes Huffman and FSE tables used for decoding and data on offsets | ||
+*/ | ||
+typedef struct dictionary_s dictionary_t; | ||
+/******* END EXPOSED TYPES **************** | ||
+ | ||
+/******* DECOMPRESSION FUNCTIONS **************** | ||
+/// Zstandard decompression functions. | ||
+/// `dst` must point to a space at least as large as the reconstructed output. | ||
size_t ZSTD_decompress( | ||
- const void *const src, const size_t src_len); | ||
+ const void *const src, const size_t src_len); | ||
+ | ||
+/// If `dict != NULL` and `dict_len >= 8`, does the same thing as | ||
+/// `ZSTD_decompress | ||
size_t ZSTD_decompress_ | ||
- const void *const src, const size_t src_len, | ||
- const void *const dict, const size_t dict_len); | ||
+ const void *const src, const size_t src_len, | ||
+ dictionary_t* parsed_dict); | ||
+ | ||
+/// Get the decompressed size of an input stream so memory can be allocated in | ||
+/// advance | ||
+/// Returns -1 if the size can't be determined | ||
+/// Assumes decompression of a single frame | ||
size_t ZSTD_get_decompr | ||
+/******* END DECOMPRESSION FUNCTIONS **************** | ||
+ | ||
+/******* DICTIONARY MANAGEMENT **************** | ||
+/* | ||
+ * Return a valid dictionary_t pointer for use with dictionary initialization | ||
+ * or decompression | ||
+ */ | ||
+dictionary_t* create_dictionar | ||
+ | ||
+/* | ||
+ * Parse a provided dictionary blob for use in decompression | ||
+ * `src` -- must point to memory space representing the dictionary | ||
+ * `src_len` -- must provide the dictionary size | ||
+ * `dict` -- will contain the parsed contents of the dictionary and | ||
+ * can be used for decompression | ||
+ */ | ||
+void parse_dictionary | ||
+ size_t src_len); | ||
+/* | ||
+ * Free internal Huffman tables, FSE tables, and dictionary content | ||
+ */ | ||
+void free_dictionary( | ||
+/******* END DICTIONARY MANAGEMENT **************** |
@@ -16,7 +16,7 @@ Distribution of this document is unlimited. | ||
### Version | ||
-0.2.5 (31/03/17) | ||
+0.2.6 (19/08/17) | ||
Introduction | ||
@@ -106,7 +106,7 @@ The structure of a single Zstandard frame is following: | ||
| `Magic_Number` | `Frame_Header` |`Data_Block`| [More data blocks] | [`Content_Checks | ||
|:-------------- | ||
-| 4 bytes | 2-14 bytes | n bytes | | 0-4 bytes | | ||
+| 4 bytes | 2-14 bytes | n bytes | | 0-4 bytes | | ||
__`Magic_Number` | ||
@@ -1249,23 +1249,30 @@ Consequently, a last byte of `0` is not possible. | ||
And the final-bit-flag itself is not part of the useful bitstream. | ||
Hence, the last byte contains between 0 and 7 useful bits. | ||
-For example, if the literal sequence "0145" was encoded using the prefix codes above, | ||
-it would be encoded as: | ||
-``` | ||
-00000001 01110000 | ||
-``` | ||
+Starting from the end, | ||
+it's possible to read the bitstream in a __little-endian_ | ||
+keeping track of already used bits. Since the bitstream is encoded in reverse | ||
+order, starting from the end read symbols in forward order. | ||
+ | ||
+For example, if the literal sequence "0145" was encoded using above prefix code, | ||
+it would be encoded (in reverse order) as: | ||
|Symbol | 5 | 4 | 1 | 0 | Padding | | ||
|--------|------ | ||
-|Encoding|`0000 | ||
+|Encoding|`0000 | ||
-Starting from the end, | ||
-it's possible to read the bitstream in a __little-endian_ | ||
-keeping track of already used bits. Since the bitstream is encoded in reverse | ||
-order, by starting at the end the symbols can be read in forward order. | ||
+Resulting in following 2-bytes bitstream : | ||
+``` | ||
+00010000 00001101 | ||
+``` | ||
+ | ||
+Here is an alternative representation with the symbol codes separated by underscore: | ||
+``` | ||
+0001_0000 00001_1_01 | ||
+``` | ||
-Reading the last `Max_Number_of_B | ||
-it's then possible to compare extracted value to decoding table, | ||
+Reading highest `Max_Number_of_B | ||
+it's possible to compare extracted value to decoding table, | ||
determining the symbol to decode and number of bits to discard. | ||
The process continues up to reading the required number of symbols per stream. | ||
@@ -1516,12 +1523,13 @@ to crosscheck that an implementation build its decoding tables correctly. | ||
Version changes | ||
--------------- | ||
+- 0.2.6 : fixed an error in huffman example, by Ulrich Kunitz | ||
- 0.2.5 : minor typos and clarifications | ||
- 0.2.4 : section restructuring, by Sean Purcell | ||
- 0.2.3 : clarified several details, by Sean Purcell | ||
- 0.2.2 : added predefined codes, by Johannes Rudolph | ||
- 0.2.1 : clarify field names, by Przemyslaw Skibinski | ||
-- 0.2.0 : numerous format adjustments for zstd v0.8 | ||
+- 0.2.0 : numerous format adjustments for zstd v0.8+ | ||
- 0.1.2 : limit Huffman tree depth to 11 bits | ||
- 0.1.1 : reserved dictID ranges | ||
- 0.1.0 : initial release |
@@ -1,10 +1,10 @@ | ||
<html> | ||
<head> | ||
<meta http-equiv="Cont | ||
-<title>zstd 1.3.0 Manual</title> | ||
+<title>zstd 1.3.1 Manual</title> | ||
</head> | ||
<body> | ||
-<h1>zstd 1.3.0 Manual</h1> | ||
+<h1>zstd 1.3.1 Manual</h1> | ||
<hr> | ||
<a name="Contents"> | ||
<ol> | ||
@@ -73,27 +73,41 @@ | ||
or an errorCode if it fails (which can be tested using ZSTD_isError()). | ||
</p></pre><BR> | ||
-<pre><b>unsigne | ||
-</b><p> NOTE: This function is planned to be obsolete, in favor of ZSTD_getFrameCon | ||
- ZSTD_getFrameCon | ||
- returning the decompressed size of a single frame, | ||
- but distinguishes empty frames from frames with an unknown size, or errors. | ||
- | ||
- 'src' is the start of a zstd compressed frame. | ||
- @return : content size to be decompressed, as a 64-bits value _if known_, 0 otherwise. | ||
- note 1 : decompressed size is an optional field, it may not be present, typically in streaming mode. | ||
- When `return==0`, data to decompress could be any size. | ||
+<pre><b>#define | ||
+#define ZSTD_CONTENTSIZE | ||
+unsigned long long ZSTD_getFrameCon | ||
+</b><p> `src` should point to the start of a ZSTD encoded frame. | ||
+ `srcSize` must be at least as large as the frame header. | ||
+ hint : any size >= `ZSTD_frameHeade | ||
+ @return : - decompressed size of the frame in `src`, if known | ||
+ - ZSTD_CONTENTSIZE | ||
+ - ZSTD_CONTENTSIZE | ||
+ note 1 : a 0 return value means the frame is valid but "empty". | ||
+ note 2 : decompressed size is an optional field, it may not be present, typically in streaming mode. | ||
+ When `return==ZSTD_CO | ||
In which case, it's necessary to use streaming mode to decompress data. | ||
- Optionally, application can use ZSTD_decompress( | ||
- (For example, data may be necessarily cut into blocks <= 16 KB). | ||
- note 2 : decompressed size is always present when compression is done with ZSTD_compress() | ||
- note 3 : decompressed size can be very large (64-bits value), | ||
+ Optionally, application can rely on some implicit limit, | ||
+ as ZSTD_decompress( | ||
+ (For example, data could be necessarily cut into blocks <= 16 KB). | ||
+ note 3 : decompressed size is always present when compression is done with ZSTD_compress() | ||
+ note 4 : decompressed size can be very large (64-bits value), | ||
potentially larger than what local system can handle as a single memory segment. | ||
In which case, it's necessary to use streaming mode to decompress data. | ||
- note 4 : If source is untrusted, decompressed size could be wrong or intentionally modified. | ||
- Always ensure result fits within application's authorized limits. | ||
+ note 5 : If source is untrusted, decompressed size could be wrong or intentionally modified. | ||
+ Always ensure return value fits within application's authorized limits. | ||
Each application can set its own limits. | ||
- note 5 : when `return==0`, if precise failure cause is needed, use ZSTD_getFrameHea | ||
+ note 6 : This function replaces ZSTD_getDecompre | ||
+</p></pre><BR> | ||
+ | ||
+<pre><b>unsigne | ||
+</b><p> NOTE: This function is now obsolete, in favor of ZSTD_getFrameCon | ||
+ Both functions work the same way, | ||
+ but ZSTD_getDecompre | ||
+ "empty", "unknown" and "error" results in the same return value (0), | ||
+ while ZSTD_getFrameCon | ||
+ | ||
+ 'src' is the start of a zstd compressed frame. | ||
+ @return : content size to be decompressed, as a 64-bits value _if known and not empty_, 0 otherwise. | ||
</p></pre><BR> | ||
<h3>Helper functions</h3><p | ||
@@ -298,8 +312,8 @@ size_t ZSTD_decompressS | ||
<pre><b>size_t ZSTD_DStreamOutS | ||
</b></pre><BR> | ||
<a name="Chapter10" | ||
- They should never be used with a dynamic library, as they may change in the future. | ||
- They are provided for advanced usages. | ||
+ They should never be used with a dynamic library, as prototypes may change in the future. | ||
+ They are provided for advanced scenarios. | ||
Use them only in association with static linking. | ||
<BR></pre> | ||
@@ -330,13 +344,6 @@ size_t ZSTD_decompressS | ||
ZSTD_frameParame | ||
} ZSTD_parameters; | ||
</b></pre><BR> | ||
-<pre><b>typedef | ||
- unsigned long long frameContentSize | ||
- size_t windowSize; | ||
- unsigned dictID; | ||
- unsigned checksumFlag; | ||
-} ZSTD_frameHeader | ||
-</b></pre><BR> | ||
<h3>Custom memory allocation functions</h3><p | ||
typedef void (*ZSTD_freeFunct | ||
typedef struct { ZSTD_allocFuncti | ||
@@ -348,26 +355,15 @@ static const ZSTD_customMem ZSTD_defaultCMem | ||
<pre><b>size_t ZSTD_findFrameCo | ||
</b><p> `src` should point to the start of a ZSTD encoded frame or skippable frame | ||
`srcSize` must be at least as large as the frame | ||
- @return : the compressed size of the frame pointed to by `src`, | ||
+ @return : the compressed size of the first frame starting at `src`, | ||
suitable to pass to `ZSTD_decompress | ||
- or an error code if given invalid input. | ||
-</p></pre><BR> | ||
- | ||
-<pre><b>#define | ||
-#define ZSTD_CONTENTSIZE | ||
-unsigned long long ZSTD_getFrameCon | ||
-</b><p> `src` should point to the start of a ZSTD encoded frame. | ||
- `srcSize` must be at least as large as the frame header. | ||
- A value >= `ZSTD_frameHeade | ||
- @return : - decompressed size of the frame pointed to be `src` if known | ||
- - ZSTD_CONTENTSIZE | ||
- - ZSTD_CONTENTSIZE | ||
+ or an error code if input is invalid | ||
</p></pre><BR> | ||
<pre><b>unsigned | ||
</b><p> `src` should point the start of a series of ZSTD encoded and/or skippable frames | ||
`srcSize` must be the _exact_ size of this series | ||
- (i.e. there should be a frame boundary exactly `srcSize` bytes after `src`) | ||
+ (i.e. there should be a frame boundary exactly at `srcSize` bytes after `src`) | ||
@return : - decompressed size of all data in all successive frames | ||
- if the decompressed size cannot be determined: ZSTD_CONTENTSIZE | ||
- if an error occurred: ZSTD_CONTENTSIZE | ||
@@ -375,8 +371,6 @@ unsigned long long ZSTD_getFrameCon | ||
note 1 : decompressed size is an optional field, that may not be present, especially in streaming mode. | ||
When `return==ZSTD_CO | ||
In which case, it's necessary to use streaming mode to decompress data. | ||
- Optionally, application can still use ZSTD_decompress( | ||
- (For example, data may be necessarily cut into blocks <= 16 KB). | ||
note 2 : decompressed size is always present when compression is done with ZSTD_compress() | ||
note 3 : decompressed size can be very large (64-bits value), | ||
potentially larger than what local system can handle as a single memory segment. | ||
@@ -385,7 +379,7 @@ unsigned long long ZSTD_getFrameCon | ||
Always ensure result fits within application's authorized limits. | ||
Each application can set its own limits. | ||
note 5 : ZSTD_findDecompr | ||
- read each contained frame header. This is efficient as most of the data is skipped, | ||
+ read each contained frame header. This is fast as most of the data is skipped, | ||
however it does mean that all frame data must be present and valid. | ||
</p></pre><BR> | ||
@@ -483,14 +477,15 @@ size_t ZSTD_estimateDDi | ||
It is important that dictBuffer outlives CDict, it must remain read accessible throughout the lifetime of CDict | ||
</p></pre><BR> | ||
-<pre><b>typedef | ||
+<pre><b>typedef | ||
ZSTD_dm_rawConte | ||
ZSTD_dm_fullDict | ||
} ZSTD_dictMode_e; | ||
</b></pre><BR> | ||
<pre><b>ZSTD_CDi | ||
unsigned byReference, ZSTD_dictMode_e dictMode, | ||
- ZSTD_compression | ||
+ ZSTD_compression | ||
+ ZSTD_customMem customMem); | ||
</b><p> Create a ZSTD_CDict using external alloc and free, and customized compression parameters | ||
</p></pre><BR> | ||
@@ -760,7 +755,16 @@ size_t ZSTD_copyCCtx(ZS | ||
It also returns Frame Size as fparamsPtr->fram | ||
<BR></pre> | ||
-<h3>Buffer-less | ||
+<h3>Buffer-less | ||
+typedef struct { | ||
+ unsigned long long frameContentSize | ||
+ unsigned long long windowSize; </b>/* can be very large, up to <= frameContentSize | ||
+ ZSTD_frameType_e | ||
+ unsigned headerSize; | ||
+ unsigned dictID; | ||
+ unsigned checksumFlag; | ||
+} ZSTD_frameHeader | ||
+size_t ZSTD_getFrameHea | ||
size_t ZSTD_decompressB | ||
size_t ZSTD_decompressB | ||
size_t ZSTD_decompressB | ||
@@ -809,7 +813,9 @@ void ZSTD_copyDCtx(ZS | ||
* Special: value 0 means "do not change strategy". */ | ||
</b>/* frame parameters */<b> | ||
- ZSTD_p_contentSi | ||
+ ZSTD_p_contentSi | ||
+ * note that content size must be known at the beginning, | ||
+ * it is sent using ZSTD_CCtx_setPle | ||
ZSTD_p_checksumF | ||
ZSTD_p_dictIDFla | ||
@@ -80,9 +80,9 @@ extern "C" { | ||
* bitStream encoding API (write forward) | ||
**************** | ||
/* bitStream can mix input from multiple sources. | ||
-* A critical property of these streams is that they encode and decode in **reverse** direction. | ||
-* So the first bit sequence you add will be the last to be read, like a LIFO stack. | ||
-*/ | ||
+ * A critical property of these streams is that they encode and decode in **reverse** direction. | ||
+ * So the first bit sequence you add will be the last to be read, like a LIFO stack. | ||
+ */ | ||
typedef struct | ||
{ | ||
size_t bitContainer; | ||
@@ -203,7 +203,7 @@ static const unsigned BIT_mask[] = { 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, | ||
/*! BIT_initCStream( | ||
* `dstCapacity` must be > sizeof(size_t) | ||
* @return : 0 if success, | ||
- otherwise an error code (can be tested using ERR_isError() ) */ | ||
+ * otherwise an error code (can be tested using ERR_isError()) */ | ||
MEM_STATIC size_t BIT_initCStream( | ||
void* startPtr, size_t dstCapacity) | ||
{ | ||
@@ -217,8 +217,8 @@ MEM_STATIC size_t BIT_initCStream( | ||
} | ||
/*! BIT_addBits() : | ||
- can add up to 26 bits into `bitC`. | ||
- Does not check for register overflow ! */ | ||
+ * can add up to 26 bits into `bitC`. | ||
+ * Note : does not check for register overflow ! */ | ||
MEM_STATIC void BIT_addBits(BIT_ | ||
size_t value, unsigned nbBits) | ||
{ | ||
@@ -268,7 +268,7 @@ MEM_STATIC void BIT_flushBits(BI | ||
/*! BIT_closeCStream | ||
* @return : size of CStream, in bytes, | ||
- or 0 if it could not fit into dstBuffer */ | ||
+ * or 0 if it could not fit into dstBuffer */ | ||
MEM_STATIC size_t BIT_closeCStream | ||
{ | ||
BIT_addBitsFast( | ||
@@ -279,14 +279,14 @@ MEM_STATIC size_t BIT_closeCStream | ||
/*-************* | ||
-* bitStream decoding | ||
+* bitStream decoding | ||
**************** | ||
/*! BIT_initDStream( | ||
-* Initialize a BIT_DStream_t. | ||
-* `bitD` : a pointer to an already allocated BIT_DStream_t structure. | ||
-* `srcSize` must be the *exact* size of the bitStream, in bytes. | ||
-* @return : size of stream (== srcSize) or an errorCode if a problem is detected | ||
-*/ | ||
+ * Initialize a BIT_DStream_t. | ||
+ * `bitD` : a pointer to an already allocated BIT_DStream_t structure. | ||
+ * `srcSize` must be the *exact* size of the bitStream, in bytes. | ||
+ * @return : size of stream (== srcSize), or an errorCode if a problem is detected | ||
+ */ | ||
MEM_STATIC size_t BIT_initDStream( | ||
{ | ||
if (srcSize < 1) { memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wr | ||
@@ -305,29 +305,30 @@ MEM_STATIC size_t BIT_initDStream( | ||
bitD->bitContain | ||
switch(srcSize) | ||
{ | ||
- case 7: bitD->bitContain | ||
- /* fall-through */ | ||
+ case 7: bitD->bitContain | ||
+ /* fall-through */ | ||
- case 6: bitD->bitContain | ||
- /* fall-through */ | ||
+ case 6: bitD->bitContain | ||
+ /* fall-through */ | ||
- case 5: bitD->bitContain | ||
- /* fall-through */ | ||
+ case 5: bitD->bitContain | ||
+ /* fall-through */ | ||
- case 4: bitD->bitContain | ||
- /* fall-through */ | ||
+ case 4: bitD->bitContain | ||
+ /* fall-through */ | ||
- case 3: bitD->bitContain | ||
- /* fall-through */ | ||
+ case 3: bitD->bitContain | ||
+ /* fall-through */ | ||
- case 2: bitD->bitContain | ||
- /* fall-through */ | ||
+ case 2: bitD->bitContain | ||
+ /* fall-through */ | ||
- default: break; | ||
+ default: break; | ||
+ } | ||
+ { BYTE const lastByte = ((const BYTE*)srcBuffer) | ||
+ bitD->bitsConsum | ||
+ if (lastByte == 0) return ERROR(corruption | ||
} | ||
- { BYTE const lastByte = ((const BYTE*)srcBuffer) | ||
- bitD->bitsConsum | ||
- if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ } | ||
bitD->bitsConsum | ||
} | ||
@@ -363,9 +364,8 @@ MEM_STATIC size_t BIT_getLowerBits | ||
* local register is not modified. | ||
* On 32-bits, maxNbBits==24. | ||
* On 64-bits, maxNbBits==56. | ||
- * @return : value extracted | ||
- */ | ||
- MEM_STATIC size_t BIT_lookBits(con | ||
+ * @return : value extracted */ | ||
+MEM_STATIC size_t BIT_lookBits(con | ||
{ | ||
#if defined(__BMI__) | ||
return BIT_getMiddleBit | ||
@@ -392,8 +392,7 @@ MEM_STATIC void BIT_skipBits(BIT | ||
/*! BIT_readBits() : | ||
* Read (consume) next n bits from local register and update. | ||
* Pay attention to not read more than nbBits contained into local register. | ||
- * @return : extracted value. | ||
- */ | ||
+ * @return : extracted value. */ | ||
MEM_STATIC size_t BIT_readBits(BIT | ||
{ | ||
size_t const value = BIT_lookBits(bit | ||
@@ -402,7 +401,7 @@ MEM_STATIC size_t BIT_readBits(BIT | ||
} | ||
/*! BIT_readBitsFast | ||
-* unsafe version; only works only if nbBits >= 1 */ | ||
+ * unsafe version; only works only if nbBits >= 1 */ | ||
MEM_STATIC size_t BIT_readBitsFast | ||
{ | ||
size_t const value = BIT_lookBitsFast | ||
@@ -412,10 +411,10 @@ MEM_STATIC size_t BIT_readBitsFast | ||
} | ||
/*! BIT_reloadDStrea | ||
-* Refill `bitD` from buffer previously set in BIT_initDStream( | ||
-* This function is safe, it guarantees it will not read beyond src buffer. | ||
-* @return : status of `BIT_DStream_t` internal register. | ||
- if status == BIT_DStream_unfi | ||
+ * Refill `bitD` from buffer previously set in BIT_initDStream( | ||
+ * This function is safe, it guarantees it will not read beyond src buffer. | ||
+ * @return : status of `BIT_DStream_t` internal register. | ||
+ * when status == BIT_DStream_unfi | ||
MEM_STATIC BIT_DStream_stat | ||
{ | ||
if (bitD->bitsConsu | ||
@@ -446,8 +445,8 @@ MEM_STATIC BIT_DStream_stat | ||
} | ||
/*! BIT_endOfDStream | ||
-* @return Tells if DStream has exactly reached its end (all bits consumed). | ||
-*/ | ||
+ * @return : 1 if DStream has _exactly_ reached its end (all bits consumed). | ||
+ */ | ||
MEM_STATIC unsigned BIT_endOfDStream | ||
{ | ||
return ((DStream->ptr == DStream->start) && (DStream->bitsCo |
@@ -0,0 +1,85 @@ | ||
+/* | ||
+ * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. | ||
+ * All rights reserved. | ||
+ * | ||
+ * This source code is licensed under both the BSD-style license (found in the | ||
+ * LICENSE file in the root directory of this source tree) and the GPLv2 (found | ||
+ * in the COPYING file in the root directory of this source tree). | ||
+ */ | ||
+ | ||
+#ifndef ZSTD_COMPILER_H | ||
+#define ZSTD_COMPILER_H | ||
+ | ||
+/*-************ | ||
+* Compiler specifics | ||
+*************** | ||
+/* force inlining */ | ||
+#if defined (__GNUC__) || defined(__cplusp | ||
+# define INLINE_KEYWORD inline | ||
+#else | ||
+# define INLINE_KEYWORD | ||
+#endif | ||
+ | ||
+#if defined(__GNUC__ | ||
+# define FORCE_INLINE_ATT | ||
+#elif defined(_MSC_VER | ||
+# define FORCE_INLINE_ATT | ||
+#else | ||
+# define FORCE_INLINE_ATT | ||
+#endif | ||
+ | ||
+/** | ||
+ * FORCE_INLINE_TEM | ||
+ * parameters. They must be inlined for the compiler to elimininate the constant | ||
+ * branches. | ||
+ */ | ||
+#define FORCE_INLINE_TEM | ||
+/** | ||
+ * HINT_INLINE is used to help the compiler generate better code. It is *not* | ||
+ * used for "templates", so it can be tweaked based on the compilers | ||
+ * performance. | ||
+ * | ||
+ * gcc-4.8 and gcc-4.9 have been shown to benefit from leaving off the | ||
+ * always_inline attribute. | ||
+ * | ||
+ * clang up to 5.0.0 (trunk) benefit tremendously from the always_inline | ||
+ * attribute. | ||
+ */ | ||
+#if !defined(__clang | ||
+# define HINT_INLINE static INLINE_KEYWORD | ||
+#else | ||
+# define HINT_INLINE static INLINE_KEYWORD FORCE_INLINE_ATT | ||
+#endif | ||
+ | ||
+/* force no inlining */ | ||
+#ifdef _MSC_VER | ||
+# define FORCE_NOINLINE static __declspec(noinl | ||
+#else | ||
+# ifdef __GNUC__ | ||
+# define FORCE_NOINLINE static __attribute__((_ | ||
+# else | ||
+# define FORCE_NOINLINE static | ||
+# endif | ||
+#endif | ||
+ | ||
+/* prefetch */ | ||
+#if defined(_MSC_VER | ||
+# include <mmintrin.h> /* https://msdn.mic | ||
+# define PREFETCH(ptr) _mm_prefetch((co | ||
+#elif defined(__GNUC__ | ||
+# define PREFETCH(ptr) __builtin_prefet | ||
+#else | ||
+# define PREFETCH(ptr) /* disabled */ | ||
+#endif | ||
+ | ||
+/* disable warnings */ | ||
+#ifdef _MSC_VER /* Visual Studio */ | ||
+# include <intrin.h> /* For Visual 2005 */ | ||
+# pragma warning(disable : 4100) /* disable: C4100: unreferenced formal parameter */ | ||
+# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */ | ||
+# pragma warning(disable : 4204) /* disable: C4204: non-constant aggregate initializer */ | ||
+# pragma warning(disable : 4214) /* disable: C4214: non-int bitfields */ | ||
+# pragma warning(disable : 4324) /* disable: C4324: padded structure */ | ||
+#endif | ||
+ | ||
+#endif /* ZSTD_COMPILER_H */ |
@@ -1,10 +1,10 @@ | ||
-/** | ||
+/* | ||
* Copyright (c) 2016-present, Yann Collet, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
- * This source code is licensed under the BSD-style license found in the | ||
- * LICENSE file in the root directory of this source tree. An additional grant | ||
- * of patent rights can be found in the PATENTS file in the same directory. | ||
+ * This source code is licensed under both the BSD-style license (found in the | ||
+ * LICENSE file in the root directory of this source tree) and the GPLv2 (found | ||
+ * in the COPYING file in the root directory of this source tree). | ||
*/ | ||
/* The purpose of this file is to have a single list of error strings embedded in binary */ | ||
@@ -20,19 +20,17 @@ const char* ERR_getErrorStri | ||
case PREFIX(GENERIC): | ||
case PREFIX(prefix_un | ||
case PREFIX(version_u | ||
- case PREFIX(parameter | ||
case PREFIX(framePara | ||
- case PREFIX(framePara | ||
case PREFIX(framePara | ||
- case PREFIX(compressi | ||
- case PREFIX(compressi | ||
+ case PREFIX(corruptio | ||
+ case PREFIX(checksum_ | ||
+ case PREFIX(parameter | ||
+ case PREFIX(parameter | ||
case PREFIX(init_miss | ||
case PREFIX(memory_al | ||
case PREFIX(stage_wro | ||
case PREFIX(dstSize_t | ||
case PREFIX(srcSize_w | ||
- case PREFIX(corruptio | ||
- case PREFIX(checksum_ | ||
case PREFIX(tableLog_ | ||
case PREFIX(maxSymbol | ||
case PREFIX(maxSymbol |
@@ -1,10 +1,10 @@ | ||
-/** | ||
+/* | ||
* Copyright (c) 2016-present, Yann Collet, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
- * This source code is licensed under the BSD-style license found in the | ||
- * LICENSE file in the root directory of this source tree. An additional grant | ||
- * of patent rights can be found in the PATENTS file in the same directory. | ||
+ * This source code is licensed under both the BSD-style license (found in the | ||
+ * LICENSE file in the root directory of this source tree) and the GPLv2 (found | ||
+ * in the COPYING file in the root directory of this source tree). | ||
*/ | ||
/* Note : this module is expected to remain private, do not expose it */ |
@@ -31,13 +31,14 @@ | ||
You can contact the author at : | ||
- Source repository : https://github.c | ||
**************** | ||
-#ifndef FSE_H | ||
-#define FSE_H | ||
#if defined (__cplusplus) | ||
extern "C" { | ||
#endif | ||
+#ifndef FSE_H | ||
+#define FSE_H | ||
+ | ||
/*-************* | ||
* Dependencies | ||
@@ -297,8 +298,10 @@ FSE_decompress_u | ||
If there is an error, the function will return an error code, which can be tested using FSE_isError(). (ex: dst buffer too small) | ||
*/ | ||
+#endif /* FSE_H */ | ||
-#ifdef FSE_STATIC_LINKI | ||
+#if defined(FSE_STAT | ||
+#define FSE_H_FSE_STATIC | ||
/* *** Dependency *** */ | ||
#include "bitstream.h" | ||
@@ -381,6 +384,11 @@ size_t FSE_buildDTable_ | ||
size_t FSE_decompress_w | ||
/**< same as FSE_decompress() | ||
+typedef enum { | ||
+ FSE_repeat_none, | ||
+ FSE_repeat_check | ||
+ FSE_repeat_valid | ||
+ } FSE_repeat; | ||
/* **************** | ||
* FSE symbol compression API | ||
@@ -694,5 +702,3 @@ MEM_STATIC unsigned FSE_endOfDState( | ||
#if defined (__cplusplus) | ||
} | ||
#endif | ||
- | ||
-#endif /* FSE_H */ |
@@ -33,35 +33,16 @@ | ||
**************** | ||
-/* **************** | ||
-* Compiler specifics | ||
-*************** | ||
-#ifdef _MSC_VER /* Visual Studio */ | ||
-# define FORCE_INLINE static __forceinline | ||
-# include <intrin.h> /* For Visual 2005 */ | ||
-# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */ | ||
-# pragma warning(disable : 4214) /* disable: C4214: non-int bitfields */ | ||
-#else | ||
-# if defined (__cplusplus) || defined (__STDC_VERSION_ | ||
-# ifdef __GNUC__ | ||
-# define FORCE_INLINE static inline __attribute__((a | ||
-# else | ||
-# define FORCE_INLINE static inline | ||
-# endif | ||
-# else | ||
-# define FORCE_INLINE static | ||
-# endif /* __STDC_VERSION__ | ||
-#endif | ||
- | ||
- | ||
/* **************** | ||
* Includes | ||
**************** | ||
#include <stdlib.h> /* malloc, free, qsort */ | ||
#include <string.h> /* memcpy, memset */ | ||
#include "bitstream.h" | ||
+#include "compiler.h" | ||
#define FSE_STATIC_LINKI | ||
#include "fse.h" | ||
+#include "error_private.h | ||
/* **************** | ||
@@ -216,7 +197,7 @@ size_t FSE_buildDTable_ | ||
return 0; | ||
} | ||
-FORCE_INLINE size_t FSE_decompress_u | ||
+FORCE_INLINE_TE | ||
void* dst, size_t maxDstSize, | ||
const void* cSrc, size_t cSrcSize, | ||
const FSE_DTable* dt, const unsigned fast) |
@@ -31,13 +31,13 @@ | ||
You can contact the author at : | ||
- Source repository : https://github.c | ||
**************** | ||
-#ifndef HUF_H_298734234 | ||
-#define HUF_H_298734234 | ||
#if defined (__cplusplus) | ||
extern "C" { | ||
#endif | ||
+#ifndef HUF_H_298734234 | ||
+#define HUF_H_298734234 | ||
/* *** Dependencies *** */ | ||
#include <stddef.h> /* size_t */ | ||
@@ -124,6 +124,7 @@ HUF_PUBLIC_API size_t HUF_compress4X_w | ||
#define HUF_DECOMPRESS_W | ||
#define HUF_DECOMPRESS_W | ||
+#endif /* HUF_H_298734234 */ | ||
/* **************** | ||
* WARNING !! | ||
@@ -132,7 +133,8 @@ HUF_PUBLIC_API size_t HUF_compress4X_w | ||
* because they are not guaranteed to remain stable in the future. | ||
* Only consider them in association with static linking. | ||
**************** | ||
-#ifdef HUF_STATIC_LINKI | ||
+#if defined(HUF_STAT | ||
+#define HUF_H_HUF_STATIC | ||
/* *** Dependencies *** */ | ||
#include "mem.h" /* U32 */ | ||
@@ -295,9 +297,6 @@ size_t HUF_decompress1X | ||
#endif /* HUF_STATIC_LINKI | ||
- | ||
#if defined (__cplusplus) | ||
} | ||
#endif | ||
- | ||
-#endif /* HUF_H_298734234 */ |
@@ -1,10 +1,10 @@ | ||
-/** | ||
+/* | ||
* Copyright (c) 2016-present, Yann Collet, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
- * This source code is licensed under the BSD-style license found in the | ||
- * LICENSE file in the root directory of this source tree. An additional grant | ||
- * of patent rights can be found in the PATENTS file in the same directory. | ||
+ * This source code is licensed under both the BSD-style license (found in the | ||
+ * LICENSE file in the root directory of this source tree) and the GPLv2 (found | ||
+ * in the COPYING file in the root directory of this source tree). | ||
*/ | ||
#ifndef MEM_H_MODULE | ||
@@ -110,7 +110,7 @@ Only use if no other choice to achieve best performance on target platform */ | ||
MEM_STATIC U16 MEM_read16(const | ||
MEM_STATIC U32 MEM_read32(const | ||
MEM_STATIC U64 MEM_read64(const | ||
-MEM_STATIC U64 MEM_readST(const | ||
+MEM_STATIC size_t MEM_readST(const | ||
MEM_STATIC void MEM_write16(void | ||
MEM_STATIC void MEM_write32(void | ||
@@ -131,7 +131,7 @@ MEM_STATIC void MEM_write64(void | ||
MEM_STATIC U16 MEM_read16(const | ||
MEM_STATIC U32 MEM_read32(const | ||
MEM_STATIC U64 MEM_read64(const | ||
-MEM_STATIC U64 MEM_readST(const | ||
+MEM_STATIC size_t MEM_readST(const | ||
MEM_STATIC void MEM_write16(void | ||
MEM_STATIC void MEM_write32(void |
@@ -1,10 +1,10 @@ | ||
-/** | ||
- * Copyright (c) 2016-present, Facebook, Inc. | ||
+/* | ||
+ * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
- * This source code is licensed under the BSD-style license found in the | ||
- * LICENSE file in the root directory of this source tree. An additional grant | ||
- * of patent rights can be found in the PATENTS file in the same directory. | ||
+ * This source code is licensed under both the BSD-style license (found in the | ||
+ * LICENSE file in the root directory of this source tree) and the GPLv2 (found | ||
+ * in the COPYING file in the root directory of this source tree). | ||
*/ | ||
@@ -39,6 +39,12 @@ struct POOL_ctx_s { | ||
size_t queueHead; | ||
size_t queueTail; | ||
size_t queueSize; | ||
+ | ||
+ /* The number of threads working on jobs */ | ||
+ size_t numThreadsBusy; | ||
+ /* Indicates if the queue is empty */ | ||
+ int queueEmpty; | ||
+ | ||
/* The mutex protects the queue */ | ||
pthread_mutex_t queueMutex; | ||
/* Condition variable for pushers to wait on when the queue is full */ | ||
@@ -60,30 +66,41 @@ static void* POOL_thread(void | ||
for (;;) { | ||
/* Lock the mutex and wait for a non-empty queue or until shutdown */ | ||
pthread_mutex_lo | ||
- while (ctx->queueHead == ctx->queueTail && !ctx->shutdown) { | ||
+ | ||
+ while (ctx->queueEmpty | ||
pthread_cond_wai | ||
} | ||
/* empty => shutting down: so stop */ | ||
- if (ctx->queueHead == ctx->queueTail) { | ||
+ if (ctx->queueEmpty | ||
pthread_mutex_un | ||
return opaque; | ||
} | ||
/* Pop a job off the queue */ | ||
{ POOL_job const job = ctx->queue[ctx-> | ||
ctx->queueHead = (ctx->queueHead + 1) % ctx->queueSize; | ||
+ ctx->numThreadsB | ||
+ ctx->queueEmpty = ctx->queueHead == ctx->queueTail; | ||
/* Unlock the mutex, signal a pusher, and run the job */ | ||
pthread_mutex_un | ||
pthread_cond_sig | ||
+ | ||
job.function(job | ||
- } | ||
- } | ||
+ | ||
+ /* If the intended queue size was 0, signal after finishing job */ | ||
+ if (ctx->queueSize == 1) { | ||
+ pthread_mutex_lo | ||
+ ctx->numThreadsB | ||
+ pthread_mutex_un | ||
+ pthread_cond_sig | ||
+ } } | ||
+ } /* for (;;) */ | ||
/* Unreachable */ | ||
} | ||
POOL_ctx *POOL_create(siz | ||
POOL_ctx *ctx; | ||
/* Check the parameters */ | ||
- if (!numThreads || !queueSize) { return NULL; } | ||
+ if (!numThreads) { return NULL; } | ||
/* Allocate the context and zero initialize */ | ||
ctx = (POOL_ctx *)calloc(1, sizeof(POOL_ctx) | ||
if (!ctx) { return NULL; } | ||
@@ -92,15 +109,17 @@ POOL_ctx *POOL_create(siz | ||
* and full queues. | ||
*/ | ||
ctx->queueSize = queueSize + 1; | ||
- ctx->queue = (POOL_job *)malloc(ctx->qu | ||
+ ctx->queue = (POOL_job*) malloc(ctx->queu | ||
ctx->queueHead = 0; | ||
ctx->queueTail = 0; | ||
- pthread_mutex_in | ||
- pthread_cond_ini | ||
- pthread_cond_ini | ||
+ ctx->numThreadsB | ||
+ ctx->queueEmpty = 1; | ||
+ (void)pthread_mu | ||
+ (void)pthread_co | ||
+ (void)pthread_co | ||
ctx->shutdown = 0; | ||
/* Allocate space for the thread handles */ | ||
- ctx->threads = (pthread_t *)malloc(numThre | ||
+ ctx->threads = (pthread_t*)mall | ||
ctx->numThreads = 0; | ||
/* Check for errors */ | ||
if (!ctx->threads || !ctx->queue) { POOL_free(ctx); return NULL; } | ||
@@ -153,22 +172,37 @@ size_t POOL_sizeof(POOL | ||
+ ctx->numThreads * sizeof(pthread_t | ||
} | ||
-void POOL_add(void *ctxVoid, POOL_function function, void *opaque) { | ||
- POOL_ctx *ctx = (POOL_ctx *)ctxVoid; | ||
+/** | ||
+ * Returns 1 if the queue is full and 0 otherwise. | ||
+ * | ||
+ * If the queueSize is 1 (the pool was created with an intended queueSize of 0), | ||
+ * then a queue is empty if there is a thread free and no job is waiting. | ||
+ */ | ||
+static int isQueueFull(POOL | ||
+ if (ctx->queueSize > 1) { | ||
+ return ctx->queueHead == ((ctx->queueTail | ||
+ } else { | ||
+ return ctx->numThreadsB | ||
+ !ctx->queueEmpty | ||
+ } | ||
+} | ||
+ | ||
+void POOL_add(void* ctxVoid, POOL_function function, void *opaque) { | ||
+ POOL_ctx* const ctx = (POOL_ctx*)ctxVo | ||
if (!ctx) { return; } | ||
pthread_mutex_lo | ||
{ POOL_job const job = {function, opaque}; | ||
+ | ||
/* Wait until there is space in the queue for the new job */ | ||
- size_t newTail = (ctx->queueTail + 1) % ctx->queueSize; | ||
- while (ctx->queueHead == newTail && !ctx->shutdown) { | ||
+ while (isQueueFull(ctx | ||
pthread_cond_wai | ||
- newTail = (ctx->queueTail + 1) % ctx->queueSize; | ||
} | ||
/* The queue is still going => there is space */ | ||
if (!ctx->shutdown) | ||
+ ctx->queueEmpty = 0; | ||
ctx->queue[ctx-> | ||
- ctx->queueTail = newTail; | ||
+ ctx->queueTail = (ctx->queueTail + 1) % ctx->queueSize; | ||
} | ||
} | ||
pthread_mutex_un | ||
@@ -183,22 +217,22 @@ struct POOL_ctx_s { | ||
int data; | ||
}; | ||
-POOL_ctx *POOL_create(siz | ||
+POOL_ctx* POOL_create(size | ||
(void)numThreads | ||
(void)queueSize; | ||
- return (POOL_ctx *)malloc(sizeof( | ||
+ return (POOL_ctx*)mallo | ||
} | ||
-void POOL_free(POOL_c | ||
- if (ctx) free(ctx); | ||
+void POOL_free(POOL_c | ||
+ free(ctx); | ||
} | ||
-void POOL_add(void *ctx, POOL_function function, void *opaque) { | ||
+void POOL_add(void* ctx, POOL_function function, void* opaque) { | ||
(void)ctx; | ||
function(opaque) | ||
} | ||
-size_t POOL_sizeof(POOL | ||
+size_t POOL_sizeof(POOL | ||
if (ctx==NULL) return 0; /* supports sizeof NULL */ | ||
return sizeof(*ctx); | ||
} |
@@ -1,11 +1,12 @@ | ||
-/** | ||
- * Copyright (c) 2016-present, Facebook, Inc. | ||
+/* | ||
+ * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
- * This source code is licensed under the BSD-style license found in the | ||
- * LICENSE file in the root directory of this source tree. An additional grant | ||
- * of patent rights can be found in the PATENTS file in the same directory. | ||
+ * This source code is licensed under both the BSD-style license (found in the | ||
+ * LICENSE file in the root directory of this source tree) and the GPLv2 (found | ||
+ * in the COPYING file in the root directory of this source tree). | ||
*/ | ||
+ | ||
#ifndef POOL_H | ||
#define POOL_H | ||
@@ -19,11 +20,10 @@ extern "C" { | ||
typedef struct POOL_ctx_s POOL_ctx; | ||
/*! POOL_create() : | ||
- Create a thread pool with at most `numThreads` threads. | ||
- `numThreads` must be at least 1. | ||
- The maximum number of queued jobs before blocking is `queueSize`. | ||
- `queueSize` must be at least 1. | ||
- @return : The POOL_ctx pointer on success else NULL. | ||
+ * Create a thread pool with at most `numThreads` threads. | ||
+ * `numThreads` must be at least 1. | ||
+ * The maximum number of queued jobs before blocking is `queueSize`. | ||
+ * @return : POOL_ctx pointer on success, else NULL. | ||
*/ | ||
POOL_ctx *POOL_create(siz | ||
@@ -1,4 +1,3 @@ | ||
- | ||
/** | ||
* Copyright (c) 2016 Tino Reichardt | ||
* All rights reserved. | ||
@@ -42,14 +41,14 @@ extern "C" { | ||
/* mutex */ | ||
#define pthread_mutex_t CRITICAL_SECTION | ||
-#define pthread_mutex_in | ||
+#define pthread_mutex_in | ||
#define pthread_mutex_de | ||
#define pthread_mutex_lo | ||
#define pthread_mutex_un | ||
/* condition variable */ | ||
#define pthread_cond_t CONDITION_VARIAB | ||
-#define pthread_cond_ini | ||
+#define pthread_cond_ini | ||
#define pthread_cond_des | ||
#define pthread_cond_wai | ||
#define pthread_cond_sig | ||
@@ -80,14 +79,14 @@ int _pthread_join(pt | ||
#else /* ZSTD_MULTITHREAD | ||
/* No multithreading support */ | ||
-#define pthread_mutex_t int /* #define rather than typedef, as sometimes pthread support is implicit, resulting in duplicated symbols */ | ||
-#define pthread_mutex_in | ||
+#define pthread_mutex_t int /* #define rather than typedef, because sometimes pthread support is implicit, resulting in duplicated symbols */ | ||
+#define pthread_mutex_in | ||
#define pthread_mutex_de | ||
#define pthread_mutex_lo | ||
#define pthread_mutex_un | ||
#define pthread_cond_t int | ||
-#define pthread_cond_ini | ||
+#define pthread_cond_ini | ||
#define pthread_cond_des | ||
#define pthread_cond_wai | ||
#define pthread_cond_sig |
@@ -113,19 +113,25 @@ static void* XXH_memcpy(void* | ||
/* **************** | ||
* Compiler Specific Options | ||
**************** | ||
-#ifdef _MSC_VER /* Visual Studio */ | ||
-# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */ | ||
-# define FORCE_INLINE static __forceinline | ||
+#if defined (__GNUC__) || defined(__cplusp | ||
+# define INLINE_KEYWORD inline | ||
#else | ||
-# if defined (__cplusplus) || defined (__STDC_VERSION_ | ||
-# ifdef __GNUC__ | ||
-# define FORCE_INLINE static inline __attribute__((a | ||
-# else | ||
-# define FORCE_INLINE static inline | ||
-# endif | ||
-# else | ||
-# define FORCE_INLINE static | ||
-# endif /* __STDC_VERSION__ | ||
+# define INLINE_KEYWORD | ||
+#endif | ||
+ | ||
+#if defined(__GNUC__ | ||
+# define FORCE_INLINE_ATT | ||
+#elif defined(_MSC_VER | ||
+# define FORCE_INLINE_ATT | ||
+#else | ||
+# define FORCE_INLINE_ATT | ||
+#endif | ||
+ | ||
+#define FORCE_INLINE_TEM | ||
+ | ||
+ | ||
+#ifdef _MSC_VER | ||
+# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */ | ||
#endif | ||
@@ -248,7 +254,7 @@ typedef enum { XXH_bigEndian=0, | ||
**************** | ||
typedef enum { XXH_aligned, XXH_unaligned } XXH_alignment; | ||
-FORCE_INLINE U32 XXH_readLE32_ali | ||
+FORCE_INLINE_TE | ||
{ | ||
if (align==XXH_unal | ||
return endian==XXH_litt | ||
@@ -256,7 +262,7 @@ FORCE_INLINE U32 XXH_readLE32_ali | ||
return endian==XXH_litt | ||
} | ||
-FORCE_INLINE U32 XXH_readLE32(con | ||
+FORCE_INLINE_TE | ||
{ | ||
return XXH_readLE32_ali | ||
} | ||
@@ -266,7 +272,7 @@ static U32 XXH_readBE32(con | ||
return XXH_CPU_LITTLE_E | ||
} | ||
-FORCE_INLINE U64 XXH_readLE64_ali | ||
+FORCE_INLINE_TE | ||
{ | ||
if (align==XXH_unal | ||
return endian==XXH_litt | ||
@@ -274,7 +280,7 @@ FORCE_INLINE U64 XXH_readLE64_ali | ||
return endian==XXH_litt | ||
} | ||
-FORCE_INLINE U64 XXH_readLE64(con | ||
+FORCE_INLINE_TE | ||
{ | ||
return XXH_readLE64_ali | ||
} | ||
@@ -335,7 +341,7 @@ static U32 XXH32_round(U32 seed, U32 input) | ||
return seed; | ||
} | ||
-FORCE_INLINE U32 XXH32_endian_ali | ||
+FORCE_INLINE_TE | ||
{ | ||
const BYTE* p = (const BYTE*)input; | ||
const BYTE* bEnd = p + len; | ||
@@ -435,7 +441,7 @@ static U64 XXH64_mergeRound | ||
return acc; | ||
} | ||
-FORCE_INLINE U64 XXH64_endian_ali | ||
+FORCE_INLINE_TE | ||
{ | ||
const BYTE* p = (const BYTE*)input; | ||
const BYTE* const bEnd = p + len; | ||
@@ -584,7 +590,7 @@ XXH_PUBLIC_API XXH_errorcode XXH64_reset(XXH6 | ||
} | ||
-FORCE_INLINE XXH_errorcode XXH32_update_end | ||
+FORCE_INLINE_TE | ||
{ | ||
const BYTE* p = (const BYTE*)input; | ||
const BYTE* const bEnd = p + len; | ||
@@ -654,7 +660,7 @@ XXH_PUBLIC_API XXH_errorcode XXH32_update (XXH32_state_t* state_in, const void* | ||
-FORCE_INLINE U32 XXH32_digest_end | ||
+FORCE_INLINE_TE | ||
{ | ||
const BYTE * p = (const BYTE*)state->mem | ||
const BYTE* const bEnd = (const BYTE*)(state->me | ||
@@ -704,7 +710,7 @@ XXH_PUBLIC_API unsigned int XXH32_digest (const XXH32_state_t* state_in) | ||
/* **** XXH64 **** */ | ||
-FORCE_INLINE XXH_errorcode XXH64_update_end | ||
+FORCE_INLINE_TE | ||
{ | ||
const BYTE* p = (const BYTE*)input; | ||
const BYTE* const bEnd = p + len; | ||
@@ -771,7 +777,7 @@ XXH_PUBLIC_API XXH_errorcode XXH64_update (XXH64_state_t* state_in, const void* | ||
-FORCE_INLINE U64 XXH64_digest_end | ||
+FORCE_INLINE_TE | ||
{ | ||
const BYTE * p = (const BYTE*)state->mem | ||
const BYTE* const bEnd = (const BYTE*)state->mem |
@@ -1,10 +1,10 @@ | ||
-/** | ||
+/* | ||
* Copyright (c) 2016-present, Yann Collet, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
- * This source code is licensed under the BSD-style license found in the | ||
- * LICENSE file in the root directory of this source tree. An additional grant | ||
- * of patent rights can be found in the PATENTS file in the same directory. | ||
+ * This source code is licensed under both the BSD-style license (found in the | ||
+ * LICENSE file in the root directory of this source tree) and the GPLv2 (found | ||
+ * in the COPYING file in the root directory of this source tree). | ||
*/ | ||
@@ -1,10 +1,10 @@ | ||
-/** | ||
+/* | ||
* Copyright (c) 2016-present, Yann Collet, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
- * This source code is licensed under the BSD-style license found in the | ||
- * LICENSE file in the root directory of this source tree. An additional grant | ||
- * of patent rights can be found in the PATENTS file in the same directory. | ||
+ * This source code is licensed under both the BSD-style license (found in the | ||
+ * LICENSE file in the root directory of this source tree) and the GPLv2 (found | ||
+ * in the COPYING file in the root directory of this source tree). | ||
*/ | ||
#ifndef ZSTD_ERRORS_H_39 | ||
@@ -37,43 +37,41 @@ extern "C" { | ||
/*-************* | ||
* error codes list | ||
* note : this API is still considered unstable | ||
- * it should not be used with a dynamic library | ||
+ * and shall not be used with a dynamic library. | ||
* only static linking is allowed | ||
**************** | ||
typedef enum { | ||
- ZSTD_error_no_er | ||
- ZSTD_error_GENER | ||
- ZSTD_error_prefi | ||
- ZSTD_error_versi | ||
- ZSTD_error_param | ||
- ZSTD_error_frame | ||
- ZSTD_error_frame | ||
- ZSTD_error_frame | ||
- ZSTD_error_compr | ||
- ZSTD_error_compr | ||
- ZSTD_error_init_ | ||
- ZSTD_error_memor | ||
- ZSTD_error_stage | ||
- ZSTD_error_dstSi | ||
- ZSTD_error_srcSi | ||
- ZSTD_error_corru | ||
- ZSTD_error_check | ||
- ZSTD_error_table | ||
- ZSTD_error_maxSy | ||
- ZSTD_error_maxSy | ||
- ZSTD_error_dicti | ||
- ZSTD_error_dicti | ||
- ZSTD_error_dicti | ||
- ZSTD_error_frame | ||
- ZSTD_error_seeka | ||
- ZSTD_error_maxCo | ||
+ ZSTD_error_no_er | ||
+ ZSTD_error_GENER | ||
+ ZSTD_error_prefi | ||
+ ZSTD_error_versi | ||
+ ZSTD_error_frame | ||
+ ZSTD_error_frame | ||
+ ZSTD_error_corru | ||
+ ZSTD_error_check | ||
+ ZSTD_error_dicti | ||
+ ZSTD_error_dicti | ||
+ ZSTD_error_dicti | ||
+ ZSTD_error_param | ||
+ ZSTD_error_param | ||
+ ZSTD_error_table | ||
+ ZSTD_error_maxSy | ||
+ ZSTD_error_maxSy | ||
+ ZSTD_error_stage | ||
+ ZSTD_error_init_ | ||
+ ZSTD_error_memor | ||
+ ZSTD_error_dstSi | ||
+ ZSTD_error_srcSi | ||
+ ZSTD_error_frame | ||
+ ZSTD_error_seeka | ||
+ ZSTD_error_maxCo | ||
} ZSTD_ErrorCode; | ||
/*! ZSTD_getErrorCod | ||
convert a `size_t` function result into a `ZSTD_ErrorCode` | ||
which can be used to compare with enum list published above */ | ||
ZSTDERRORLIB_API | ||
-ZSTDERRORLIB_AP | ||
+ZSTDERRORLIB_AP | ||
#if defined (__cplusplus) |
@@ -1,55 +1,28 @@ | ||
-/** | ||
+/* | ||
* Copyright (c) 2016-present, Yann Collet, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
- * This source code is licensed under the BSD-style license found in the | ||
- * LICENSE file in the root directory of this source tree. An additional grant | ||
- * of patent rights can be found in the PATENTS file in the same directory. | ||
+ * This source code is licensed under both the BSD-style license (found in the | ||
+ * LICENSE file in the root directory of this source tree) and the GPLv2 (found | ||
+ * in the COPYING file in the root directory of this source tree). | ||
*/ | ||
#ifndef ZSTD_CCOMMON_H_M | ||
#define ZSTD_CCOMMON_H_M | ||
-/*-************ | ||
-* Compiler specifics | ||
-*************** | ||
-#ifdef _MSC_VER /* Visual Studio */ | ||
-# define FORCE_INLINE static __forceinline | ||
-# include <intrin.h> /* For Visual 2005 */ | ||
-# pragma warning(disable : 4100) /* disable: C4100: unreferenced formal parameter */ | ||
-# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */ | ||
-# pragma warning(disable : 4204) /* disable: C4204: non-constant aggregate initializer */ | ||
-# pragma warning(disable : 4324) /* disable: C4324: padded structure */ | ||
-#else | ||
-# if defined (__cplusplus) || defined (__STDC_VERSION_ | ||
-# ifdef __GNUC__ | ||
-# define FORCE_INLINE static inline __attribute__((a | ||
-# else | ||
-# define FORCE_INLINE static inline | ||
-# endif | ||
-# else | ||
-# define FORCE_INLINE static | ||
-# endif /* __STDC_VERSION__ | ||
-#endif | ||
- | ||
-#ifdef _MSC_VER | ||
-# define FORCE_NOINLINE static __declspec(noinl | ||
-#else | ||
-# ifdef __GNUC__ | ||
-# define FORCE_NOINLINE static __attribute__((_ | ||
-# else | ||
-# define FORCE_NOINLINE static | ||
-# endif | ||
-#endif | ||
- | ||
/*-************* | ||
* Dependencies | ||
**************** | ||
+#include "compiler.h" | ||
#include "mem.h" | ||
#include "error_private.h | ||
#define ZSTD_STATIC_LINK | ||
#include "zstd.h" | ||
+#define FSE_STATIC_LINKI | ||
+#include "fse.h" | ||
+#define HUF_STATIC_LINKI | ||
+#include "huf.h" | ||
#ifndef XXH_STATIC_LINKI | ||
# define XXH_STATIC_LINKI | ||
#endif | ||
@@ -211,20 +184,6 @@ MEM_STATIC void ZSTD_wildcopy_e( | ||
**************** | ||
typedef struct ZSTD_stats_s ZSTD_stats_t; | ||
-typedef struct { | ||
- U32 off; | ||
- U32 len; | ||
-} ZSTD_match_t; | ||
- | ||
-typedef struct { | ||
- U32 price; | ||
- U32 off; | ||
- U32 mlen; | ||
- U32 litlen; | ||
- U32 rep[ZSTD_REP_NUM | ||
-} ZSTD_optimal_t; | ||
- | ||
- | ||
typedef struct seqDef_s { | ||
U32 offset; | ||
U16 litLength; | ||
@@ -242,13 +201,31 @@ typedef struct { | ||
BYTE* ofCode; | ||
U32 longLengthID; /* 0 == no longLength; 1 == Lit.longLength; 2 == Match.longLength | ||
U32 longLengthPos; | ||
- /* opt */ | ||
- ZSTD_optimal_t* priceTable; | ||
- ZSTD_match_t* matchTable; | ||
- U32* matchLengthFreq; | ||
- U32* litLengthFreq; | ||
+ U32 rep[ZSTD_REP_NUM | ||
+ U32 repToConfirm[ZST | ||
+} seqStore_t; | ||
+ | ||
+typedef struct { | ||
+ U32 off; | ||
+ U32 len; | ||
+} ZSTD_match_t; | ||
+ | ||
+typedef struct { | ||
+ U32 price; | ||
+ U32 off; | ||
+ U32 mlen; | ||
+ U32 litlen; | ||
+ U32 rep[ZSTD_REP_NUM | ||
+} ZSTD_optimal_t; | ||
+ | ||
+typedef struct { | ||
U32* litFreq; | ||
+ U32* litLengthFreq; | ||
+ U32* matchLengthFreq; | ||
U32* offCodeFreq; | ||
+ ZSTD_match_t* matchTable; | ||
+ ZSTD_optimal_t* priceTable; | ||
+ | ||
U32 matchLengthSum; | ||
U32 matchSum; | ||
U32 litLengthSum; | ||
@@ -264,7 +241,19 @@ typedef struct { | ||
U32 cachedPrice; | ||
U32 cachedLitLength; | ||
const BYTE* cachedLiterals; | ||
-} seqStore_t; | ||
+} optState_t; | ||
+ | ||
+typedef struct { | ||
+ U32 hufCTable[HUF_CT | ||
+ FSE_CTable offcodeCTable[FS | ||
+ FSE_CTable matchlengthCTabl | ||
+ FSE_CTable litlengthCTable[ | ||
+ U32 workspace[HUF_WO | ||
+ HUF_repeat hufCTable_repeat | ||
+ FSE_repeat offcode_repeatMo | ||
+ FSE_repeat matchlength_repe | ||
+ FSE_repeat litlength_repeat | ||
+} ZSTD_entropyCTab | ||
const seqStore_t* ZSTD_getSeqStore | ||
void ZSTD_seqToCodes( | ||
@@ -331,4 +320,16 @@ size_t ZSTD_compressStr | ||
ZSTD_parameters ZSTD_getParamsFr | ||
+typedef struct { | ||
+ blockType_e blockType; | ||
+ U32 lastBlock; | ||
+ U32 origSize; | ||
+} blockProperties_ | ||
+ | ||
+/*! ZSTD_getcBlockSi | ||
+* Provides the size of compressed block from block header `src` */ | ||
+size_t ZSTD_getcBlockSi | ||
+ blockProperties_ | ||
+ | ||
+ | ||
#endif /* ZSTD_CCOMMON_H_M |
@@ -32,27 +32,6 @@ | ||
- Public forum : https://groups.g | ||
**************** | ||
-/* **************** | ||
-* Compiler specifics | ||
-*************** | ||
-#ifdef _MSC_VER /* Visual Studio */ | ||
-# define FORCE_INLINE static __forceinline | ||
-# include <intrin.h> /* For Visual 2005 */ | ||
-# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */ | ||
-# pragma warning(disable : 4214) /* disable: C4214: non-int bitfields */ | ||
-#else | ||
-# if defined (__cplusplus) || defined (__STDC_VERSION_ | ||
-# ifdef __GNUC__ | ||
-# define FORCE_INLINE static inline __attribute__((a | ||
-# else | ||
-# define FORCE_INLINE static inline | ||
-# endif | ||
-# else | ||
-# define FORCE_INLINE static | ||
-# endif /* __STDC_VERSION__ | ||
-#endif | ||
- | ||
- | ||
/* **************** | ||
* Includes | ||
**************** | ||
@@ -60,13 +39,16 @@ | ||
#include <string.h> /* memcpy, memset */ | ||
#include <stdio.h> /* printf (debug) */ | ||
#include "bitstream.h" | ||
+#include "compiler.h" | ||
#define FSE_STATIC_LINKI | ||
#include "fse.h" | ||
+#include "error_private.h | ||
/* **************** | ||
* Error Management | ||
**************** | ||
+#define FSE_isError ERR_isError | ||
#define FSE_STATIC_ASSER | ||
@@ -781,7 +763,7 @@ size_t FSE_compress_usi | ||
size_t FSE_compressBoun | ||
-#define CHECK_V_F(e, f) size_t const e = f; if (ERR_isError(e)) | ||
+#define CHECK_V_F(e, f) size_t const e = f; if (ERR_isError(e)) | ||
#define CHECK_F(f) { CHECK_V_F(_var_e | ||
/* FSE_compress_wks |
@@ -50,13 +50,15 @@ | ||
#include "fse.h" /* header compression */ | ||
#define HUF_STATIC_LINKI | ||
#include "huf.h" | ||
+#include "error_private.h | ||
/* **************** | ||
* Error Management | ||
**************** | ||
+#define HUF_isError ERR_isError | ||
#define HUF_STATIC_ASSER | ||
-#define CHECK_V_F(e, f) size_t const e = f; if (ERR_isError(e)) | ||
+#define CHECK_V_F(e, f) size_t const e = f; if (ERR_isError(e)) | ||
#define CHECK_F(f) { CHECK_V_F(_var_e | ||
@@ -436,7 +438,7 @@ static void HUF_encodeSymbol | ||
size_t HUF_compressBoun | ||
-#define HUF_FLUSHBITS(s) | ||
+#define HUF_FLUSHBITS(s) | ||
#define HUF_FLUSHBITS_1( | ||
if (sizeof((stream) | ||
@@ -451,7 +453,6 @@ size_t HUF_compress1X_u | ||
BYTE* const oend = ostart + dstSize; | ||
BYTE* op = ostart; | ||
size_t n; | ||
- const unsigned fast = (dstSize >= HUF_BLOCKBOUND(s | ||
BIT_CStream_t bitC; | ||
/* init */ |
@@ -1,10 +1,10 @@ | ||
-/** | ||
+/* | ||
* Copyright (c) 2016-present, Yann Collet, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
- * This source code is licensed under the BSD-style license found in the | ||
- * LICENSE file in the root directory of this source tree. An additional grant | ||
- * of patent rights can be found in the PATENTS file in the same directory. | ||
+ * This source code is licensed under both the BSD-style license (found in the | ||
+ * LICENSE file in the root directory of this source tree) and the GPLv2 (found | ||
+ * in the COPYING file in the root directory of this source tree). | ||
*/ | ||
@@ -36,13 +36,6 @@ static const U32 g_searchStrength | ||
#define HASH_READ_SIZE 8 | ||
typedef enum { ZSTDcs_created=0 | ||
-/* entropy tables always have same size */ | ||
-static size_t const hufCTable_size = HUF_CTABLE_SIZE( | ||
-static size_t const litlengthCTable_ | ||
-static size_t const offcodeCTable_si | ||
-static size_t const matchlengthCTabl | ||
-static size_t const entropyScratchSp | ||
- | ||
/*-************* | ||
* Helper functions | ||
@@ -89,8 +82,6 @@ struct ZSTD_CCtx_s { | ||
U32 loadedDictEnd; /* index of end of dictionary */ | ||
U32 forceWindow; /* force back-references to respect limit of 1<<wLog, even for dictionary */ | ||
ZSTD_compression | ||
- U32 rep[ZSTD_REP_NUM | ||
- U32 repToConfirm[ZST | ||
U32 dictID; | ||
int compressionLevel | ||
ZSTD_parameters requestedParams; | ||
@@ -105,16 +96,11 @@ struct ZSTD_CCtx_s { | ||
size_t staticSize; | ||
seqStore_t seqStore; /* sequences storage ptrs */ | ||
+ optState_t optState; | ||
U32* hashTable; | ||
U32* hashTable3; | ||
U32* chainTable; | ||
- HUF_repeat hufCTable_repeat | ||
- HUF_CElt* hufCTable; | ||
- U32 fseCTables_ready | ||
- FSE_CTable* offcodeCTable; | ||
- FSE_CTable* matchlengthCTabl | ||
- FSE_CTable* litlengthCTable; | ||
- unsigned* entropyScratchSp | ||
+ ZSTD_entropyCTab | ||
/* streaming */ | ||
char* inBuff; | ||
@@ -174,19 +160,9 @@ ZSTD_CCtx* ZSTD_initStaticC | ||
cctx->workSpaceS | ||
/* entropy space (never moves) */ | ||
- /* note : this code should be shared with resetCCtx, rather than copy/pasted */ | ||
- { void* ptr = cctx->workSpace; | ||
- cctx->hufCTable = (HUF_CElt*)ptr; | ||
- ptr = (char*)cctx->huf | ||
- cctx->offcodeCTa | ||
- ptr = (char*)ptr + offcodeCTable_si | ||
- cctx->matchlengt | ||
- ptr = (char*)ptr + matchlengthCTabl | ||
- cctx->litlengthC | ||
- ptr = (char*)ptr + litlengthCTable_ | ||
- assert(((size_t) | ||
- cctx->entropyScr | ||
- } | ||
+ if (cctx->workSpace | ||
+ assert(((size_t) | ||
+ cctx->entropy = (ZSTD_entropyCTa | ||
return cctx; | ||
} | ||
@@ -237,7 +213,7 @@ size_t ZSTD_setCCtxPara | ||
ZSTD_STATIC_ASSE | ||
ZSTD_STATIC_ASSE | ||
case ZSTD_p_forceRawD | ||
- default: return ERROR(parameter_ | ||
+ default: return ERROR(parameter_ | ||
} | ||
} | ||
@@ -251,9 +227,9 @@ static void ZSTD_cLevelToCPa | ||
cctx->compressio | ||
} | ||
-#define CLAMPCHECK(val,m | ||
- if (((val)<(min)) | ((val)>(max))) { \ | ||
- return ERROR(compressio | ||
+#define CLAMPCHECK(val,m | ||
+ if (((val)<(min)) | ((val)>(max))) { \ | ||
+ return ERROR(parameter_ | ||
} } | ||
size_t ZSTD_CCtx_setPar | ||
@@ -349,7 +325,7 @@ size_t ZSTD_CCtx_setPar | ||
/* restrict dictionary mode, to "rawContent" or "fullDict" only */ | ||
ZSTD_STATIC_ASSE | ||
if (value > (unsigned)ZSTD_d | ||
- return ERROR(compressio | ||
+ return ERROR(parameter_ | ||
cctx->dictMode = (ZSTD_dictMode_e | ||
return 0; | ||
@@ -370,31 +346,31 @@ size_t ZSTD_CCtx_setPar | ||
if (value==0) return 0; | ||
DEBUGLOG(5, " setting nbThreads : %u", value); | ||
#ifndef ZSTD_MULTITHREAD | ||
- if (value > 1) return ERROR(compressio | ||
+ if (value > 1) return ERROR(parameter_ | ||
#endif | ||
if ((value>1) && (cctx->nbThreads | ||
if (cctx->staticSiz | ||
- return ERROR(compressio | ||
+ return ERROR(parameter_ | ||
ZSTDMT_freeCCtx( | ||
cctx->nbThreads = 1; | ||
- cctx->mtctx = ZSTDMT_createCCt | ||
+ cctx->mtctx = ZSTDMT_createCCt | ||
if (cctx->mtctx == NULL) return ERROR(memory_all | ||
} | ||
cctx->nbThreads = value; | ||
return 0; | ||
case ZSTD_p_jobSize: | ||
- if (cctx->nbThreads | ||
+ if (cctx->nbThreads | ||
assert(cctx->mtc | ||
return ZSTDMT_setMTCtxP | ||
case ZSTD_p_overlapSi | ||
DEBUGLOG(5, " setting overlap with nbThreads == %u", cctx->nbThreads) | ||
- if (cctx->nbThreads | ||
+ if (cctx->nbThreads | ||
assert(cctx->mtc | ||
return ZSTDMT_setMTCtxP | ||
- default: return ERROR(parameter_ | ||
+ default: return ERROR(parameter_ | ||
} | ||
} | ||
@@ -474,7 +450,8 @@ size_t ZSTD_checkCParam | ||
CLAMPCHECK(cPara | ||
CLAMPCHECK(cPara | ||
CLAMPCHECK(cPara | ||
- if ((U32)(cParams.s | ||
+ if ((U32)(cParams.s | ||
+ return ERROR(parameter_ | ||
return 0; | ||
} | ||
@@ -551,9 +528,7 @@ size_t ZSTD_estimateCCt | ||
size_t const hSize = ((size_t)1) << cParams.hashLog; | ||
U32 const hashLog3 = (cParams.searchL | ||
size_t const h3Size = ((size_t)1) << hashLog3; | ||
- size_t const entropySpace = hufCTable_size + litlengthCTable_ | ||
- + offcodeCTable_si | ||
- + entropyScratchSp | ||
+ size_t const entropySpace = sizeof(ZSTD_entr | ||
size_t const tableSpace = (chainSize + hSize + h3Size) * sizeof(U32); | ||
size_t const optBudget = ((MaxML+1) + (MaxLL+1) + (MaxOff+1) + (1<<Litbits))*si | ||
@@ -620,8 +595,8 @@ static size_t ZSTD_continueCCt | ||
cctx->stage = ZSTDcs_init; | ||
cctx->dictID = 0; | ||
cctx->loadedDict | ||
- { int i; for (i=0; i<ZSTD_REP_NUM; i++) cctx->rep[i] = repStartValue[i] | ||
- cctx->seqStore.l | ||
+ { int i; for (i=0; i<ZSTD_REP_NUM; i++) cctx->seqStore.r | ||
+ cctx->optState.l | ||
XXH64_reset(&cct | ||
return 0; | ||
} | ||
@@ -641,8 +616,10 @@ static size_t ZSTD_resetCCtx_i | ||
if (crp == ZSTDcrp_continue | ||
if (ZSTD_equivalent | ||
DEBUGLOG(5, "ZSTD_equivalent | ||
- zc->fseCTables_r | ||
- zc->hufCTable_re | ||
+ zc->entropy->huf | ||
+ zc->entropy->off | ||
+ zc->entropy->mat | ||
+ zc->entropy->lit | ||
return ZSTD_continueCCt | ||
} } | ||
@@ -662,9 +639,7 @@ static size_t ZSTD_resetCCtx_i | ||
void* ptr; | ||
/* Check if workSpace is large enough, alloc a new one if needed */ | ||
- { size_t const entropySpace = hufCTable_size + litlengthCTable_ | ||
- + offcodeCTable_si | ||
- + entropyScratchSp | ||
+ { size_t const entropySpace = sizeof(ZSTD_entr | ||
size_t const optPotentialSpac | ||
+ (ZSTD_OPT_NUM+1) | ||
size_t const optSpace = ( (params.cParams. | ||
@@ -689,16 +664,9 @@ static size_t ZSTD_resetCCtx_i | ||
ptr = zc->workSpace; | ||
/* entropy space */ | ||
- zc->hufCTable = (HUF_CElt*)ptr; | ||
- ptr = (char*)zc->hufCT | ||
- zc->offcodeCTabl | ||
- ptr = (char*)ptr + offcodeCTable_si | ||
- zc->matchlengthC | ||
- ptr = (char*)ptr + matchlengthCTabl | ||
- zc->litlengthCTa | ||
- ptr = (char*)ptr + litlengthCTable_ | ||
- assert(((size_t) | ||
- zc->entropyScrat | ||
+ assert(((size_t) | ||
+ assert(zc->workS | ||
+ zc->entropy = (ZSTD_entropyCTa | ||
} } | ||
/* init params */ | ||
@@ -715,39 +683,35 @@ static size_t ZSTD_resetCCtx_i | ||
zc->stage = ZSTDcs_init; | ||
zc->dictID = 0; | ||
zc->loadedDictEn | ||
- zc->fseCTables_r | ||
- zc->hufCTable_re | ||
+ zc->entropy->huf | ||
+ zc->entropy->off | ||
+ zc->entropy->mat | ||
+ zc->entropy->lit | ||
zc->nextToUpdate | ||
zc->nextSrc = NULL; | ||
zc->base = NULL; | ||
zc->dictBase = NULL; | ||
zc->dictLimit = 0; | ||
zc->lowLimit = 0; | ||
- { int i; for (i=0; i<ZSTD_REP_NUM; i++) zc->rep[i] = repStartValue[i] | ||
+ { int i; for (i=0; i<ZSTD_REP_NUM; i++) zc->seqStore.rep | ||
zc->hashLog3 = hashLog3; | ||
- zc->seqStore.lit | ||
+ zc->optState.lit | ||
- /* ensure entropy tables are close together at the beginning */ | ||
- assert((void*)zc | ||
- assert((char*)zc | ||
- assert((char*)zc | ||
- assert((char*)zc | ||
- assert((char*)zc | ||
- ptr = (char*)zc->entro | ||
+ ptr = zc->entropy + 1; | ||
/* opt parser space */ | ||
if ((params.cParams | ||
DEBUGLOG(5, "reserving optimal parser space"); | ||
assert(((size_t) | ||
- zc->seqStore.lit | ||
- zc->seqStore.lit | ||
- zc->seqStore.mat | ||
- zc->seqStore.off | ||
- ptr = zc->seqStore.off | ||
- zc->seqStore.mat | ||
- ptr = zc->seqStore.mat | ||
- zc->seqStore.pri | ||
- ptr = zc->seqStore.pri | ||
+ zc->optState.lit | ||
+ zc->optState.lit | ||
+ zc->optState.mat | ||
+ zc->optState.off | ||
+ ptr = zc->optState.off | ||
+ zc->optState.mat | ||
+ ptr = zc->optState.mat | ||
+ zc->optState.pri | ||
+ ptr = zc->optState.pri | ||
} | ||
/* table Space */ | ||
@@ -783,7 +747,7 @@ static size_t ZSTD_resetCCtx_i | ||
* do not use with extDict variant ! */ | ||
void ZSTD_invalidateR | ||
int i; | ||
- for (i=0; i<ZSTD_REP_NUM; i++) cctx->rep[i] = 0; | ||
+ for (i=0; i<ZSTD_REP_NUM; i++) cctx->seqStore.r | ||
} | ||
@@ -830,16 +794,7 @@ static size_t ZSTD_copyCCtx_in | ||
dstCCtx->dictID = srcCCtx->dictID; | ||
/* copy entropy tables */ | ||
- dstCCtx->fseCTab | ||
- if (srcCCtx->fseCTa | ||
- memcpy(dstCCtx-> | ||
- memcpy(dstCCtx-> | ||
- memcpy(dstCCtx-> | ||
- } | ||
- dstCCtx->hufCTab | ||
- if (srcCCtx->hufCTa | ||
- memcpy(dstCCtx-> | ||
- } | ||
+ memcpy(dstCCtx-> | ||
return 0; | ||
} | ||
@@ -956,7 +911,8 @@ static size_t ZSTD_compressRle | ||
static size_t ZSTD_minGain(siz | ||
-static size_t ZSTD_compressLit | ||
+static size_t ZSTD_compressLit | ||
+ ZSTD_strategy strategy, | ||
void* dst, size_t dstCapacity, | ||
const void* src, size_t srcSize) | ||
{ | ||
@@ -970,28 +926,28 @@ static size_t ZSTD_compressLit | ||
/* small ? don't even attempt compression (speed opt) */ | ||
# define LITERAL_NOENTROP | ||
- { size_t const minLitSize = zc->hufCTable_re | ||
+ { size_t const minLitSize = entropy->hufCTab | ||
if (srcSize <= minLitSize) return ZSTD_noCompressL | ||
} | ||
if (dstCapacity < lhSize+1) return ERROR(dstSize_to | ||
- { HUF_repeat repeat = zc->hufCTable_re | ||
- int const preferRepeat = zc->appliedParam | ||
+ { HUF_repeat repeat = entropy->hufCTab | ||
+ int const preferRepeat = strategy < ZSTD_lazy ? srcSize <= 1024 : 0; | ||
if (repeat == HUF_repeat_valid | ||
cLitSize = singleStream ? HUF_compress1X_r | ||
- zc->entropyScrat | ||
+ entropy->workspa | ||
: HUF_compress4X_r | ||
- zc->entropyScrat | ||
+ entropy->workspa | ||
if (repeat != HUF_repeat_none) | ||
- else { zc->hufCTable_re | ||
+ else { entropy->hufCTab | ||
} | ||
- if ((cLitSize==0) | (cLitSize >= srcSize - minGain)) { | ||
- zc->hufCTable_re | ||
+ if ((cLitSize==0) | (cLitSize >= srcSize - minGain) | ERR_isError(cLit | ||
+ entropy->hufCTab | ||
return ZSTD_noCompressL | ||
} | ||
if (cLitSize==1) { | ||
- zc->hufCTable_re | ||
+ entropy->hufCTab | ||
return ZSTD_compressRle | ||
} | ||
@@ -1062,17 +1018,154 @@ void ZSTD_seqToCodes( | ||
mlCodeTable[seqS | ||
} | ||
-MEM_STATIC size_t ZSTD_compressSeq | ||
- void* dst, size_t dstCapacity, | ||
- size_t srcSize) | ||
+MEM_STATIC symbolEncodingTy | ||
+ size_t const mostFrequent, size_t nbSeq, U32 defaultNormLog) | ||
+{ | ||
+#define MIN_SEQ_FOR_DYNA | ||
+#define MAX_SEQ_FOR_STAT | ||
+ | ||
+ if ((mostFrequent == nbSeq) && (nbSeq > 2)) { | ||
+ *repeatMode = FSE_repeat_check | ||
+ return set_rle; | ||
+ } | ||
+ if ((*repeatMode == FSE_repeat_valid | ||
+ return set_repeat; | ||
+ } | ||
+ if ((nbSeq < MIN_SEQ_FOR_DYNA | ||
+ *repeatMode = FSE_repeat_valid | ||
+ return set_basic; | ||
+ } | ||
+ *repeatMode = FSE_repeat_check | ||
+ return set_compressed; | ||
+} | ||
+ | ||
+MEM_STATIC size_t ZSTD_buildCTable | ||
+ FSE_CTable* CTable, U32 FSELog, symbolEncodingTy | ||
+ U32* count, U32 max, | ||
+ BYTE const* codeTable, size_t nbSeq, | ||
+ S16 const* defaultNorm, U32 defaultNormLog, U32 defaultMax, | ||
+ void* workspace, size_t workspaceSize) | ||
+{ | ||
+ BYTE* op = (BYTE*)dst; | ||
+ BYTE const* const oend = op + dstCapacity; | ||
+ | ||
+ switch (type) { | ||
+ case set_rle: | ||
+ *op = codeTable[0]; | ||
+ CHECK_F(FSE_buil | ||
+ return 1; | ||
+ case set_repeat: | ||
+ return 0; | ||
+ case set_basic: | ||
+ CHECK_F(FSE_buil | ||
+ return 0; | ||
+ case set_compressed: { | ||
+ S16 norm[MaxSeq + 1]; | ||
+ size_t nbSeq_1 = nbSeq; | ||
+ const U32 tableLog = FSE_optimalTable | ||
+ if (count[codeTable | ||
+ count[codeTable[ | ||
+ nbSeq_1--; | ||
+ } | ||
+ CHECK_F(FSE_norm | ||
+ { size_t const NCountSize = FSE_writeNCount( | ||
+ if (FSE_isError(NCo | ||
+ CHECK_F(FSE_buil | ||
+ return NCountSize; | ||
+ } | ||
+ } | ||
+ default: return assert(0), ERROR(GENERIC); | ||
+ } | ||
+} | ||
+ | ||
+MEM_STATIC size_t ZSTD_encodeSeque | ||
+ FSE_CTable const* CTable_MatchLeng | ||
+ FSE_CTable const* CTable_OffsetBit | ||
+ FSE_CTable const* CTable_LitLength | ||
+ seqDef const* sequences, size_t nbSeq, int longOffsets) | ||
+{ | ||
+ BIT_CStream_t blockStream; | ||
+ FSE_CState_t stateMatchLength | ||
+ FSE_CState_t stateOffsetBits; | ||
+ FSE_CState_t stateLitLength; | ||
+ | ||
+ CHECK_E(BIT_init | ||
+ | ||
+ /* first symbols */ | ||
+ FSE_initCState2( | ||
+ FSE_initCState2( | ||
+ FSE_initCState2( | ||
+ BIT_addBits(&blo | ||
+ if (MEM_32bits()) BIT_flushBits(&b | ||
+ BIT_addBits(&blo | ||
+ if (MEM_32bits()) BIT_flushBits(&b | ||
+ if (longOffsets) { | ||
+ U32 const ofBits = ofCodeTable[nbSe | ||
+ int const extraBits = ofBits - MIN(ofBits, STREAM_ACCUMULAT | ||
+ if (extraBits) { | ||
+ BIT_addBits(&blo | ||
+ BIT_flushBits(&b | ||
+ } | ||
+ BIT_addBits(&blo | ||
+ ofBits - extraBits); | ||
+ } else { | ||
+ BIT_addBits(&blo | ||
+ } | ||
+ BIT_flushBits(&b | ||
+ | ||
+ { size_t n; | ||
+ for (n=nbSeq-2 ; n<nbSeq ; n--) { /* intentional underflow */ | ||
+ BYTE const llCode = llCodeTable[n]; | ||
+ BYTE const ofCode = ofCodeTable[n]; | ||
+ BYTE const mlCode = mlCodeTable[n]; | ||
+ U32 const llBits = LL_bits[llCode]; | ||
+ U32 const ofBits = ofCode; /* 32b*/ /* 64b*/ | ||
+ U32 const mlBits = ML_bits[mlCode]; | ||
+ /* (7)*/ /* (7)*/ | ||
+ FSE_encodeSymbol | ||
+ FSE_encodeSymbol | ||
+ if (MEM_32bits()) BIT_flushBits(&b | ||
+ FSE_encodeSymbol | ||
+ if (MEM_32bits() || (ofBits+mlBits+l | ||
+ BIT_flushBits(&b | ||
+ BIT_addBits(&blo | ||
+ if (MEM_32bits() && ((llBits+mlBits) | ||
+ BIT_addBits(&blo | ||
+ if (MEM_32bits()) BIT_flushBits(&b | ||
+ if (longOffsets) { | ||
+ int const extraBits = ofBits - MIN(ofBits, STREAM_ACCUMULAT | ||
+ if (extraBits) { | ||
+ BIT_addBits(&blo | ||
+ BIT_flushBits(&b | ||
+ } | ||
+ BIT_addBits(&blo | ||
+ ofBits - extraBits); /* 31 */ | ||
+ } else { | ||
+ BIT_addBits(&blo | ||
+ } | ||
+ BIT_flushBits(&b | ||
+ } } | ||
+ | ||
+ FSE_flushCState( | ||
+ FSE_flushCState( | ||
+ FSE_flushCState( | ||
+ | ||
+ { size_t const streamSize = BIT_closeCStream | ||
+ if (streamSize==0) return ERROR(dstSize_to | ||
+ return streamSize; | ||
+ } | ||
+} | ||
+ | ||
+MEM_STATIC size_t ZSTD_compressSeq | ||
+ ZSTD_entropyCTab | ||
+ ZSTD_compression | ||
+ void* dst, size_t dstCapacity) | ||
{ | ||
- const int longOffsets = zc->appliedParam | ||
- const seqStore_t* seqStorePtr = &(zc->seqStore); | ||
+ const int longOffsets = cParams->windowL | ||
U32 count[MaxSeq+1]; | ||
- S16 norm[MaxSeq+1]; | ||
- FSE_CTable* CTable_LitLength | ||
- FSE_CTable* CTable_OffsetBit | ||
- FSE_CTable* CTable_MatchLeng | ||
+ FSE_CTable* CTable_LitLength | ||
+ FSE_CTable* CTable_OffsetBit | ||
+ FSE_CTable* CTable_MatchLeng | ||
U32 LLtype, Offtype, MLtype; /* compressed, raw or rle */ | ||
const seqDef* const sequences = seqStorePtr->seq | ||
const BYTE* const ofCodeTable = seqStorePtr->ofC | ||
@@ -1083,13 +1176,16 @@ MEM_STATIC size_t ZSTD_compressSeq | ||
BYTE* op = ostart; | ||
size_t const nbSeq = seqStorePtr->seq | ||
BYTE* seqHead; | ||
- BYTE scratchBuffer[1< | ||
+ | ||
+ ZSTD_STATIC_ASSE | ||
/* Compress literals */ | ||
{ const BYTE* const literals = seqStorePtr->lit | ||
size_t const litSize = seqStorePtr->lit | ||
- size_t const cSize = ZSTD_compressLit | ||
- if (ZSTD_isError(cS | ||
+ size_t const cSize = ZSTD_compressLit | ||
+ entropy, cParams->strateg | ||
+ if (ZSTD_isError(cS | ||
+ return cSize; | ||
op += cSize; | ||
} | ||
@@ -1098,177 +1194,89 @@ MEM_STATIC size_t ZSTD_compressSeq | ||
if (nbSeq < 0x7F) *op++ = (BYTE)nbSeq; | ||
else if (nbSeq < LONGNBSEQ) op[0] = (BYTE)((nbSeq>>8 | ||
else op[0]=0xFF, MEM_writeLE16(op | ||
- if (nbSeq==0) goto _check_compressi | ||
+ if (nbSeq==0) return op - ostart; | ||
/* seqHead : flags for FSE encoding type */ | ||
seqHead = op++; | ||
-#define MIN_SEQ_FOR_DYNA | ||
-#define MAX_SEQ_FOR_STAT | ||
- | ||
/* convert length/distances | ||
ZSTD_seqToCodes( | ||
- | ||
/* CTable for Literal Lengths */ | ||
{ U32 max = MaxLL; | ||
- size_t const mostFrequent = FSE_countFast_wk | ||
- if ((mostFrequent == nbSeq) && (nbSeq > 2)) { | ||
- *op++ = llCodeTable[0]; | ||
- FSE_buildCTable_ | ||
- LLtype = set_rle; | ||
- } else if ((zc->fseCTables | ||
- LLtype = set_repeat; | ||
- } else if ((nbSeq < MIN_SEQ_FOR_DYNA | ||
- FSE_buildCTable_ | ||
- LLtype = set_basic; | ||
- } else { | ||
- size_t nbSeq_1 = nbSeq; | ||
- const U32 tableLog = FSE_optimalTable | ||
- if (count[llCodeTab | ||
- FSE_normalizeCou | ||
- { size_t const NCountSize = FSE_writeNCount( | ||
- if (FSE_isError(NCo | ||
- op += NCountSize; } | ||
- FSE_buildCTable_ | ||
- LLtype = set_compressed; | ||
+ size_t const mostFrequent = FSE_countFast_wk | ||
+ LLtype = ZSTD_selectEncod | ||
+ { size_t const countSize = ZSTD_buildCTable | ||
[diff truncated] |